AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.07k stars 26.83k forks source link

[Feature Request]: Variable Noise Settings for Masked Regions #8308

Open mr-september opened 1 year ago

mr-september commented 1 year ago

Is there an existing issue for this?

What would your feature do ?

I am trying to upscale inpainted images with Ultimate Upscale. As per instructions, this is done with their script in img2img mode.

I find setting noise to 0.2-0.3 works great for "touching up" blemishes or weird artifacts, especially along the edges of previously inpainted areas.

However, that will also change the faces, if any, into other people.

If I set noise lower, e.g. to 0.1, the facial identity stays intact, but so do the other blemishes/artifacts.

Ideally, the webui would allow for either automatic face detection and/or manual masking of zones, where different settings could be applied. So in this case, setting noise to 0.1 for the faces, and 0.2-0.3 to the rest of the image.

Proposed workflow

  1. Go to img2img
  2. There is a masking option, maybe multiple masks in different colours.
  3. Each zone could have different settings, perhaps under tabs.
  4. The user can set different settings like before.
  5. Maybe a universal tab for mask 'blending'-related settings.

Additional information

No response

catboxanon commented 1 year ago

1.6.0 adds a new extra noise parameter as well as a callback. I made an example script that uses the callback and can be used to mask certain regions. It's only for txt2img and uses the setting's single noise value, but it could theoretically be expanded to do something like you suggest with img2img. https://gist.github.com/catboxanon/69ce64e0389fa803d26dc59bb444af53