Make an AI Image Generator Discord Bot like Midjourney 🎨🤖
HTML-код
- Опубликовано: 14 окт 2024
- Make an AI Image Generator Discord Bot like Midjourney 🎨🤖
This video covers how to make an AI Image Generator Discord Bot similar to Midjourney. You don’t need to know how to code as this video only shows how to use an existing codebase where you can add your credentials and use the bot freely. Technologies used includes Node.js, Discord.js (v14.9), and Replicate.
🌐 Important links
Node.js: nodejs.org
Visual Studio Code: code.visualstu...
Github (bot code): github.com/not...
Discord Developer Portal: / discord
Replicate: replicate.com
Host your bot 24/7: • How to Host your Disco...
Discord: discord.underc...
Github: github.com/not...
Patreon: / underctrl
Buy me a coffee (one-time donation): buymeacoffee.c...
Thank you very much! I'm using your bot in our little Discord Community and it works well. I just have a few questions. Is there a way to tweak the outputs? Especially using the mini dall-e model, it generates a grid of 5x5 images which takes a very long time and imo is not that useful. I'd prefer one large image. Also, are there plans to add Stable Diffusion XL 1.0? Looks like they also have a model on replicate now. I really appreciate your work, saved my day!
When I do npn install this comes up:
**name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ npm install
+ ~~~
+ CategoryInfo : ObjectNotFound: (npn:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException**
As an error
Do you know what I did wrong ?
for windows ?
I haves the same problem
thanks a lot man! it worked! . Do you know should be possible with this bot, the image-to-image function? or how to achieve it? I tried right away (midjourney style) but no works... thanks in advance!
Hi, image to image might be a little more difficult to implement. But it's definitely possible. I'd suggest looking into the API reference for that in Replicate to help you get started. If it's not too extra, I might even do a video on it in the near future!
Here are some models I found on Replicate which deal with image inputs.
- ML Makeovers: replicate.com/collections/ml-makeovers
- Super resolution: replicate.com/collections/super-resolution
- Style transfer: replicate.com/collections/style-transfer
- Image restoration: replicate.com/collections/image-restoration
Pretty sure you can find a ton more so make sure to check out replicate.com/explore in case I'm missing something.
@@UnderCtrl Thanks ton man! i'll dig into it
can we use other services instead of Replicate ?
I appreciate you and everything you do!!
Love your vids
Can you tweak the code to use other ai image generator? Or does this only work with replicate
very helpful, thank you so much!!
Ay thanks for this one ❤
Great vid!
Can you make new video about db caching?(NodeCache or redis)
That's something I have in mind with the economy bot series. Thanks for the suggestion though :)
@@UnderCtrl I did done caching for myself. It's feels like bit pushy however gets job done for now. I wonder how you'll do
Any thoughts on the Reverb bot hack ?
The devs should've responded better. They just made conflicting announcements. Of course, you shouldn't use that bot anymore. If the same devs make another bot, cross check what steps they are taking to avoid this issue, and DO NOT give the bot admin permissions.
@@UnderCtrl very well put! Thank you
Hi,
In My case its is showing that "the application did not respond"
when I use online host To host my bot 24/7. it don't run, Help!
How would I go about registering new models on the bot as well?
I'm interested in this as well. I tried adding stability-ai/sdxl but I couldnt get it to work. I assume that it is the models.js in the src folder which has to be edited and I made a new entry there for sdxl. But that didnt effect the model selection using the /imagine command. I'm a coding noob, I looked through every line of code but didnt see anything else that links to the replicate models. Maybe we need for the author to wait to update the program and add better models like SDXL.
For me it doesn't work with the nPm install. Do you have a tip or can you even help me?
Can we link it to midjourney instead of Replicate?
The quality was really bad on tge imges. Is there anything to do to fix it?
hi, how to create command for upload image. I want to build bot and can support remove background api.
Thank you so much ❤
Can you make a tutorial on how to make an Ai Discord Bot similar to the one used in Ai world?
Since no one’s asked this question, I will.
How long does the free trial last? A week, 2 weeks, 1 month?
The trial isn't really time dependent. It's based on the number of successful requests. And that number, I have no idea.
@@UnderCtrl Ah okay. Thanks for the quick reply. 👍
When I do npn install this comes up:
**name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ npn install
+ ~~~
+ CategoryInfo : ObjectNotFound: (npn:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException**
As an error
Do you know what I did wrong ?
its npm not npn
oh lol i am just an idoit xD@@xavierkessen4186
Is there any free ai image generators to use for this bot?
when i do npm install it says this. npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ npm install
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Bro did u installed nodejs
thats the way to do it i think@@Mr.K-Shorts
Packages are not installing
Neither dollar sign is written in terminal
Good video! but /image doesnt go also with bot online..
The api is like gpt or this is free?
It's only free at the start.
Hey, can you make a video how to make that bot using PC power
let me know if you found a solution to this
@@OdessyShorts Ok)
I am getting a "TypeError: this.fetch is not a function" Error. Do you know why?
Hi, please post your question on my Discord and I'll help you troubleshoot from there :)
I´m getting a message that says token invalid, but I've already checked various times and it´s the one I´m getting from replicate.
It’s your bot token that’s invalid
Just to be clear you will have to pay for this eventually, right?
Yes
I'm getting 'Token invalid' What am I doing wrong? I've tried resetting both token links and still nothing.
I figured it out. Thank you! This is awesome.
I can't seem to make it past this point.
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ npm install
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
That error is due to node.js not being installed correctly.
@@UnderCtrl How do we fix that?
i got the same error and found out because the path messd up after unzip the folder. now working fine
what did you do?
@@ronronmelon
Pls make an replit version!!
when i do npm run start it ticks me
npm ERROR! Missing script: "start"
npm ERROR!
npm ERROR! Did you mean one of these?
npm ERROR! npm star # Mark your favorite packages
npm ERROR! npm stars # View packages marked as favorites
npm ERROR!
npm ERROR! To see a list of scripts, run:
npm ERROR! npm run
how to fix this?
Same
@@RUclipsVertex2k did it resolved ? . Let me know pls as im getting the same error
What if you want the bot to generate 4 pictures
You'd have to modify the code and send 4 attachments because embeds do not support multiple images.
@@UnderCtrl alright fine,, thanks
Hey can you make a moderation bot using open ai moderation endpoint?
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createModeration({
input: "message.",
});
what is it?
I have an error: TypeError: this.fetch is not a function
i have the same err
My terminal isn't doing the command
same
How do you activate NSFW ? :((
imma try it hope it works
npm is not installing
command run error
finally
termanle is brioke fix
can it make nsfw?
can you give me discord sever link. I can't join for image creater bot
i'm getting an err (TypeError: this.fetch is not a function)
Hi, please post your question on my Discord and I'll help you troubleshoot from there :)
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path E:\Coding Project\image-generator-bot-master/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'E:\Coding Project\image-generator-bot-master\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\IT BD\AppData\Local
pm-cache\_logs\2023-06-28T07_20_08_789Z-debug-0.log
what to do????????
In your browser, select the folder "image-generator-bot-master"
Then Right Click: New Terminal at Folder
Then run the NPM Install Function
this is not working, im stuck on the terminal part. in the terminal, i cant type in what you typed. I can only see this: ivyliu@Ivys-MBP-2 image-generator-bot-master 2 %
That’s your current directory and shouldn’t affect the result. Make sure you click the terminal and type. It’s possible the terminal window is not focused.
Thanks for the tutorial, exactly what I was looking for 🫱🏻🫲🏼👍