Giter VIP home page Giter VIP logo

wombot's Introduction

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 and install the required dependencies:

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

If you wish to run the discord bot, then copy the file named secret-template.json to secret.json and fill in the required fields in it.

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
}).then(data => {
    console.log(data.path); // Path of the downloaded file
}).catch(err => {
    console.error(err);
});

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:

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.

wombot's People

Contributors

adri326 avatar iskovpin avatar konscanner avatar leopoldhub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wombot's Issues

[bug] crash before finishing download

Hi,
The app works great except that once all images are generated, it crashes before ending downloads... :/

Here are the logs:

1: progress (23/24)
2: progress (22/24)
3: progress (21/24)
4: progress (21/24)
0: progress (23/24)
1: progress (23/24)
2: progress (23/24)
3: progress (23/24)
4: progress (23/24)
0: progress (24/24)
1: progress (24/24)
2: progress (24/24)
3: progress (23/24)
4: progress (23/24)
0: generated (24/24)
1: generated (24/24)
2: generated (24/24)
3: progress (24/24)
4: progress (24/24)
3: generated (24/24)
4: generated (24/24)
node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: write EPROTO
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:98:16)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (node:_http_client:447:9)
    at TLSSocket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -71,
  code: 'EPROTO',
  syscall: 'write'
}

I hope you can do something for it,
Great work!

Better explanation for identify_key (Originally 'how to get the "identify_key"?')

hello,
thank you for sharing this project! I really like to get it to work ;)
So, can you please explain (for beginners) how to get the "identify_key"?

i see in the secret.json file, it says:
the key used by wombo.art to identify themselves on google, use F12 to find it: every request to googleapis.com ends with ...?key=THIS_VALUE

but when I hit F12 on the "https://app.wombo.art/" website, I see no code with "?key="...

thank you in advance.

Trying to execute from a loop

Hello, I'm trying to execute the wombot inside a looop, where the script reads a txt file with dozens of prompts and the execute. I used the directions in the section about the module, but I keep getting the error/;

wombot("random", 3, (data) => {
^

TypeError: wombot is not a function
at Object. (C:\Users\06979789902\willbot.js:13:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47

This is my code, I'm trying execute on Anaconda as .js file:

const wombot = require("wombot");

function readfile() {
var fs = require('fs');
var file = fs.readFileSync('prompts.txt', 'utf8');
var lines = file.split('\n');
for (var i = 0; i < lines.length; i++) {
console.log(lines[i]);
wombot(lines[i], 3);
}
}

wombot("random", 3, (data) => {
console.log(data.status);
}, {
final: true, // Download the final image
inter: false, // Download the intermediary results,
download_dir: "./generated/", // Where to download images
}).then(data => {
console.log(data.path); // Path of the downloaded file
}).catch(err => {
console.error(err);
});

RestError: Error: connect ETIMEDOUT 142.251.43.10:443

I get this error after CLI input:

C:\Users\dell\Desktop\@independent\wombot>node cli.js "Dark swords and light winds" 10 Prompt: Dark swords and light winds, Style: Dark Fantasy`
C:\Users\dell\Desktop@independent\wombot\rest.js:127
reject(new RestError(this.hostname, path, err));
^

RestError: Error: connect ETIMEDOUT 142.251.43.10:443
at ClientRequest. (C:\Users\dell\Desktop@independent\wombot\rest.js:127:24)
at ClientRequest.emit (node:events:520:28)
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
hostname: 'identitytoolkit.googleapis.com',
path: '/v1/accounts:signUp?key=AIzaSyDCvp5MTJLUdtBYEKYWXJrlLzu1zuKM6Xw'
}`

How to solve it please? Thanks so much~

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.