zero01101 / openOutpaint

local offline javascript and html canvas outpainting gizmo for stable diffusion webUI API 🐠
MIT License
499 stars 43 forks source link

[Bug]: left/top won't blend, bottom/right do? #208

Open jwvanderbeck opened 1 year ago

jwvanderbeck commented 1 year ago

What happened?

I'm 100% sure this is me doing something wrong, but I am trying to outpaint a portrait I have to give me more headroom for differing aspect ratios. I was able to beautifully extend below and to the right of my original work, but any attempts to outpaint to the left or top of the original image give an absolutely hard border and content that doesn't match up at all. It almost acts like it is drawing content for the right side then placing it on the left if that makes any sense. I'm attaching an example.

image

Steps to reproduce the problem

  1. outpaint to the left or above original stamped image

What should have happened?

No seam?

Commit where the problem happens

989a3fa0

What platforms do you use to access openOutpaint?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Browser Extensions/Addons

1password, uBlock origin, Video downloader pro

AUTOMATIC1111 webUI Commandline Arguments

--api --medvram

Additional information

No response

jwvanderbeck commented 1 year ago

Call me crazy but it acts to me like it is only looking at the top left corner of the cursor when looking for existing content to blend with. If the existing content in the cursor is not there, but instead over on the right, it just completely ignores it?

image

zero01101 commented 1 year ago

hey, sorry for the delay; yeah, uh outpainting anywhere is definitely an intended use case and there shouldn't be any restrictions on where you're doing so; just to confirm, you're using an inpainting model?

otherwise, if you expand the debug info region of the main menu and click the toggle debug button, it should download an image containing the image content and generated mask upon the next dream - if you'd upload that, it'd be appreciated

jwvanderbeck commented 1 year ago

It is possible I had somehow changed the model after doing the right side. Not sure how but anything is possible as I am learning this tool.

I will go back to this image and try messing with it again

jwvanderbeck commented 1 year ago

openOutpaint_debug_Mon Mar 06 2023 13_47_00 GMT-0500 (Eastern Standard Time)

Is this helpful? Not sure what I am seeing but this is when I was trying to re-roll additional options for a strip across the top because the existing ones were not blending.

zero01101 commented 1 year ago

yep, thanks; the debug image is 2 images vertically stacked; the top is your existing image with any empty area represented in black, and the bottom is the "mask" to apply in/outpainting to (in white, with existing content in black) so that's exactly as expected for an outpainting operation... for example,
openOutpaint_debug_Tue Mar 07 2023 17 50 51 GMT-0600 (Central Standard Time) is the debug output for the outpaint generating the lower-right on this image
2023-03-07 23 52 53 openOutpaint image

so tl;dr on that is it seems that the existing image and mask are being passed correctly to the API; did you verify you're using an inpainting model? or maybe did you possibly turn down the overmask value in the dream/img2img context menu? obviously you did not turn down overmask as evidenced by the overmask blobs in your debug image🤦

jwvanderbeck commented 1 year ago

Yeah verified both settings were correct :( Strangely this time around I was able to do both right and left but top is a mess. Maybe this is just how it is and it is just luck if it works on an image or not :(

zero01101 commented 1 year ago

well huh... just as a side note, i know i personally don't really do much in the way of, like, "large-scale" outpaints, and seem to have better overall coherence using smaller regions with a lot of context from the existing image... do smaller regions like 512x512 work "better"?

jwvanderbeck commented 1 year ago

Well the previous images were all too big for a single 512x512 addition to work well because it would miss a lot of context.

That said I continue to refine my workflow (as I think we all do constantly since every hour it seems there are new tools) and I'm going to start doing my outpainting earlier in the process I think, before upressing.

jwvanderbeck commented 1 year ago

Ok so wanted to come backj to this with a new image I am working on where I am doing the outpainting early in the process while still at lower resolution, as discussed.

You can see here once again where the right side blends in perfect but the left side acts like it completely ignores the content that it overlaps. This is using the 512x512 region.

I expanded the screenshot to show the settings, including that the model is set to an inpainting one, and that the overmask is set.

image

zero01101 commented 1 year ago

legit bonkers, seriously. if you're still working on that, can you click the save workspace button
image and give it whatever name you'd like, then click the [...] button, export it and upload it? i'd like to see if it worksonmymachine.jpg

similarly, can you try importing the attached workspace and seeing if outpainting works as expected on that? 2023-03-15T23 46 35.786Z_openOutpaint_workspace.zip assuming the model in your image is runway's, that's the one i'm using here as well

i mean like, maybe your computer's... kinda ethically opposed against westward expansion or something? :P

jwvanderbeck commented 1 year ago

I could probably recreate the workspace and get to that state. I will note however that I did finally get it to properly outpaint left, by creating a tall rectangle that encompassed the entire left side at once and, not sure it matters, I drew that rectangle from the bottom right (so starting inside the original image) to top left. When I did that it seemed to figure out what the heck I wanted, whereas just doing a standard 512x512 overlapping block in the top left, as shown in the image, did not.