Skip to content

Local version of Deforum Stable Diffusion, supports txt settings file input and animation features!

License

Notifications You must be signed in to change notification settings

sergiobr/DeforumStableDiffusionLocal

 
 

Repository files navigation

Deforum Stable Diffusion visitors Replicate

Deforum Stable Diffusion Local Version

Local version of Deforum Stable Diffusion V0.7, supports txt settings file input and animation features!

🚩 Updates

  • ✅ 1/12/2023 Add support for Deforum V0.7!!

example

example

example

👇Animated Video👇

example video

Made this quick local Windows version mostly based on the Colab code by deforum, which supports very cool turbo mode animation output for Stable Diffusion!

As an artist and Unity game designer, I may not very familiar with Python code, so let me know whether there is any improvement for this project!

It's tested working on Windows 10 with RTX 2080 SUPER and RTX 3090 GPU (it runs somehow much faster on my local 3090 then Colab..), I haven't tested it on Mac though.

Installation

You can use an anaconda environment to host this local project:

conda create --name dsd python=3.10.6 -y
conda activate dsd

And then cd to the cloned folder, run the setup code, and wait for ≈ 5min until it's finished

python setup.py

Manually download 3 Model Files

You need to put these 3 model files on the ./models folder:

v1-5-pruned-emaonly.ckpt, can be downloaded from HuggingFace.

dpt_large-midas-2f21e586.pt, the download link is here

AdaBins_nyu.pt, the download link is here

How to use it?

After installation, you can try out this command to see if the code is working. The running command should looks like this:

python run.py --enable_animation_mode --settings "./runSettings_Template.txt" --model "v1-5-pruned-emaonly.ckpt"

You can also load customized dreambooth models by putting your model file on the ./models folder, and replace the --model parameter with the new model name.

Here are some extra examples for your reference. You can easily create your own txt file based on these templates!

    1. For generate still images:
python run.py --settings "./examples/runSettings_StillImages.txt"
    1. For animation feature, you need to add --enable_animation_mode to enable animation settings in text file:
python run.py --enable_animation_mode --settings "./examples/runSettings_Animation.txt"
    1. For mask feature:
python run.py --settings "./examples/runSettings_Mask.txt"
    1. For new feature of Deforum V0.7:
python run.py --enable_animation_mode --settings "./examples/runSettings_AnimationExtra.txt"

example My Original Painting on Artstation

The output results will be available at ./output folder.

All the needed variables & prompts for Deforum Stable Diffusion are set in the txt file (You can refer to the Colab page for definition of all the variables), you can have many of settings files for different tasks. There is a template file called runSettings_Template.txt. You can create your own txt settings file as well.

For usage of all the parameters, you can follow this doc

That's it!

About

Local version of Deforum Stable Diffusion, supports txt settings file input and animation features!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.3%
  • Jupyter Notebook 2.7%