Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

images came out segmented with squares/rectengles #111

Open
trxsudo opened this issue Jul 1, 2023 · 27 comments
Open

images came out segmented with squares/rectengles #111

trxsudo opened this issue Jul 1, 2023 · 27 comments

Comments

@trxsudo
Copy link

trxsudo commented Jul 1, 2023

some of the images came out like its been segmented. its like the whole picture is divided into equal squares/tiles. what did I do wrong? Have I been setting the denoising strength for too much? ( i set mine to 0.4 denoise)

@eunnone
Copy link

eunnone commented Jul 3, 2023

It appears that the tiles are not being merged properly in the recent webUI update 1.4. There is an extra gap between the tiles. Here's an example comparing them. I reverted back to version 1.3.2 (Jun 24), and it's working fine now. Hope its fixed in webui or here.
mermaid1

@maxinzheng
Copy link

me too, how to reverted back to version 1.3.2, help me please.

@dmzkrsk
Copy link

dmzkrsk commented Jul 19, 2023

Using git besect, it looks like this commit broke it AUTOMATIC1111/stable-diffusion-webui@1503af6

I don't know internals much, so I'm unsure how it broke upscale

@Splendide-Imaginarius
Copy link

Hi there, I'm the author of AUTOMATIC1111/stable-diffusion-webui#10295, which it sounds like might have inadvertently caused this. I've never used the Ultimate Upscale extension (it looks really cool though -- I'll probably use it now that I know it exists), so I'm not quite sure how to reproduce this on my end. Any chance you could provide an input image and settings for me to reproduce this on my end? Alternatively, if you're willing to try fiddling with the code based on instructions I can provide, maybe your test results can help me figure out what might be wrong.

@cian0
Copy link

cian0 commented Jul 26, 2023

Hi there, I'm the author of AUTOMATIC1111/stable-diffusion-webui#10295, which it sounds like might have inadvertently caused this. I've never used the Ultimate Upscale extension (it looks really cool though -- I'll probably use it now that I know it exists), so I'm not quite sure how to reproduce this on my end. Any chance you could provide an input image and settings for me to reproduce this on my end? Alternatively, if you're willing to try fiddling with the code based on instructions I can provide, maybe your test results can help me figure out what might be wrong.

I can't use SD upscale anymore
Input image:
vlcsnap-2023-05-04-20h57m10s040_2

Output:

image

Basic settings (just changed scale to 4 instead of 2)

image

@Splendide-Imaginarius
Copy link

I can't use SD upscale anymore Input image:

@cian0 Can you provide the Git commit hashes of the WebUI that you tried, which worked and didn't work?

@eunnone
Copy link

eunnone commented Jul 26, 2023

@Splendide-Imaginarius
My issue seems to be using ControlNet tile along with Ultimate SD Upscale, which was my preferred workflow for upscaling images.

741bd71873ebb16f61d36e4c8c0e64214501a638 works
f9606b8826cb3e0467312c317c4a7b504e2bb6a2 has issues

Img2img No prompts. Model: revAnimated_v122
Sampler 0.6 Denoising Controlnet Tile Selcted, Ultimate SD Upscale with SwinIR Upscaler

Original Image
Isssue1

741bd7 -Upscaled 2x
00003-3245978491

f9606b8 - Upscaled 2x
00007-3245978491 0

There seems to be issues at edges of tiles where they merge.

@Splendide-Imaginarius
Copy link

Thanks @eunnone, I'll try with those settings and see if I can reproduce it here. It may take me a few days.

@Splendide-Imaginarius
Copy link

I can reproduce the issue now; it does indeed appear that 1503af60b0550d1a57c95a500df1fe1390178a27 broke it. I'm not yet sure why that commit broke it; I will investigate further over the next few days. Thanks again to @eunnone for helping me reproduce it.

@Jopezzia
Copy link
Collaborator

Jopezzia commented Aug 1, 2023

I can reproduce the issue now; it does indeed appear that 1503af60b0550d1a57c95a500df1fe1390178a27 broke it. I'm not yet sure why that commit broke it; I will investigate further over the next few days. Thanks again to @eunnone for helping me reproduce it.

No, it's not this commit. Somewhere else is a problem. Tried reverting it but the problem didn't go away

@Splendide-Imaginarius
Copy link

I can reproduce the issue now; it does indeed appear that 1503af60b0550d1a57c95a500df1fe1390178a27 broke it. I'm not yet sure why that commit broke it; I will investigate further over the next few days. Thanks again to @eunnone for helping me reproduce it.

I have a candidate fix. It definitely fixes the broken behavior that @eunnone described, but I need a few more days to make sure it doesn't break outpainting (which was what 1503af60b0550d1a57c95a500df1fe1390178a27 was originally intended to fix).

No, it's not this commit. Somewhere else is a problem. Tried reverting it but the problem didn't go away

@Jopezzia it wouldn't surprise me if there are multiple bugs somewhere, and 1503af60b0550d1a57c95a500df1fe1390178a27 only caused one of them. After some investigation, I definitely see what's going wrong in 1503af60b0550d1a57c95a500df1fe1390178a27, it's a legit bug. (Also it's subtle enough that I definitely see why it evaded my notice when I wrote that commit, and why it didn't get caught in upstream PR review.)

@trxsudo
Copy link
Author

trxsudo commented Aug 2, 2023

IMG_4858
as I was trying to upscale from the top image to bottom one, there is a clear visable line of dark and light separation on the forehead of the face. its as if only a portion of the face is upscaled. I dont know it has something to do with after detailer or just ultimate upscaler. it completely messed up my upscaling process. im using the lastest version of ultimate upscaler and afterdetailer, and webui is 1.5.1

Splendide-Imaginarius added a commit to Splendide-Imaginarius/stable-diffusion-webui that referenced this issue Aug 3, 2023
Fixes breakage when mask_blur is set after construction.

See Coyote-A/ultimate-upscale-for-automatic1111#111 (comment)

Thanks to Алексей Трофимов and eunnone for reporting the issue.
@Splendide-Imaginarius
Copy link

@eunnone Could you please try this branch and let me know how it goes?

https://github.com/Splendide-Imaginarius/stable-diffusion-webui/tree/mask-blur-property

@Jopezzia
Copy link
Collaborator

Jopezzia commented Aug 3, 2023

@Splendide-Imaginarius tried your branch now. Everything works)
Original image:
изображение
Master branch:
изображение
Your branch:
изображение

@eunnone
Copy link

eunnone commented Aug 3, 2023

@Splendide-Imaginarius
The pictures don't look broken anymore after the fix. However, there still seems to be a problem with some missing(?) pixels/gap in the merged area, I think. Here's a video showing a small difference between version 1.3.2 and the Fixed version.

2023-08-03_12-25-08.mp4

1.3.2 upscale is closer to the original image compared to the fixed version.
All images and prompts used: https://imgur.com/a/HFD5dNK
Anyway The images are usable now. Thank you for your work!

@Splendide-Imaginarius
Copy link

Good to hear that we're moving in the right direction. Thanks @eunnone for pointing out the remaining breakage; it tentatively looks like I can reproduce that issue here. I'll see if I can diagnose the cause; may take a few more days.

@Splendide-Imaginarius
Copy link

I have a lead on what's causing the remaining breakage; hoping to have a candidate fix ready in a few days.

Splendide-Imaginarius added a commit to Splendide-Imaginarius/stable-diffusion-webui that referenced this issue Aug 5, 2023
This more closely matches the old behavior of PIL's Gaussian blur, and
fixes breakage when tiling.

See Coyote-A/ultimate-upscale-for-automatic1111#111 (comment)

Thanks to Алексей Трофимов and eunnone for reporting the issue.
@Splendide-Imaginarius
Copy link

@eunnone
Copy link

eunnone commented Aug 5, 2023

@Splendide-Imaginarius Tested with multiple images. Works flawlessly now. The upscales are identical to the ones in 1.3.2. Thank you for the fix ! :)

@Splendide-Imaginarius
Copy link

@eunnone Great, thanks for testing! I'll submit the fix upstream in the next few days.

@Splendide-Imaginarius
Copy link

@eunnone Could you confirm whether the upstream dev branch is working properly now? (My branch was merged a few hours ago.)

@eunnone
Copy link

eunnone commented Aug 11, 2023

@Splendide-Imaginarius Upscales look a bit worse on dev branch. There seems to be some smoothing/blurring.
Screenshot 2023-08-12 004325
Screenshot 2023-08-12 002149

I got this controlnet error(?), might not be related

Version: v1.5.1-377-gae6b3090
Commit hash: ae6b30907db2060962c533de79ab4bd2c6b12297
Installing requirements
Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Civitai Helper: Get Custom Model Folder
Civitai Helper: Load setting from: C:\SD_Auto\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json
Civitai Helper: No setting file, use default
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
[-] ADetailer initialized. version: 23.7.11, num models: 9
2023-08-12 00:29:42,366 - ControlNet - INFO - ControlNet v1.1.237
ControlNet preprocessor location: C:\SD_Auto\extensions\sd-webui-controlnet\annotator\downloads
2023-08-12 00:29:42,498 - ControlNet - INFO - ControlNet v1.1.237
Loading weights [f8bb2922e1] from C:\SD_Auto\models\Stable-diffusion\revAnimated_v122.safetensors
C:\SD_Auto\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py:167: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  with gr.Row(elem_classes=["cnet-image-row"]).style(equal_height=True):
C:\SD_Auto\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py:181: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  self.generated_image = gr.Image(
Creating model from config: C:\SD_Auto\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

@Splendide-Imaginarius
Copy link

@eunnone Hmm, interesting. My mask-blur-property+kernel branch is based on dev from July 27, so maybe something else got broken in upstream dev between then and now? Not a lot of time went by since then, so hopefully that's easy to figure out via bisecting. Probably not related to anything I did though. :/

@eunnone
Copy link

eunnone commented Aug 12, 2023

It seems this commit causing the blur issue.

Test for blur https://imgur.com/a/P9TfAnK (images and prompts)

@catboxanon
Copy link

catboxanon commented Aug 14, 2023

Are you using PLMS, DDIM, or UniPC? If not that's especially concerning. If you can post the original images used and created with PNG info (from both versions if you can) as well as your sysinfo from the settings page I can try looking a bit more into it.

Edit: I see you posted your prompts in #111 (comment). Assuming that's up-to-date I'll see if I can work off that. Since it isn't using one of the aforementioned samplers something certainly seems to have gone wrong.

Edit 2: Can confirm using the commit before the CFG denoiser impl (AUTOMATIC1111/stable-diffusion-webui@2a72d76) + merged with https://github.com/Splendide-Imaginarius/stable-diffusion-webui/tree/mask-blur-property+kernel, it produces the correct, non-blurry result. Using the same setup but with the commit that breaks it (AUTOMATIC1111/stable-diffusion-webui@8285a14) produces the blurry result. I'll see what's causing this exactly now.


Edit 3: Figured it out. There should be a PR shortly.

@catboxanon
Copy link

@eunnone Should be fixed as of AUTOMATIC1111/stable-diffusion-webui@c1a31ec. I can confirm that fixes it on my end. The results are now sharp as they were before.

@eunnone
Copy link

eunnone commented Aug 14, 2023

@catboxanon Thank you for the fix. Can confirm upscales are working perfectly now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants