An extensive new feature of One Button Prompt. One Button goes brrrr.
This will allow you to:
- Generate an image with TXT2IMG
- Can enable Hi res. fix
- Possible to set up a Quality Gate, so only the best images get upscaled
- Possible to ignore the One Button Prompt generation, and use your own prompts
- Upscale that image with IMG2IMG
- This proces can be repeated. Loopback enabled.
- Supports SD Upscale, Ultimate SD Upscale and Controlnet tile_resample methods of upscaling
- Upscale with EXTRAS
- Possiblity to just batch upscale existing images
All with a single press of One Button.
It works by using various calls of the WebUI API and calling them with the correct parameters in the correct order.
The basic requirement, is that WebUI is started with --api enabled. To do so, go into your webui-user.bat file in the WebUi folder, and add --api to the line with set COMMANDLINE_ARGS.
This is not needed if you are running SD Next (Vladmandic).
For example, this is how my file looks like.
After you have made your changes, restart WebUI with webui-user.bat
To be able to use the Quality Gate functionality, you need to install the following extension into WebUI:
You can install this via the "Install from URL" option in WebUI
To be able to use Ultimate SD Upscale, you need to have that installed. It can be found here:
You can install this via the "Install from URL" option in WebUI
To be able to use ControlNET 1.1 and the tile_resample method, you need to install both.
Here is an extensive guide on civitai
Here is a youtube video guide from Olivio Sarikas
One Button Prompt uses its own locations and filenaming convention.
Go to your WebUI installation folder and then \extensions\onebuttonprompt\automated_outputs\
Here you should see the One Button Prompt folder structure.
- txt2img -> txt2img results from One Button Run are stored here.
- promps -> txt2img prompts and parameters used are stored here.
- img2img -> img2img results from One Button Run are stored here. With loopback enabled, they are overwritten when loopback is done.
- extras -> extras results from One Button Run are stored here.
- upscale_me -> Place images here for using "just upscale" mode.
When using One Button Prompt to generate the prompt, the subject will be part of the name.
Here are some examples, so you can quickly identify the different pictures.
Important to note, is that the TXT2IMG prompt generation process works with the options set in the Main, Workflow Assist and Advanced tabs.
So you can set up any specifics you want for the prompt generation first.
The "folder" buttons opens to your One Button Prompt automated outputs folders.
There are some general options to set first.
URL -> This should be the URL used by WebUI (see your webbrowser). This is standardly http://127.0.0.1:7860 , but change it to your specific instance.
Amount of images to generate -> How many times should it repeat the entire process. So how many images to generate and upscale
Don't generate, only upscale -> Place images in the /upscale_me/ folder, when enabled, it will skip the TXT2IMG part, and will start batch upscaling the images with the set parameters
model to use -> Select which model to use during generation. "Currently Selected Model" meand the model you have loaded right now. "all" means a random model (not inpainting models). Or select a specific one.
For TXT2IMG most options should be familiar. I will here explain some of the additions and changes.
Size to generate:
- all -> picks randomly between portrait, wide and square
- portrait -> 512x768
- wide -> 768x512
- square -> 512x512
- ultrawide -> 1280x360 (Don't worry, this one is just for me, and won't be used when picking "all")
Sampler:
Added option for "all", picks randomly
Hirex upscaler:
Added option for "all", picks randomly
Added option "automatic", sets Upscaler and Denoise Strength based on prompt. Example, if the prompt contains anime, it will try to use the anime upscaler.
Idea and inspired by xKean. Such an awesome addition. Additional ideas by pto2k. See requirements above.
When enabling Quality Gate, it will repeat the above TXT2IMG process until:
- an Image reaches the Quality Score
- we have reached the amount of tries
When an image reaches the quality score, all other images are removed. It will then continue with the quality image. With standard settings, if it reaches the amount of tries, it will pick the image with the highest score. All other images are removed. It will then continue with the highest quality image.
There are some other options as well:
Move Hires fix afterwards - This option needs to be used with Hires. fix enabled for it to work. It turns of Hires. fix during the initial generation of images. Once a image is chosen by the Quality Gate, it will then rerun the image, but this time with Hires. fix enabled. This allows for faster iteration.
Mode of operation - Standardly set to highest which picks the image with the highest score. The other option is gated which will only allow images scoring the
Quality Score will be used. These will then not count to the Amount of images to generate.
Images is standarly set to keep used. If you set this to keep all, all generated images are kept, and nothing automatically removed.
Again, most options should be familiar for using IMG2IMG when upscaling. It defaults to using "SD Upscale" method which is included in WebUI standardly. Enable "Upscale image with IMG2IMG" to actually turn this on.
Amount times to repeat upscaling with IMG2IMG (loopback) -> This controls the amount of times to use IMG2IMG to upscale.
I will describe some of the changes from normal.
model to use -> Select which model to use during generation. "Currently Selected Model" meand the model you have loaded right now. "all" means a random model (not inpainting models). Or select a specific one.
Note that you can have a different model selected here, than used in the TXT2IMG process.
Sampler:
Added option for "all", picks randomly
Upscaler:
Added option for "all", picks randomly
Added option "automatic", sets Upscaler and Denoise Strength based on prompt. Example, if the prompt contains anime, it will try to use the anime upscaler.
adjust denoise each img2img batch -> Adds or subtracts this amount of denoise, during each IMG2IMG batch. Usually you want a lower denoise when upscaling larger images.
Turn on "Use Ultimate SD Upscale script instead" to use Ultimate SD Upscale. You need to have that extension installed, see requirements above.
Here, all options from Ultimate SD Upscale are available.
It uses img2img padding for the padding. It will always be set to "Scale from image size"
Best used in combination with Ultimate SD Upscale and the 4x-UltraSharp upscaler, however you can use it with the normal SD Upscaler as well. The controlnet tile model name is filled in for you, but if a later or newer version comes out, you might have to change this to that specific one. Current version is "control_v11f1e_sd15_tile [a371b31b]"
There is also a option for "also enable wierd blocky upscale mode". This was a bug I found during development, but brought in as a feature. Best used with 4x-UltraSharp upscaler and a decent denoise (0.7-0.8).
Here is an example result, so you can see what to expect.
art by Daria Petrilli,art by J.C. Leyendecker, landscape of a City, at Overcast, Simple illustration, Lonely, Industrial Art, volumetric lighting, DayGlo and electric pink hue, under water
The last part is rather straightforward. You can at the last step, upscale the image through the EXTRAS tab. All the main options are here, you do need to enable "Enable upscale with extras". Again, the upscalers set to "all" are random. You can get both the same upscaler.
Next to the Start button, is a checkbox for "Don't generate, only upscale"
This mode skips the entire TXT2IMG part of the batch. Instead, it will pick up all image files placed in the \extensions\OneButtonPrompt-dev\automated_outputs\upscale_me\ folder, and starts looping over those instead. It will ignore any .txt file. It will keep the original files, so you have to remove them before starting the next batch again.
Example:
This method will read the original prompt and negative prompt from the image file (if it exists) and use that during the upscaling process. Thus it can be used for any image generated by the WebUI, not specific to OneButtonPrompt image files.
This method is perfect for anyone who just generates their images via TXT2IMG, and then upscale in batch the best results automatically.
Each one of you has their own workflow ideas. People might prefer hires fix over tile upscaling, or some people might prefer upscaling multiple times as a loopback.
For me, I like to cherry pick results, and then use the "Just Upscale mode" to batch upscale my favorites.
You can set everything to "all", and just start generating a bunch of random stuff.
I'm sure your specific way of upscaling and working is supported by all the options offered here. Missing something? Let me know!
If you don't like the results of the One Button Prompt generator (how could you not!), you can turn off the prompt generation, and use your own prompts instead.
Go to the "Workflow assist" tab, and enable "Workflow mode". Put your prompt in the Workflow prompt field, and it will start using that
For the negative prompt, use the "Main" tab
Put the negative prompt in the "Use this negative prompt" field.
And done, you can now use One Button Run and Upscale with your own prompts.
Keep having fun!