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

The color shift needs to be fixed at the source

Open Mozoloa opened this issue 3 years ago • 2 comments

Describe the bug A well known bug, that many commits have been trying to compensate for, is causing the images to shift towards magenta and darker shadows when doing img2img, even one iteration makes it obvious. This makes any inpainting pretty hard as it ends up creating a magenta heatmap of the places you've inpainted the most for example.

To Reproduce

  1. Put and image in img2img
  2. Generate a variation with prompts
  3. Send the results back to the input and do it again
  4. Quickly you'll see the image becoming darker and more magenta

OR

  1. Do this but automatically with loopback

Expected behavior No color shift at all (at least not consistent like it is there) as apparently was the case on this commit and before: 823cf946ec61896915850d2b1096637ee42b775d

Apparently this also appeared suddenly on hlky ui around the same time this was implemented https://github.com/sd-webui/stable-diffusion-webui/pull/308

I haven't checked this commits but this comes from posts complaining about the bug and referring to the commit where it worked fine.

I've tried to create luts that compensate for this phenomenon and they work alright, but they're a workaround, a correction to a problem, not a solution, and it adds some inconvenience to the process

A color correction option was implemented but it's rather inaccurate as its a histogram match and tends to create banding or turn soft light to hard light on the long run, all of this even after all the fixes that were done to it, as with any consistent correction it's going to shift the image at some point if it's not absolutely perfect.

And that's the thing, tons of work has been put, by the devs (and myself on the side) trying to compensate for the problem after it happens instead of preventing it to begin with. It looks like everything was fine and suddenly some shift appeared, which means that's not something that can't be reverted. I'm willing to help in any way since this to me is such a major problem as I don't trust the current color correction band aid fix and my luts can be limited sometimes and force me to get out of the UI, so I'm stuck having my most iterated pieces be magenta and that's no bueno.

If there is any info on why this happens and why it wouldn't be possible to fix at the source (that we know of) I'm willing to hear it and try to make it possible with my little hands to the max of my abilities, but I would need someone to show me the way as the code now is pretty thick

Mozoloa avatar Oct 15 '22 20:10 Mozoloa

Has this ever been fixed? I thought the 840000 VAE fixed it, but I'm noticing it again in my img2img gens.

Jonseed avatar Dec 09 '23 01:12 Jonseed

The VAE did fix it, maybe the model you're using has the old one embedded

Mozoloa avatar Dec 21 '23 17:12 Mozoloa