zero01101 / openOutpaint-webUI-extension

direct A1111 webUI extension for openOutpaint
MIT License
397 stars 22 forks source link

[Bug] Outpaint black image #3

Closed Rogal80 closed 1 year ago

Rogal80 commented 1 year ago

Hi, maybe I am doing something wrong – but no matter how many times I use the dream for outpaint i have always black image

image

any clue? ( inpainting mask is set on 1)

zero01101 commented 1 year ago

hm, not familiar with that model you're using, is it an inpainting model? or maybe is it based off of a v2 model? i believe people have ran into that kind of thing with SD/webUI directly with v2 models - might be worth disabling --no-half in your webui-user script, or maybe installing DH patches extension to see if it still occurs.

does that occur if you use the runwayML inpainting model?

Rogal80 commented 1 year ago

This is inpainting model merged with others, but also I tried with base 1.5 inpaint model – same results

Rogal80 commented 1 year ago

I already removed Outpaint from extension and reinstall but nothing happen – same issue, and after reinstall setting wasn't default

zero01101 commented 1 year ago

have you tried any of these commandline flags? particularly --medvram/--lowvram and --no-half

https://www.reddit.com/r/StableDiffusion/comments/zhni48/just_installed_sd_but_it_keeps_giving_me_a_black/izn31no/

https://www.reddit.com/r/StableDiffusion/comments/zfa43l/black_image_when_using_sd_21_when_using/izb828d/?context=1

Rogal80 commented 1 year ago

i have 3090 and i am using this set COMMANDLINE_ARGS=--xformers --allow-code --api --listen --enable-insecure-extension-access --gradio-img2img-tool editor

zero01101 commented 1 year ago

huh... well you've definitely got the hardware for it; i've never ran into this and you're the first to report such things happening, but i'm still pretty certain it's more of an SD/webUI thing than openOutpaint just because we don't actually do any image generation or processing, just send API calls to webUI and then manipulate the results it delivers...

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5757#issuecomment-1356054255 mentions that it could be an issue with the VAE but also specifies high resolutions, and you're using 512x512... might be worth trying anyway? sorry i don't have a "oh yeah simple fix, just do x y z" for you :/

Rogal80 commented 1 year ago

anyway thx - inpainting works perfectly :)

Rogal80 commented 1 year ago

How can I reinstall? That will be like fresh extension because removing folder and reinstall still keeps old settings

zero01101 commented 1 year ago

openOutpaint saves a few settings to your browser's localstorage (and indexedDB if you've imported or created any stamp resources) - if you open the "debug settings" menu there's a "reset to defaults" button that clears the localstorage (and indexedDB if there are any) records, and after that removing the openOutpaint-webUI-extension folder should be pretty much it. nothing gets added to your python venv or anything of that nature

Rogal80 commented 1 year ago

thx

seijihariki commented 1 year ago

@Rogal80 is it working now?

Rogal80 commented 1 year ago

Hi, still same : image

seijihariki commented 1 year ago

I have sent some debugging tools to the main branch. Update the extension, enable debug in Debug Info tab, and try again.

Send us the resulting debugging image for the outpaint attempt.

Lesteriax commented 1 year ago

I'm having the same issue, I thought I was doing something wrong with the openOutpaint settings.

Using img2img always gives me black results when trying to outpaint using vanilla inpaint1.5

I'm using paperpsace version, tried with and without --no-half and medvram.

below screenshot and i also attached the debug image

image

openOutpaint_debug_Mon Dec 26 2022 13_42_59

seijihariki commented 1 year ago

Oh, outpainting almost always requires a 1 for denoising, as less than that will keep quite a lot of black pixels on the non-image part of the image. (Transparent pixels are sent as black to stable diffusion, as it can't really handle transparency)

Worse still, keep border gradient keeps the full black outline on the transparent areas, so stable diffusion sees the image with literally half of it black and extrapolates that it is indeed half-black.

For outpainting, it is recommended to use the dream tool instead of the img2img one. It always uses 1 as denoising strength, and automatically masks things to keep current imagery as is, and generates on transparent pixels.

Rogal80 commented 1 year ago

hi, debug output : openOutpaint_debug_Mon Dec 26 2022 12 24 08 GMT+0100 (Central European Standard Time)

seijihariki commented 1 year ago

That's... Very weird. Top should be image sent, bottom should be mask, as shown in Lesteriax's.

If they are both showing the original image, makes sense that the black area is continuing to be black...

@zero01101 maybe is some globalComposite weirdness?

seijihariki commented 1 year ago

@Rogal80 what browser are you using?

Rogal80 commented 1 year ago

Firefox, windows 10

Rogal80 commented 1 year ago

I notice that in chrome it's working, is there any chance to fix this in Firefox : image openOutpaint_debug_Mon Dec 26 2022 13_42_34 GMT+0100 (Central European Standard Time)

Lesteriax commented 1 year ago

Dreaming can do outpaintng as opposed to img2img.

problem with with dream is that outpainting produces weird results. I tried the monalisa and prompted for a painting with a beautiful woman and it gave me 3 headed monalisa.

zero01101 commented 1 year ago

@zero01101 maybe is some globalComposite weirdness?

¯\_(ツ)_/¯ yeah, that is just bonkers; i'm still entirely unable to reproduce this myself

problem with with dream is that outpainting produces weird results. I tried the monalisa and prompted for a painting with a beautiful woman and it gave me 3 headed monalisa.

@Lesteriax were you using the auto HRfix option when using that? that sounds more like the common SD issue with generating images that aren't exactly the dimensions of the training data more than anything else...

seijihariki commented 1 year ago

Hi, @Rogal80. Sorry for the late response. Can you send us a screenshot of the result of running the following W3Schools example on your firefox browser:

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_canvas_globalcompop_all

This is the expected result: image

rivermonster commented 1 year ago

Switching to Chrome solved the same issue for me that I was getting in Firefox.

zero01101 commented 1 year ago

i almost exclusively use firefox and honestly can't get this to happen for the life of me; even gone as far as manually installing the NSFW check extension to see if maybe that was inadvertently getting triggered or something but no luck...

@Rogal80 and @rivermonster, are either of you using any firefox addons? it seems that the microsoft editor extension for chrome gets into fights with the overmask slider which is genuinely an incompatibility i can say i could never have predicted... also, along with the canvas GCO test @seijihariki mentioned, could i possibly ask if you'd mind trying (preferably both) the webUI extension, and/or just standalone openOutpaint in a firefox troubleshooting state and seeing if that makes a difference?

rivermonster commented 1 year ago

UPDATE: Further testing got it to repeat the error with DuckDuckGo Privacy alone and make the error go away by disabling it (without restarting the whole automatic interface with a shutdown and restart). So it very likely may be just the DuckDuckGo Privacy

Got it!

Figured it out, it's a two variable problem so it was annoying to isolate it. The issue TRIGGERED for me is experienced ONLY when BOTH of the follow are TRUE:

  1. The extension DuckDuckGo Privacy Essentials is active
  2. The theme is set to Dark space - The Best Dynamic Theme Once this is the case then only by turning off both and reloading the webui can I get things working properly again.

Hope this helps replicate and narrow it down!

edit:

Until the theme was turned on it even worked with DuckDuckGo Privacy. There's some weird interaction between the dynamic theme and that extension (I'm guessing, but haven't proven conclusively).

zero01101 commented 1 year ago

FASCINATING

will see if i can confirm

zero01101 commented 1 year ago

image

added duckduckgo privacy addon, left default settings, simply tried to outpaint and... yep, busted

thank you greatly for your findings

zero01101 commented 1 year ago

confirmed on openOutpaint standalone as well, and obnoxiously the GCO test showed nothing out of the ordinary at all image

zero01101 commented 1 year ago

it says that "privacy protections aren't available for special pages or local pages" in the option menu, but if i manually add localhost to the unprotected sites list, outpainting works again - @rivermonster could you try that? may need to add 127.0.0.1 (or whatever host your A1111 webUI is served from) instead, depending on how you access it image

rivermonster commented 1 year ago

@zero01101 Can confirm that adding 127.0.0.1 to the unprotected sites list fixed the issue and allowed the extension to remain enabled.

Also, thanks so much for this extension. You guys really are my heroes!

zero01101 commented 1 year ago

aww :3 just glad to figure it out lol, was driving me absolutely batty :D

added mentions to the readmes, will update docs eventually

zero01101 commented 1 year ago

@Rogal80 any chance you could test this out, assuming you're using the duckduckgo extension as well?

Rogal80 commented 1 year ago

Hi, sorry for late response, image I am also using Firefox extension: — language tool — dark reader, but it's off on webui — easy YouTube video downloader — DuckDuckGo — Search by Image

Rogal80 commented 1 year ago

Ok, found it, it's dark reader causing issue – disabling it for whole Firefox it's fixing outpaint

seijihariki commented 1 year ago

Okay, thank you for your report! Added some instructions on the README for debugging extension issues the next time something is very weird, like in this issue.

seijihariki commented 1 year ago

Will be closing this issue now.

fhnb16 commented 1 year ago

Get this issue in Edge (chromium) and Firefox without any extentions, img2img produce blank black image(

zero01101 commented 1 year ago

@fhnb16 the img2img tool will result in black pixels when used over empty/transparent space unlike the dream tool, is that what you're referencing?