stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: In Img2Img the loopback function crashed after 1 result (when asking for 4)

Open skydam opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

I put a picture in the input box, interrogated picture, changed the artist, lowered denoising to 0.4 and set loopback to 4 steps. After first result I got this:

Error completing request█████████████▎ | 40/160 [00:04<00:13, 8.62it/s] Arguments: (0, 'a painting of a man with a beard and a black and white outfit with a white ruffle on his collar, by adrian tomine', '', 'None', 'None', <PIL.Image.Image image mode=RGB size=1280x1766 at 0x181AB2049A0>, None, None, None, 0, 100, 1, 4, 1, False, False, 1, 1, 7, 0.39, -1.0, -1.0, 0, 0, 0, False, 704, 512, 0, False, 32, 0, '', '', 3, 0.9, 5, '0.0001', False, 'None', '', 0.1, False, '\n

Combinations

\n Choose a number of terms from a list, in this case we choose two artists\n {2$$artist1|artist2|artist3}\n If $$ is not provided, then 1$$ is assumed.\n
\n A range can be provided:\n {1-3$$artist1|artist2|artist3}\n In this case, a random number of artists between 1 and 3 is chosen.\n

\n\n

Wildcards

\n

Available wildcards

\n
    \n
  • 17thcenturydutchpainters
  • 19thcenturypainters
  • adjective
  • artist
  • designers
  • flemishpainters
  • genre
  • juice
  • location
  • renaissancepainters
  • site
  • style
  • subject
\n
\n WILDCARD_DIR: scripts/wildcards
\n You can add more wildcards by creating a text file with one term per line and name is mywildcards.txt. Place it in scripts/wildcards. mywildcards will then become available.\n ', '
    \n
  • CFG Scale should be 2 or lower.
  • \n
\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, '

Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8

', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, None, '', '

Will upscale the image to twice the dimensions; use width and height sliders to set tile size

', 64, 0, 1, '', 0, '', True, True, False) {} Traceback (most recent call last): File "D:\Super Stable Diffusion\stable-diffusion-webui\modules\ui.py", line 185, in f res = list(func(*args, **kwargs)) File "D:\Super Stable Diffusion\stable-diffusion-webui\webui.py", line 54, in f res = func(*args, **kwargs) File "D:\Super Stable Diffusion\stable-diffusion-webui\modules\img2img.py", line 136, in img2img processed = modules.scripts.scripts_img2img.run(p, *args) File "D:\Super Stable Diffusion\stable-diffusion-webui\modules\scripts.py", line 282, in run processed = script.run(p, *script_args) File "D:\Super Stable Diffusion\stable-diffusion-webui\scripts\loopback.py", line 62, in run processed = processing.process_images(p) File "D:\Super Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 427, in process_images res = process_images_inner(p) File "D:\Super Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 487, in process_images_inner with torch.no_grad(), p.sd_model.ema_scope(): AttributeError: 'NoneType' object has no attribute 'ema_scope'

Steps to reproduce the problem

See above for steps. Tried other pictures as well. same issue.

What should have happened?

It should have performed 4 loopback steps.

Commit where the problem happens

Commit hash: 198a1ffcfc963a3d74674fad560e87dbebf7949f

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No response

Additional information, context and logs

No response

skydam avatar Nov 01 '22 22:11 skydam

I'm having a similar problem with the seed travel script. The problem seems to be that in modules/processing.py, the method process_images_inner sets p.sd_model to None at the end; this is breaking loops that expect the sd_model to persist. Why is it setting the model to None? Does it have to do this?

Edit: found this was due to commit af758e9. Recommend removing the two lines setting model to None.

bch77 avatar Nov 01 '22 23:11 bch77

Same issue in img2img when using poor mans outpainting script

Vitalidev12 avatar Nov 01 '22 23:11 Vitalidev12

Help :'(

JackCloudman avatar Nov 02 '22 00:11 JackCloudman

#4104

rabidcopy avatar Nov 02 '22 00:11 rabidcopy

I made a mistake in a previous PR, I just sent a new PR #4142 to solve it, sorry for the trouble.

jn-jairo avatar Nov 02 '22 01:11 jn-jairo