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 toapp.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 togoogleapis.com
. For instance, one request looks likehttps://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.