Skip to content

๐Ÿšฎ Scripts for depth2img/img2img with Stable Diffusion

Notifications You must be signed in to change notification settings

exhibitionist-digital/e-waste-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿšฎ E-WASTE PIPELINE

e-waste

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

How to use

  • 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

Dynamic prompt generator

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)

Handy FFMPEG scripts

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

About

๐Ÿšฎ Scripts for depth2img/img2img with Stable Diffusion

Topics

Resources

Stars

Watchers

Forks

Languages