Scripts for using img2img/depth2image, tailored for transforming 3D renders with Stable Diffusion.
Keep it simple - written in a way thats easy to modify and hack for your own purposes.
โ | Positive / negative prompts |
โ | Dynamic prompt generator |
โ | Generate sequences of images |
โ | Optimised for high(er) res |
โ | img2img or depth2img |
โ | Compatible with SD 1.4/1.5/2.0/2.1 |
โ | Load custom models |
โ | No ui / code only |
- Clone repo, put source animation frames (png) in
./in
- Install reqs
pip install -r requirements.txt
- Edit settings in
./waste.py
- Run script with
python3 waste.py
and images will be output to./out
Use prompt_gen
-- a simple, but powerful, function that allows you to pass in
lists of words/prompts and cycle through them at varying speeds and indices.
bug_type = ["shiny", "squashed", "giant", "monster", "cute"]
location = ["in the sky", "floating on water", "crawling on flesh"]
f"{prompt_gen(bug_type, 6, 3)} bug {prompt_gen(location, 15, 3)}"
# shiny bug in the sky
f"{prompt_gen(bug_type, 6, 22)} bug {prompt_gen(location, 15, 22)}"
# monster bug floating on water
f"{prompt_gen(bug_type, 6, 41)} bug {prompt_gen(location, 15, 41)}"
# squashed bug crawling on flesh
...and so on -- you can also use these for strength/guide/seed/steps values if you are silly.
strength_list = [0.8, 0.7, 0.6, 0.5]
step_list = [40, 45, 50, 12]
strength = prompt_gen(strength_list, 6, 41)
steps = prompt_gen(step_list, 6, 41)
Convert frames to video
ffmpeg -framerate 8 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4
Convert video to frames
ffmpeg -i input.mp4 -pix_fmt rgba output_%04d.png