zero01101 / openoutpaint Goto Github PK
View Code? Open in Web Editor NEWlocal offline javascript and html canvas outpainting gizmo for stable diffusion webUI API 🐠
License: MIT License
local offline javascript and html canvas outpainting gizmo for stable diffusion webUI API 🐠
License: MIT License
I actually have some questions about overmasking, and what exactly it does...
I'm currently working on optimizing and simplifying the img2img code, and I'm kinda confused on its implementation. From what I see on the main branch, originally it inserted arcs randomly? And from the new overmasking branch, it seems to expand the mask to all four cardinal directions by n pixels, dictated by the Overmask px parameter?
What I'm trying to do is remove most of the ImageData Stuff because I don't like all those for loops (48f45e5); The only thing that is missing is overmasking, but I'm not sure what it is supposed to do.
Describe the bug
"Denoising Strength" below 0.7 results in a blurry image.
Used v1.5, v2.1[512] inpainting models with different samplers and steps
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Same behavior as in WebUI-Inpainting
Environment (please complete the following information):
I used to be able to move the canvas around by clicking and holding the mouse scroll wheel and then moving my mouse up, down, left, right. But now I can't. I'm on the latest version (git pull)
Is your feature request related to a problem? Please describe.
it is absolutely not
Describe the solution you'd like
so like when i was talking about difference globalcompositeoperation and failing at it in photoshop, i've since discovered what i meant was "background subtraction" and i still kinda think that'd be a nifty feature, like c'mon
no actually describe it dummy
oh uh so like if an in/outpaint dream or maybe even txt2img is requested with the "subtract background" option ticked, the following should occur:
the more i think about this, the more it sounds like it'll ONLY be useful for img2img because, uh, most people probably don't want a giant chunk of the "background" automagically smooshed into their new detail layer...
Describe alternatives you've considered
well i guess painstakingly erasing identical pixels would work if i wasn't impatient?
Additional context
i will 100% try and almost certainly fail to implement something like this myself, but uh, ahem don't let that stop anyone else from showing me who's boss ;)
priority
literally the lowest possible; like if there's an errant apostrophe in a readme 2 versions ago that's probably more important
Is your feature request related to a problem? Please describe.
nope
Describe the solution you'd like
discord hooks to work
Describe alternatives you've considered
IRC lol
Additional context
testing testing
Describe the bug
Nothing happens when I click save if the canvas or the selection is too big (I forgot the exact number, but something around 3712 or a little under it was the maximum that got saved).
To Reproduce
Set canvas to 4096x4096, refresh the page to get the new size applied, generated all over, try to save. Also, select a region of similarly high size and try saving it.
Expected behavior
Any size should save, or at least provide a clear error message explaining what's going on if it fails.
Desktop (please complete the following information):
obviously wrong
Once I installed the extention I a get this error:
RuntimeError: File at path E:\stable-diffusion-webui\extensions\openOutpaint-webUI-extension\app\pages\favicon.ico does not exist.
I try uninstalling and re-installing the extention and same error show
thought it'd be an easy fix, broke pretty much all masking functions, i'm going to bed
Very nice tool, thanks for making it!
I have a suggestion:
Edit: I realized that it's on the to-do list.
can't say i ever tried it but yeah that's busted
Since its a static site/app, please host this on github pages (Settings > Pages) so that we can have a look or even use it without needing to download and run our own server first.
Is your feature request related to a problem? Please describe.
sorta but the problem is probably me
Describe the solution you'd like
windows-native scripts for .devtools
folder because i hate NPM and don't want to think about it ever
Describe alternatives you've considered
abandoning software development entirely
Additional context
i'm a weenie
I tried to fade out the mask going towards original image.
This is the initial image I am using.
I test this by outpainting the right half.
It's a liner gradient from black
to white
. Simply replacing lines from
Line 651 in d1a131a
Line 670 in d1a131a
with
let grd = overMaskCanvasCtx.createLinearGradient(0, 0, 255, 0);
grd.addColorStop(0, "black");
grd.addColorStop(1, "white");
overMaskCanvasCtx.fillStyle = grd;
overMaskCanvasCtx.fillRect(0, 0, 254, 512);
This is what the mask looks like
Problem is that it only affects half of the original image while making the outpainted portion black.
Idea behind trying this was that any outpaint should also effect original image a little bit depending on whats in the outpainted half of the image.
try to do an in/outpaint at like 16, i think my canvas monitor workarounds are a Bad Plan™
Is your feature request related to a problem? Please describe.
Problem is when I do ctrl + z to bring back the mask, it doesn't bring it back. Only brings back the previous generation (or the original pic)
Describe the solution you'd like
When doing ctrl + z after a generation that I clicked "Y" to, I want the previous generation come back while the mask that I've put stays in its place and doesn't go away. So basically can you please add the option of putting the mask history in "History" tab?
Hey, I think it would be of great interest of the project for us to define some code formatting guidelines to allow for usage of prettier or eslint for auto-formatting. I think this could help keep the code clean.
We can keep many of our current trends (semicolon use, although currently not consistent) and 4 space indentation, but I think some limits of line lengths could help make the code a bit more readable, for example.
Some models are trained on new stuff that look good when they are up straight. Once rotated, the model miss it up.
A great feature would be if we could rotate the canvas for the model so it gets it right.
Is your feature request related to a problem? Please describe.
OpenOutpaint is a great idea. But having to run another app does not make the workflow seamless.
Describe the solution you'd like
Add OpenOutpaint as an extension to A1111. This will become a new "Outpaint" tab in the A1111 UI.
Describe alternatives you've considered
I guess you could edit the webui-user.bat
file to run both A1111 and OpenOutpaint at the same time, but it is still not really seamless.
Additional context
It should be simple (I think) to build an iframe in a tab. So the changes to the codebase shouldn't be too big.
In the future it could have additional features such as sending a generated image from the "txt2img" tab to the "Outpaint" tab.
Sometimes I like to grow the image in small steps in multiple areas, with PaintHua I can keep clicking on new areas to be generated and it will start working on it as soon as the current area finishes generating, in the order the new areas were created; previous generated areas remain waiting confirmation, and if regenerations are requested they get into the queue.
Describe the bug
When I try to inpaint an image and I make the square more than 512px, the image inside the square becomes lower res. I like making the "D" (Dream) square bigger because the bigger it is, the better the inpainting will be since the AI will have a clearer understanding of the whole image.
To Reproduce
Steps to reproduce the behavior:
Upload an image, inpaint part of it with the Mask Brush (M) tool, make the generation Dream (D) square 1024px (or any res higher than 512px, but 1024px is the most obvious) instead of the default 512px square by moving the mouse scroll wheel upwards, generate an image and compare before and after of what's inside the box.
Expected behavior
For the image that's not been masked and that's inside the "D" Dream square box not to become lower res and stay the same after generation
(First image is before generation, second image is after). See how the stars and city lights are lower res. This doesn't happen when the square is 512px. Even if I increase the square, the unmasked image inside the square shouldn't be affected but as you can see it is being affected
(The tool is really great as is! I'm enjoying using it a lot!)
It would be nice to see a line-by-line description of the process I used to create an image, so that I can learn which prompts and settings led to a good final image, for future reference.
Describe the solution you'd like
For each Dream or Img2img action that is successfully performed, create a line of text in a log file including:
In case of a Mask being drawn, or use of Color Brush, or Layer manipulation, or any other actions, add a short line of text equivalent to what is recorded in the History bar.
(Optional: Remove log lines when its action is undone, but keep recently undone lines ready to add back in case of "redo". Alternatively, include the fact that "undo/redo" was used in the log file.)
When the user clicks "Save canvas", write out a log file with the same name as the image output file (different extension). Or, if the image file format is compatible, write the log text to the image metadata ("caption").
It would be nice to be able to resize the image with a mouse scroll movement when pasting an image with Stamp image or Ctrl + v.
Currently, it is necessary to resize using Select image additionally, and there is a problem of selecting other images on the same layer together.
And is it possible to rotate the image as well?
I was reading new users' reddit posts and noticed some are complaining from the same things I had when I first used it.
Something that I think can be fixed with two changes to the UX
The complaints are along the lines of : "when i use it, it doesn't seem to match the image that i'm extending, it just makes a whole new image"
This is because the default value of Overmask px is 0
I am not sure if some people prefer the default to be zero but I personally always change it to something like 20 first thing when I load the interface.
I think a default that is different than zero is much better.
The second reason is that the currently set model in the automatic1111 ui is not an inpainting model so maybe also openOutpaint could look in the list and select an inpainting model by defalt if there is one, or at least issue a warning that the currently selected model is not an inpainting model which will cause more seams and less than ideal results.
This can be done by just checking if the model's name contains the word inpainting which should cover most of the cases.
What do you guys think? I feel those two minor changes will give a much better first time impression for new users.
Is your feature request related to a problem? Please describe.
Sometimes you have faces in your inpaint/outpaint. And without Codeformer or GFPGAN, the faces usually have artifacts. So I propose the "Restore Face" option from the API to be added.
Describe the solution you'd like
New "Restore face" checkbox under the "Stable Diffusion settings" panel.
Additional context
Face restore is already one of the parameters we can specify in the txt2img & img2img API call. So there should be no additional logic required.
Describe the bug
Brushes awfully slow in Firefox when canvas size is very big. The same issue does not seem to happen in chrome.
To Reproduce
Attempt to use a brush in a sufficiently large canvas for your computer. (For mine, 10000x10000 is already very noticeable). Issue seems proportional to size of canvas, not size of brush.
Expected behavior
As in chrome, lag should be proportional to brush size instead of canvas size.
Screenshots
No screenshots of the problem itself, but one of the profiler information of firefox.
It seems context moveTo functions are being very slow for some reason. (maybe Firefox fully redraws the canvas every frame when it changes?)
Desktop (please complete the following information):
After a dream completes and the new controls [<] [>] [+] [Y] [N] are displayed under the reticle, I think it makes sense that when the mouse is placed inside the reticle in questions the mouse buttons / wheel interact with the controls.
Scrolling should move between possibilities as if we pressed the left right arrows.
Clicking the mouse wheel should generate a new set
Left click should accept
Right click should cancel.
This change should only happen when the mouse is over a reticle that has the controls displayed.
The reason is that the normal controls are not too useful in this situation and it makes sense to do the next logical steps (select the picture we want) with the mouse controls without having to hunt for the tiny controls and click them.
Once the image is selected or cancelled or once the user wanders outside of the reticle the controls go back to behaving normally.
Maybe a change in the cursor shape can indicate that we are in a special mode, in case we want to give visual indication of that.
I think the flow described is much more practical than the current one when working with big images
Is your feature request related to a problem? Please describe.
the layers UI window needs a scrollbar because too many layers overflows it
Describe the solution you'd like
a scrollbar in the layers UI window
Describe alternatives you've considered
fewer layers? but telling people to not use the feature seems like a bad plan
if the file picker is "above" the browser's canvas area, double-clicking a picture to load can sometimes cause a request to be sent to SD webUI inadvertently
Originally posted by Drakmour December 30, 2022
I can't find where to put the initial resolution for hi-res fix in img2img of OpenOutpaint. Like firstpass height and width in text2img. Is there such option? I've read that right now it decrease the resolution x2 and then generate, but if my image is more than 1024 and is not square it still result in morbid multiple characters. I'd like to have an option to make firstpass 512x512 and then resize to my end resolution. It 99% works in text2img and should work in img2img. In text2img I get random result, while in img2img I can draw a sketch of pose of character myself to have much more control of the result.
Describe the bug
after expanding the canvas upwards or to the left, any brushed masks use the new "0px origin" instead of where they're actually drawn
To Reproduce
Expected behavior
the modified result should be where the mask is drawn instead of being offset by the new x-axis "zero point"
Screenshots
--after expanding vertically--
Desktop (please complete the following information):
It would be nice to have an easy way to go back to a prompt I've recently used. That is all.
As of now, to add the image I want to the canvas, I need to go through the process of Stamp image > Upload Image. Conversely, to export the image I worked on on the canvas, I have to download it by clicking Save canvas. I don't know if it's technically possible, but if possible, it would be nice to have a function to paste and copy image layers using ctrl + c / ctrl + v like in Photoshop. PaintHua supports a similar feature. https://github.com/BlinkDL/Hua
When i open outpaint on Chrome there is no square frame on cursor, only regular cursor, so i cant see outpaint zone clearly.
To Reproduce:
Open: http://127.0.0.1:3456/ in Google Chrome v108.0.5359.99
On the OperaGX works as intended:
Describe the bug
If localStorage quota is reached, resources fail silently to synchronize.
To Reproduce
Just upload a lot of images to the stamp tool.
Expected behavior
Warn the user if quota is exceeded, and mark non-persisted images maybe? We should use IndexedDB for this too.
Screenshots
The console error for quota reached.
Desktop (please complete the following information):
Additional context
Should probably use IndexedDB for this, as it almost as compatible as localStorage and allow for a much larger storage. Config should still use localStorage.
I think it would make more sense to instead of showing scale factor in the UI, just show the resulting image size.
Also capturing scroll events while in mask mode for the purpose of changing the brush size to be independent of scale factor
I understand that there may be situations where having a different resolution than the cursor size might be necessary; but it is inconvenient to have to keep setting things twice when you are ok with the resolutions matching; so it would be useful to have a checkbox to make both settings stay in sync.
Describe the bug
"To pan, hold CMD and the scroll wheel, then drag. To zoom, hold CMD and scroll."
My laptop doesn't have a scroll wheel. It's not clear how I would pan; I'm not aware of a way to create middle-click-and-drag events, and most applications use modifier keys instead.
Scrolling is a valid touch gesture, of course, but CMD-scroll also has no effect; the cursor size changes instead.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Functioning zoom.
Desktop (please complete the following information):
Additional context
"Buy a macbook" is an unfortunate debugging instruction, and this will probably work if I connect an external mouse... I hope. However, maybe you could add a "pan" tool? I think "click m, click-drag" would be equally fast anyway.
i could probably figure out why this happens myself but figured i should make an issue before i forget this happens
steps to reproduce:
if you choose "N" after a batch of image mutations are presented, the marching ants become offended and refuse to leave the premises
Describe the bug
the eye icon to toggle layer visibility only affects the currently-selected layer, not the layer associated with toggle's row
To Reproduce
Expected behavior
appropriate layer is un/hidden
Desktop (please complete the following information):
Additional context
have done almost NO looking into it, my apologies, just something i noticed :/
Is your feature request related to a problem? Please describe.
We almost forgot the feature that was requested on reddit for viewing/reusing the seed used for generation.
Describe the solution you'd like
As the API does not provide this value, we can try locally generating a seed, and using that to send to the API when seed is set to - 1.
Describe the bug
Even though my auto111 instance has plenty of models, as well as the recommended inpainting model, nothing shows up and no generation happens when attempting to generate an image.
Desktop (please complete the following information):
Additional context
I've read through the setup instructions. Didn't see anything related to my issue.
used to disappear and pop back to life if image was rejected, should bring that back, erasing the mask afterwards is Poor User Experience™
Sometimes you might wanna generate something in a long/thin area and shouldn't need to waste memory/processing power with a bunch of pixels are are not considered relevant. I think it would be good to have the option of setting non-square dimensions for the cursor and resolution.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.