xvarc / wombot

Unofficial API and discord bot for wombo.art

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wombot

An unofficial API and discord bot for wombo.art, aka Wombo Dream. It lets you queue and download the final and intermediary images of the AI, bypassing the limitations of the official webpage.

Projects using this library

Here are links towards other (cool) projects that make use of this library:

Installation

First, clone this repository:

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

# Used by the next step
cp secret-template.json secret.json

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 made 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 start the bot, you can 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", // See the "Installation" section for more information
}).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 am not a lawyer, so take the following section as my opinion and not legal advice:

Wombo.ai states in their Terms of Service that they own the "Original Content" their software "has". If this includes images generated by the AI (which is still a gray thing, there hasn't been a consensus on who claims ownership on AI-generated artwork), then you cannot post any of the pictures generated by Wombo's product. If we assume that they do claim ownership on the images generated, then:

  • you couldn't share the "trading card" preview (the one with the watermark), unless they sent you a letter with the rights to do so
  • you couldn't run the discord bot, because that requires giving Discord the rights to reproduce the image on their app
  • it would be debatable whether the copies made for private use done through this unofficial API are legal:

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. This would depend on whether the usage of an unofficial API extends the definition of using the website through a regular browser.

About

Unofficial API and discord bot for wombo.art

License:MIT License


Languages

Language:JavaScript 100.0%