Live now on the LAION Discord Server for you to try!
dalle-flow
gRPC interface to independently serve images from any number of GPUs, while higher memory calls to the gRPC through the bot are forked onto individual instances of Python.dalle-flow
for text-to-image generation.>
-- whichever you find easier.stable-diffusion
branch that is more optimized than that one.sd-lite
branch has been merged upstream, so now low VRAM is available with docker images too.optimized-sd
branch has moved to sd-lite
branch, which will be merged upstream. Includes small bugfixes and enhanced interpolation. Upstream docker image is now functional, so instructions have been added for installing that.interpolate
command.dalle-flow
branch optimized-sd
.dalle-flow
. Added docker installation instructions.This bot does not come equipped with a NSFW filter for content by default and will make any content out of the box. Please be sure to read and agree with the license for the weights, as well as the MIT license, and abide by all applicable laws and regulations in your respective area.
To enable the NSFW filter to automatically add the spoiler tag to any potential NSFW images, use the flag --nsfw-auto-spoiler
. You must first pip install -r requirements_nsfw_filter.txt
to get the modules required for this.
To enable NSFW prompt detection via BERT, use the flag --nsfw-prompt-detection
and be sure to pip install -r requirements_nsfw_filter.txt
.
To reject any prompts if they contain a word within a wordlist, use the --nsfw-wordlist
flag, e.g. --nsfw-wordlist bad_words.txt
. The wordlist should be strings separated by newlines.
Python 3 3.9+ with pip and virtualenv installed (Ubuntu 22.04 works great!)
CUDA runtime environment installed
An NVIDIA GPU with >= 7 GB of VRAM
If running with a low VRAM GPU, you will not have access to the >upscale
endpoint as you will run out of RAM. Buying an RTX 3090 or renting a server with one is recommended.
This installation is intended for debian or arch flavored linux users. YMMV. You will need to have Python 3 and pip installed.
sudo apt install python3 python3-pip
sudo pip3 install virtualenv
Install the Nvidia docker container environment if you have not already.
Pull the dalle-flow
docker image with:
docker pull jinaai/dalle-flow:latest
Log into Huggingface, agree to RunwayML's terms of service, go to RunwayML's repository for the latest version, then download sd-v1-5-inpainting.ckpt
. Rename that to model.ckpt
and then, from that directory, run the following commands:
mkdir ~/ldm
mkdir ~/ldm/stable-diffusion-v1
mv model.ckpt ~/ldm/stable-diffusion-v1/model.ckpt
Then run the container with this command:
sudo docker run -e DISABLE_CLIP="1" \
-e DISABLE_DALLE_MEGA="1" \
-e DISABLE_GLID3XL="1" \
-e ENABLE_CLIPSEG="1" \
-e ENABLE_REALESRGAN="1" \
-e ENABLE_STABLE_DIFFUSION="1" \
-p 51005:51005 \
-it \
-v ~/ldm:/dalle/stable-diffusion/models/ldm/ \
-v $HOME/.cache:/home/dalle/.cache \
--gpus all \
jinaai/dalle-flow
Somewhere else, clone this repository and follow these steps:
git clone https://github.com/AmericanPresidentJimmyCarter/yasd-discord-bot/
cd yasd-discord-bot
python3 -m virtualenv env
source env/bin/activate
pip install -r requirements.txt
Then you can start the bot with:
cd src
python -m bot YOUR_DISCORD_BOT_TOKEN -g YOUR_GUILD_ID
Be sure you have the "Message Content Intent" flag set to be on in your bot settings!
Where YOUR_DISCORD_BOT_TOKEN is your token and YOUR_GUILD_ID is the integer ID for your server (right click on the server name, then click "Copy ID"). Supplying the guild ID is optional, but it will result in the slash commands being available to your server almost instantly. Once the bot is connected, you can read about how to use it with >help
.
The bot uses the folders as a bus to store/shuttle data. All images created are stored in images/
.
OPTIONAL: If you aren't running jina on the same box, you will need change the address to connect to declared as constant JINA_SERVER_URL
in imagetool.py
.
Install the Nvidia docker container environment if you have not already.
Make a folder for dalle-flow
:
mkdir ~/dalle
cd ~/dalle
git clone https://github.com/jina-ai/dalle-flow
cd dalle-flow
Log into Huggingface, agree to RunwayML's terms of service, go to RunwayML's repository for the latest version, then download sd-v1-5-inpainting.ckpt
. Rename that to model.ckpt
and then, from that directory, run the following commands:
mkdir ~/ldm
mkdir ~/ldm/stable-diffusion-v1
mv model.ckpt ~/ldm/stable-diffusion-v1/model.ckpt
In the dalle-flow
folder (cd ~/dalle/dalle-flow
), build with this command:
docker build --build-arg GROUP_ID=$(id -g ${USER}) --build-arg USER_ID=$(id -u ${USER}) -t jinaai/dalle-flow .
Then run the container with this command:
sudo docker run -e DISABLE_CLIP="1" \
-e DISABLE_DALLE_MEGA="1" \
-e DISABLE_GLID3XL="1" \
-e ENABLE_CLIPSEG="1" \
-e ENABLE_REALESRGAN="1" \
-e ENABLE_STABLE_DIFFUSION="1" \
-p 51005:51005 \
-it \
-v ~/ldm:/dalle/stable-diffusion/models/ldm/ \
-v $HOME/.cache:/home/dalle/.cache \
--gpus all \
jinaai/dalle-flow
Somewhere else, clone this repository and follow these steps:
git clone https://github.com/AmericanPresidentJimmyCarter/yasd-discord-bot/
cd yasd-discord-bot
python3 -m virtualenv env
source env/bin/activate
pip install -r requirements.txt
Then you can start the bot with:
cd src
python -m bot YOUR_DISCORD_BOT_TOKEN -g YOUR_GUILD_ID
Be sure you have the "Message Content Intent" flag set to be on in your bot settings!
Where YOUR_DISCORD_BOT_TOKEN is your token and YOUR_GUILD_ID is the integer ID for your server (right click on the server name, then click "Copy ID"). Supplying the guild ID is optional, but it will result in the slash commands being available to your server almost instantly. Once the bot is connected, you can read about how to use it with >help
.
The bot uses the folders as a bus to store/shuttle data. All images created are stored in images/
.
OPTIONAL: If you aren't running jina on the same box, you will need change the address to connect to declared as constant JINA_SERVER_URL
in imagetool.py
.
Follow the instructions for dalle-flow to install and run that server. The steps you need to follow can be found under "Run natively". Once flow
is up and running, proceed to the next step.
At this time, if you haven't already, you will need to put the stable diffusion weights into dalle/stable-diffusion/models/ldm/stable-diffusion-v1/model.ckpt
.
Need to download the weights? Log into Huggingface, agree to RunwayML's terms of service, go to RunwayML's repository for the latest version, then download sd-v1-5-inpainting.ckpt
. Rename that to model.ckpt
and put it into the location specified above.
To start jina with old models disabled when you're all done:
python flow_parser.py --enable-stable-diffusion --disable-dalle-mega --disable-glid3xl
jina flow --uses flow.tmp.yml
Jina should display lots of pretty pictures to tell you it's working. It may take a bit on first boot to load everything.
Somewhere else, clone this repository and follow these steps:
git clone https://github.com/AmericanPresidentJimmyCarter/yasd-discord-bot/
cd yasd-discord-bot
python3 -m virtualenv env
source env/bin/activate
pip install -r requirements.txt
Then you can start the bot with:
cd src
python -m bot YOUR_DISCORD_BOT_TOKEN -g YOUR_GUILD_ID
Be sure you have the "Message Content Intent" flag set to be on in your bot settings!
Where YOUR_DISCORD_BOT_TOKEN is your token and YOUR_GUILD_ID is the integer ID for your server (right click on the server name, then click "Copy ID"). Supplying the guild ID is optional, but it will result in the slash commands being available to your server almost instantly. Once the bot is connected, you can read about how to use it with >help
.
The bot uses the folders as a bus to store/shuttle data. All images created are stored in images/
.
OPTIONAL: If you aren't running jina on the same box, you will need change the address to connect to declared as constant JINA_SERVER_URL
in imagetool.py
.
/image foo bar
)/image [foo, bar]
)/image foo bar (seed_search=t)
)>image2image foo bar
)/riff <id> <idx>
)/interpolate <prompt 1> <prompt 2>
)Examples:
>image A United States twenty dollar bill with [Jerry Seinfeld, Jason Alexander, Michael Richards, Julia Louis-Dreyfus]'s portrait in the center (seed=2)
>image2image Still from Walt Disney's The Princess and the Frog, 2001 (iterations=4, strength=0.6, scale=15)
Attached image
Output image
>interpolate Sonic the Hedgehog portrait | European Hedgehog Portrait
Open an issue here.
Be cool, stay in school.
Copyright 2022 Jimmy (AmericanPresidentJimmyCarter)