Closed JoyBell2 closed 1 year ago
I posted the same issue on Reddit with more examples and comments. https://www.reddit.com/r/StableDiffusion/comments/15apxys/hires_fix_causes_clones_at_all_settings_please/
There is a couple of face in painting extensions that should fit the ideal. webui hires fix = run a text2img -> switch and do img2img midway.
There is no smart targeting system in stable diffusion architecture.
Doesn't explain to me why the text2img does the correct thing but img2img can't. For me, this breaks all prompts with more than one character.
Technically speaking it is not a bug. As there is nothing in higres fix that control multiple concept. After the upscale it try to paint something that look alike on top. Most of the time the woman likeness is taking over.
Some people fix this issue by using really low denoising like 0.15. With upscaller like R-ESRGAN 4X or LDSR the result can be ok butt it is not that great. It is missing details and quite blurry.
It is possible to make a prompt in a way to give more priority the the concept that disappear. By example like this.
photograph of (Ryan Reynolds) dancing with Anne Hathaway at a Brazilian night club, well dressed up for a night out, by Vogue
It will work sometime but it is still really likely to fail. You can also go in setting user interface then check "Hires fix: show hires prompt and negative prompt " . This way you can add a custom prompt for the hires fix. This really increase the chance of success.
Alternative option... This is an hires fix example made with Restart sampler currently in the Pull Request #11850. This sampler is particularly good at keeping concept separation. It only made Ryan slightly feminine and Anne slightly masculine. (note: I also used earlier prompt suggestion)
Still to guarantee proper upscaling of multiple concept it is usually required to use img2img and controlnet. Tile and canny are good controlnet model to do that. The option I found that give really good result is Tilled Diffusion extension with noise inversion combined with controlnet canny an tile all at once. This solution is a bit complicated to setup for the first time. But once you nail down the setting the result are worth it.
This example is made with Tilled Diffusion, 20 step noise inversion and controlnet canny+tile at 0.6 control Weight. It look really similar to the base image I used.
Here the base image before the hires fix/upscale.
There is somebody who asked for hires fix that can use base generation as input for controlnet instead of a picture... So far nobody implemented this. So we still need to go to image to image or at least generate a base image first then put it back in control net and re-generate with hires.
As others have stated the issue is that concepts leak as you get further away from the base resolution the model was trained at. Adding to what @leucome said I've been having great fun using regional prompter to keep things separated. It works really great in attention mode although lora/hypernetwork suffers because they are applied to the whole image. https://github.com/hako-mikan/sd-webui-regional-prompter
Is there an existing issue for this?
What happened?
Hires fix causes clones at all possible settings and options, if a prompt has two or more characters they will all end up cloned after hires.fix is applyed. Grid of all options Image with no Hires.fix
Second example photograph of Anne Hathaway dancing with Ryan Reynolds at a Brazilian night club, well dressed up for a night out, by Vogue Magazine epiCRealism
Negative prompt: epiCNegative, nude
Steps: 50, Sampler: DPM++ SDE Karras, CFG scale: 7, Seed: 4104266214, Size: 960x640, Model hash: 980cb713af, Model: reliberate_v10, TI hashes: "epiCRealism: 3719288307e4", Version: v1.5.0
Simple Beautiful. Well done. Hires fix... two Anne Hathaways!
This happens with any prompt and all tried settings and even None and 0.0 Denoise. If there are two or more people we all get morphed together or the one named person.
Steps to reproduce the problem
What should have happened?
We darn well should have Anne Hathaway dancing with Ryan Renolds. Enough said.
Version or Commit where the problem happens
version: v1.5.0
What Python version are you running on ?
Python 3.10.x
What platforms do you use to access the UI ?
Windows
What device are you running WebUI on?
Nvidia GPUs (RTX 20 above)
Cross attention optimization
xformers
What browsers do you use to access the UI ?
Microsoft Edge
Command Line Arguments
List of extensions
Extension | URL | Branch | Version | Date | Update -- | -- | -- | -- | -- | -- ABG_extension | https://github.com/KutsuyaYuki/ABG_extension | main | eb3ff761 | Mon May 1 21:25:47 2023 | unknown Stable-Diffusion-Webui-Civitai-Helper | https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper.git | main | 920ca326 | Tue May 23 11:53:22 2023 | unknown a1111-sd-webui-lycoris | https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris | main | 8e97bf54 | Sun Jul 9 07:44:58 2023 | unknown ddetailer | https://github.com/dustysys/ddetailer | master | 22a17414 | Mon Nov 28 09:33:31 2022 | unknown loopback_scaler | https://github.com/Elldreth/loopback_scaler.git | main | 184a53e6 | Fri Jun 23 21:42:22 2023 | unknown multi-subject-render | https://github.com/Extraltodeus/multi-subject-render.git | main | 03427e26 | Mon Mar 6 14:11:30 2023 | unknown multidiffusion-upscaler-for-automatic1111 | https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git | main | f9f8073e | Sat Jul 22 06:53:11 2023 | unknown sd-model-organizer | https://github.com/alexandersokol/sd-model-organizer.git | main | d6a2e6af | Mon Jul 24 22:18:01 2023 | unknown sd-model-preview-xd | https://github.com/CurtisDS/sd-model-preview-xd | main | 59bcf88f | Sat Jul 22 12:30:04 2023 | unknown sd-webui-llul | https://github.com/hnmr293/sd-webui-llul.git | master | aa47b3ee | Thu May 4 16:14:34 2023 | unknown sd-webui-stablesr | https://github.com/pkuliyi2015/sd-webui-stablesr.git | master | 4499d796 | Sat Jul 1 16:38:32 2023 | unknown stable-diffusion-webui-anti-burn | https://github.com/klimaleksus/stable-diffusion-webui-anti-burn.git | master | 4d678f1f | Sun Feb 19 19:22:44 2023 | unknown stable-diffusion-webui-eyemask | https://github.com/ilian6806/stable-diffusion-webui-eyemask.git | master | 7b803a43 | Fri Jun 2 11:15:19 2023 | unknown stable-diffusion-webui-two-shot | https://github.com/opparco/stable-diffusion-webui-two-shot | main | 9936c52e | Sun Feb 19 08:40:41 2023 | unknown ultimate-upscale-for-automatic1111 | https://github.com/Coyote-A/ultimate-upscale-for-automatic1111 | master | c99f382b | Tue Jun 13 04:29:35 2023 | unknown LDSR | built-in | None | | Wed Jul 26 23:59:05 2023 | Lora | built-in | None | | Wed Jul 26 23:59:05 2023 | ScuNET | built-in | None | | Wed Jul 26 23:59:05 2023 | SwinIR | built-in | None | | Wed Jul 26 23:59:05 2023 | canvas-zoom-and-pan | built-in | None | | Wed Jul 26 23:59:05 2023 | extra-options-section | built-in | None | | Wed Jul 26 23:59:05 2023 | mobile | built-in | None | | Wed Jul 26 23:59:05 2023 | prompt-bracket-checker | built-in | None | | Wed Jul 26 23:59:05 2023 | Extension URL Branch Version Date Update ABG_extension https://github.com/KutsuyaYuki/ABG_extension main [eb3ff761](https://github.com/KutsuyaYuki/ABG_extension/commit/eb3ff7610abeca1e4941a398b85aff223e32fba3) Mon May 1 21:25:47 2023 unknown Stable-Diffusion-Webui-Civitai-Helper https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper.git main [920ca326](https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper/commit/920ca3267f789a72e3225c99f069bf0be0db795d) Tue May 23 11:53:22 2023 unknown a1111-sd-webui-lycoris https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris main [8e97bf54](https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris/commit/8e97bf54867c25d00fc480be1ab4dae5399b35ef) Sun Jul 9 07:44:58 2023 unknown ddetailer https://github.com/dustysys/ddetailer master [22a17414](https://github.com/dustysys/ddetailer/commit/22a17414bbca1fa4681d427b8aae5f970d17e896) Mon Nov 28 09:33:31 2022 unknown loopback_scaler https://github.com/Elldreth/loopback_scaler.git main [184a53e6](https://github.com/Elldreth/loopback_scaler/commit/184a53e6d22579c578c6ee1bf55d821479213c49) Fri Jun 23 21:42:22 2023 unknown multi-subject-render https://github.com/Extraltodeus/multi-subject-render.git main [03427e26](https://github.com/Extraltodeus/multi-subject-render/commit/03427e26bebdc6da0ccfb749bf3c4e7e33d7458b) Mon Mar 6 14:11:30 2023 unknown multidiffusion-upscaler-for-automatic1111 https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git main [f9f8073e](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/commit/f9f8073e64f4e682838f255215039ba7884553bf) Sat Jul 22 06:53:11 2023 unknown sd-model-organizer https://github.com/alexandersokol/sd-model-organizer.git main [d6a2e6af](https://github.com/alexandersokol/sd-model-organizer/commit/d6a2e6af54d049db6741b0990c999ebca1b98f31) Mon Jul 24 22:18:01 2023 unknown sd-model-preview-xd https://github.com/CurtisDS/sd-model-preview-xd main [59bcf88f](https://github.com/CurtisDS/sd-model-preview-xd/commit/59bcf88f4763dc1864463e6ac80859e549c089ce) Sat Jul 22 12:30:04 2023 unknown sd-webui-llul https://github.com/hnmr293/sd-webui-llul.git master [aa47b3ee](https://github.com/hnmr293/sd-webui-llul/commit/aa47b3eeb45c53f0d6ccaae59abf36e8ed6731f5) Thu May 4 16:14:34 2023 unknown sd-webui-stablesr https://github.com/pkuliyi2015/sd-webui-stablesr.git master [4499d796](https://github.com/pkuliyi2015/sd-webui-stablesr/commit/4499d79649e54ca27b196e8e55a65d2a64a1b75c) Sat Jul 1 16:38:32 2023 unknown stable-diffusion-webui-anti-burn https://github.com/klimaleksus/stable-diffusion-webui-anti-burn.git master [4d678f1f](https://github.com/klimaleksus/stable-diffusion-webui-anti-burn/commit/4d678f1f1120415fe4cb9f77484252bc82af03b2) Sun Feb 19 19:22:44 2023 unknown stable-diffusion-webui-eyemask https://github.com/ilian6806/stable-diffusion-webui-eyemask.git master [7b803a43](https://github.com/ilian6806/stable-diffusion-webui-eyemask/commit/7b803a438f02b381903916b65cc5b15c98e3231c) Fri Jun 2 11:15:19 2023 unknown stable-diffusion-webui-two-shot https://github.com/opparco/stable-diffusion-webui-two-shot main [9936c52e](https://github.com/opparco/stable-diffusion-webui-two-shot/commit/9936c52eba04da7f0c009051ab03a60e72d4f7e6) Sun Feb 19 08:40:41 2023 unknown ultimate-upscale-for-automatic1111 https://github.com/Coyote-A/ultimate-upscale-for-automatic1111 master [c99f382b](https://github.com/Coyote-A/ultimate-upscale-for-automatic1111/commit/c99f382b31509b87b4d512e70e9caf08ae7a079f) Tue Jun 13 04:29:35 2023 unknown LDSR [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 Lora [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 ScuNET [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 SwinIR [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 canvas-zoom-and-pan [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 extra-options-section [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 mobile [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 prompt-bracket-checker [built-in](http://127.0.0.1:7860/) None Wed Jul 26 23:59:05 2023 ### Console logs ```Shell C:\Stable Diffusion 3\stable-diffusion-webui>git pull Already up to date. venv "C:\Stable Diffusion 3\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.5.0 Commit hash: a3ddf464a2ed24c999f67ddfef7969f8291567be Installing dlib Couldn't install dlib. Command: "C:\Stable Diffusion 3\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install dlib==19.24.0 Error code: 1 stdout: Collecting dlib==19.24.0 Using cached dlib-19.24.0.tar.gz (3.2 MB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Building wheels for collected packages: dlib Building wheel for dlib (setup.py): started Building wheel for dlib (setup.py): finished with status 'error' Running setup.py clean for dlib Failed to build dlib stderr: WARNING: Ignoring invalid distribution -rotobuf (c:\stable diffusion 3\stable-diffusion-webui\venv\lib\site-packages) error: subprocess-exited-with-error python setup.py bdist_wheel did not run successfully. exit code: 1 [7 lines of output] running bdist_wheel running build running build_py running build_ext ERROR: CMake must be installed to build dlib [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for dlib ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects [notice] A new release of pip is available: 23.1.2 -> 23.2.1 [notice] To update, run: C:\Stable Diffusion 3\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip ---------------------------------------------- Failed building wheel for dlib ERROR: CMake must be installed to build dlib Install cmake from https://cmake.org/download/ ---------------------------------------------- Launching Web UI with arguments: --xformers --opt-split-attention --medvram Civitai Helper: Get Custom Model Folder Civitai Helper: Load setting from: C:\Stable Diffusion 3\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json Civitai Helper: No setting file, use default Installing openmim Installing mmcv-full *** Error loading script: ddetailer.py Traceback (most recent call last): File "C:\Stable Diffusion 3\stable-diffusion-webui\modules\scripts.py", line 295, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "C:\Stable Diffusion 3\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "