-
Notifications
You must be signed in to change notification settings - Fork 1
bunch of improvements #3
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
Conversation
Wow, I really appreciate the effort and precision with which you improved the script's structure. Unfortunately, I wrote it with very basic knowledge of Gradio, WebUI, and Python. For the most part, I followed examples from other similar scripts and used some logical reasoning to put it together. Honestly, I wouldn't have been able to apply most of the improvements you made. Anyway, the script is now updated, and most of the improvements have been implemented. However, I decided not to change a couple of things: Save folder: This might be because I'm using an old version of WebUI and Gradio, so the option doesn't apply correctly. I preferred to keep the default folder as "outputs/photo_refiner_outputs." I don't think it's a big deal. Tab location: I still want to keep the script in the "txt2img" and "img2img" tabs for convenience. I don't think it causes any issues. I also fixed a few small things and cleaned up the code structure to make it clearer. Additionally, I made the extension more compact by splitting the sliders into rows. I also added the "Denoise" effect, which could come in handy. Once again, thank you very much. I'm glad the script is better now. PS: Maybe some things are still not 100% optimized, but I think it's much more presentable as an extension now. |
what version of web UI are you targeting? |
commit 0af28699c45c1c5bf9cb6818caac6ce881123131 as I already told you, I assembled everything with a really basic knowledge of python and substantially 0 knowledge of gradio and webui... I wrote the script like this because it is the only method I managed to make work (seeing how other existing similar scripts worked) |
that's why I'm here to help |
use timestamp when saving the image

there's no reason to use random numbers
the img object given back webui should be a PIL.Image
as the file is save it should also have
already_saved_as
attr set the it's save path, this action is performed so that gradio does not create a copy of the image for serveing the web pagethis also fixis the

Open images output directory
use InputAccordion


aka Accordion with built-in chackbox, no need to reinvent the wheel
disable
enabled
the open and close state of the Accordion is linked with the
enabe checkbox
but you can manually check the box to detach the Accordion with the checkbox
add to Extras tab as a module
also you can add modules in Extra tab to the img2img tab in settings

because they already exist one module currently if you do so you end up with two photo-refiner in txt2img and img2img tab

https://github.com/Marc0ai/sd-webui-photo-refiner/compare/main...w-e-w:sd-webui-photo-refiner:main?expand=1#diff-be9c8a7a324e96ef67051d3911bb13666c7963f9a70a635832b960fc7e218e11L26
also unless you're actively using element ID for you should not static ID
and when you do sympathetic ID you must make sure that there isn't any duplicate ideas otherwise it's pointless
there's helper functions in web UI that helps you create the IDS but considering that you're not using the ID I just removed it