stablediffusion icon indicating copy to clipboard operation
stablediffusion copied to clipboard

The img2img results are full of color noise

Open NEFUJoeyChen opened this issue 3 years ago • 5 comments

00000 The above figure is an example. After the step is set to 500, there is still no clear result.

NEFUJoeyChen avatar Nov 29 '22 07:11 NEFUJoeyChen

Was getting the same but I think the README example does not show the correct config to use? Here is an example that worked for me without noise. Download the 512-base-ema.ckpt from here

python scripts/img2img.py --prompt "A fantasy landscape, trending on artstation" --init-img ~/Pictures/example.png --ckpt 512-base-ema.ckpt --config configs/stable-diffusion/v2-inference.yaml

Or with the 768 ckpt: python scripts/img2img.py --prompt "A fantasy landscape, trending on artstation" --init-img ~/Pictures/example.png --ckpt 768-v-ema.ckpt --config configs/stable-diffusion/v2-inference-v.yaml

dogboydog avatar Nov 30 '22 21:11 dogboydog

try changing you sampler from PLMS to DPM and see if you get sane results. I worked for me. you can do that at the command line by adding "--dpm" to your txt2img line

b0bsl3d avatar Dec 07 '22 00:12 b0bsl3d

Sorry, I missed you saying img2img in title. yes, doesn't look like img2img allows you to specify another sampler. if you look in the code (scripts\img2img.py) you should see:

 device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model = model.to(device)

**sampler = DDIMSampler(model)**

I guess you could experiment with substituting another sampler invocation there - if you are getting the excessive noise from img2img, but I also wonder if its another problem. I have not seen oddities from img2img, only txt2img with PLMS sampler.

b0bsl3d avatar Dec 09 '22 17:12 b0bsl3d

try changing you sampler from PLMS to DPM and see if you get sane results. I worked for me. you can do that at the command line by adding "--dpm" to your txt2img line

Do you know why the PLMS sampler does not work in this case? I also found this same issue with the txt2img.py script. I get noise unless I use DPM or the default ones.

andresberejnoi avatar Dec 16 '22 16:12 andresberejnoi

Try adding the config flag --config configs/stable-diffusion/v2-inference.yaml. It made the output much better for me.

fahmidme avatar Feb 03 '23 11:02 fahmidme