GithubHelp home page GithubHelp logo

wombot's Introduction

Wombot

An unofficial API and discord bot for wombo.art.

Installation

First, clone this repository:

git clone https://github.com/adri326/wombot/
cd wombot
npm install

Then, copy the secret-template.json and rename it to secret.json, and fill out the required entries for your usage:

  • For the CLI interface, you only need to input identify_key: this key can be found by going to app.wombo.art, then opening the F12 screen, going in the "Network" tab and reloading the page. The key appears at the end of every request to googleapis.com. For instance, one request looks like https://securetoken.googleapis.com/v1/token?key=THE_IDENTIFY_KEY.
  • For the discord bot, you need to provide all of the entries

CLI

The CLI interface is able to submit one or multiple tasks and download the results for you.

Following is an example querying the API with the prompt "Dark swords and light winds", with style "Dark Fantasy" (10):

node cli.js "Dark swords and light winds" 10

You can find more options and the list of styles by running node cli.js --help!

Bot

Make sure that the CLI interface works (see above section) before running the bot. Also, please verify the code in this repository and don't blindly give it the token of a discord bot.

To run the bot, run:

node bot.js

Node.js module

If you wish to use this API using a node.js module, then you should import this repository using npm or yarn:

npm install --save adri326/wombot

Then, in your code, import this library:

const wombot = require("wombot");

wombot("Your prompt", 10, (data) => {
    // Callback for intermediary results, useful for debugging
    console.log(data.status);
}, {
    final: true, // Download the final image
    inter: false, // Download the intermediary results,
    download_dir: "./generated/", // Where to download images
    identify_key: "The key used by wombo.art to identify sessions", // Available (as of writing this) by looking at the requests made on the website
}).then(data => {
    console.log(data.path); // Path of the downloaded file
}).catch(err => {
    console.error(err);
});

The identify_key token is meant to be kept private, so you shouldn't write it into your source code but rather into an outside file, ignored by your VCS.

Legal disclaimer

The code in this repository is provided to you AS IS, without any kind of warranty. I'm not a lawyer of any kind and I don't know copyright law, so this is only my opinion and not legal advice.

I am not liable for whatever you do with it. Wombo.ai states in their Terms of Service that they own whatever "Original Content" their software "has". If this includes images generated by the AI (which is still a gray area, from what I could read), then you cannot post anything from them, even if you got a paid subscription or if you're sharing the "trading card" preview (the one with the watermark), unless they send you a letter with the rights.

Because uploading the images to discord requires you to give discord the rights to reproduce the image on their app, using the discord bot is also gray.

Whether copies for private use made using the unofficial API are legal or not is debatable. This script only reproduces the sequence of requests made by the website and downloads data already downloaded by the website and shown to the user, albeit only temporarily. One could open the Developer Tools on the official website and download the same version there. That being said, I don't know the laws regarding browsers and copyright, and whether or not automated scripts count as legitimate use, so don't take my word on that.

wombot's People

Contributors

adri326 avatar iskovpin avatar

Forkers

norwwwik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.