--OPTIMIZED IMG2IMG RETARD GUIDE--
(Windows) (Half Precision)
This guide has been replaced
Please visit https://rentry.org/GUItard for the latest features in an even easier guide
Step 1: Download the model from https://drinkordiecdn.lol/sd-v1-3-full-ema.ckpt
Backup Download: https://download1980.mediafire.com/3nu6nlhy92ag/wnlyj8vikn2kpzn/sd-v1-3-full-ema.ckpt
Torrent Magnet: https://rentry.co/6gocs
Step 2: Git clone or download the repo from https://github.com/CompVis/stable-diffusion and extract
(Make sure you have Git beforehand anyway, it will be needed)
Step 3: Go into the repo you downloaded and go to stable-diffusion-main/models/ldm. Create a folder called "stable-diffusion-v1". Rename the .ckpt file to "model.ckpt", and copy it into that folder you've made
Step 4: Create folder titled 'init' in the stable-diffusion-main folder
Step 5: Go into stable-diffusion-main/scripts and open img2img.py in your preferred editor
Step 6: Add .half() at the end of lines 56 and 200
They should go from this
image = torch.from_numpy(image)
model = load_model_from_config(config, f"{opt.ckpt}")
to this
image = torch.from_numpy(image).half()
model = load_model_from_config(config, f"{opt.ckpt}").half()
(Note: if you also plan on doing half-precision txt2img modify the txt2img.py script the same way)
Step 7: Download miniconda HERE: https://docs.conda.io/en/latest/miniconda.html. Download Miniconda 3 Windows
Step 8: Install miniconda. Install for all users. Uncheck "Register Miniconda as the system Python 3.9" unless you want to
Step 9: Open Anaconda Prompt (miniconda3). Go to the stable-diffusion-main folder wherever you downloaded using "cd" to jump folders. or just type "cd" and then drag the folder into the Anaconda prompt
Step 10: Run the following command: "conda env create -f environment.yaml". Make sure you are in the stable-diffusion-main folder with stuff in it
Step 11: Run the following command "conda activate ldm".
You'll need to do this every time you start makin' prompts (and Step 9 to get to the right folder!)
Step 12: Put any images you want to process in the /init folder you made in step 4.
512x512 should process without problem. 512x256 should be even faster.
And you're done
To generate run the following:
python scripts/img2img.py --prompt "your prompt here" --init-img ./init/yourimage.png --strength 0.75
Result will be in the output folder
--PARAMETERS--
(# = stand-in for number(s)
Extra tricks to adjust your generation, use by adding them onto your run command above.
--n_iter ## Amount of samples generated. Default is 1. Raise to generate batches of a prompt.
--n_samples # Number is equal to how many results are generated simultaneously. Default is 2.
"n_samples 1" reduces ram use immensely. If you're having ram troubles, this will probably fix it.
--H ### --W ### Change height and width of result. Self-explanatory.
--seed ## Change generation seed, leading to more dynamic results. Default seed is 45.
--ddim_steps ### Steps for image processing, higher = more detail. Diminishing returns past 250. Default is 50.
--skip_grid Turns off the collage output, leaving only individual samples.
--skip_save Turns off individual output, leaving only a collage (Mildly faster)
--NOTES--
Adjust --strength accordingly. Higher = more guided toward prompt
Anywhere between 0.25 and 1 is the sweet spot for prompts
If your output is a jumbled rainbow mess your input image resolution is TOO LOW
feeding outputs back in using the same prompt with a weak strength multiple times can produce great results