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

[Bug]: Eta noise seed delta (ENSD) updated when reading in PNG chunk info when non-zero, but doesn't change back when zero (absent in PNG chunk info)

Open Jonseed opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

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

What happened?

If you upload a previously generated image, and send its generation parameters into the UI settings to regenerate it, the eta noise seed delta (ENSD) in settings is updated if it is non-zero, as it should. But then if you upload another image, and send it into the UI, and it has a zero ENSD (I think the value is just absent from the generation parameters), the ENSD is not changed back to zero. This results in an image change when regenerating images that can be hard to trace.

Steps to reproduce the problem

  1. Upload an image that used a non-zero ENSD into PNG Info.
  2. Press send to txt2img (ENSD is updated appropriately)
  3. Upload an image that used a zero ENSD (absent from PNG chunk) into PNG Info.
  4. Press send to txt2img (ENSD remains at previous non-zero value)
  5. Image is not regenerated, since the ENSD is non-zero.

What should have happened?

It seems that it should be default behavior that if ENSD is absent in PNG Chunk, that the ENSD should change to a zero value when sending in PNG chunk into the UI.

Commit where the problem happens

82cfc227d735c140447d5b8dca29a71ee9bde127

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

--xformers --autolaunch --gradio-img2img-tool color-sketch --api

Additional information, context and logs

The same behavior should probably happen for sending to img2img, etc.

Jonseed avatar Jan 05 '23 15:01 Jonseed

Yep, this one is annoying AF.

DarkAlchy avatar Jan 05 '23 22:01 DarkAlchy

Just found out about this the hard way. Thought I was going crazy when old generations didn't add up.

f-rank avatar Jan 20 '23 08:01 f-rank

I could be wrong, but I think this commit may have fixed this issue? 938578e8a94883aa3c0075cf47eea64f66119541

Jonseed avatar Feb 01 '23 20:02 Jonseed

That's not due to that commit. That commits makes it so that some parameters are just applied temporarily.

I've tried your steps to reproduce with latest commit 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 and I'm not able to reproduce the issue.

As you can see the override parameters display properly in the tab: image

If you select an image without ENSD, then it will have no entry for ENSD, and use your default setting for ENSD. image

I'm suspecting the default ENSD setting for your UI is causing this (maybe you have same non-zero value in default ENSD setting).

The code assumes that the default ENSD for an image is the same as the default ENSD for the currently running UI.

Maybe that's something @AUTOMATIC1111 might want to address or not depending if bug or feature.

To address the concern, maybe we could have create_override_settings_dict() to default ENSD to zero if not present ? Example, before it returns res at the end, add:

if not res.get('eta_noise_seed_delta', None):
    res['eta_noise_seed_delta'] = 0

But IMO, then you'd need to do it for all of those overridden parameters for consistency.

Z-nonymous avatar Feb 20 '23 14:02 Z-nonymous

Override system should have fixed this now. Closing.

catboxanon avatar Aug 07 '23 04:08 catboxanon