Skip to content

ICodeDiffusion/SDAtom-WebUi-us-Plus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDAtom-WebUi-us-Plus

reForge and Latest Forge Now Compatible!

I have been a huge fan of this extension for a while. It's simple, not heavy on performance, and works perfectly!

Audio notifications are functional, and it also has its own notification system. This means you can use a custom notification MP3 alongside SD-ATOM's default notification.

Latest Forge Now Works!

I found a way to make this extension compatible with the newest version of Forge (Gradio 4).

This is the branch you need for the latest Forge version: https://github.com/ICodeDiffusion/SDAtom-WebUi-us-Plus/tree/Latest-Forge-SDAtom-WebUi-us-Plus

The Original Reason Why It Didn't Work

When I ported the extension to new forge (Gradio 4), I discovered that each setting has a static element id. However, some settings are auto-generated a name upon installation and are given a component ID instead, the big one that broke this extension was the Model Checkpoint Dropdown, without it working the entire extension wouldn't work anymore, so only older forge/reforge worked since the dropdown had a static elemnt id.

For example, the new Forge UI for Checkpoint selection uses component-1370, while reForge and older versions of Forge use something like setting_sd_model_checkpoint.

This means that if everyone's UI auto-generates the ID/name for those types of UI elements, and it differs for each person, it could indicate an internal Gradio system that I did not know how to change.

Now this is no longer an issue, I found a workaraout to still get this extension to work, not fully when it comes to the checkpoint selection, but it's much better than not having it work at all.

Additions So Far

My goal is to focus on popular extensions first.

I plan to make 4 Main versions and will be cleaning up this repo.

Old Forge/reForge/Classic Forge:

  • With Extensions
  • Without Extensions

New Forge (Gradio 4):

  • With Extensions
  • Without Extensions

This way so that people can have the option to get the barebones version or have a feature rich version.

Added ADetailer (Tab one so far)

  • Activate Extension
  • Model Selection
  • Detection Confidence
  • Mask only the top k
  • Mask min area ratio
  • Mask max area ratio
  • Positive Prompt
  • Negative Prompt
  • Denoise Strength
    • Currently Working on:
      • A method to filter top-k masks by "confidence" or "area." This is not working yet, as it's a different UI element than I'm used to.

Added Regional Prompter

(I belive I added this back in, but need to check when I rework this repo.)

  • Activate the extension
  • Matrix:
    • Base Ratio
    • Use Base Prompt
    • Use Common Prompt
    • Use Common Negative Prompt
    • Main Splitting
    • Divide Ratio

Roadmap

  • Complete ADetailer capabilities.
  • Add other extensions and support built-in ones as well.
  • Add reForge (I have a working prototype I have been using for about a month) & Latest Forge capabilities (this will take longer).

Why am I doing this?

A major factor is that Agent Scheduler does not let you edit the settings of extensions in queued tasks. For example, if you have 15 queued tasks that all have settings in an extension you want to change, the JSON file does not show those settings. You are then forced to re-queue the tasks all over again just to have the adjusted settings.

Another annoyance is that if you cancel a run on Agent Scheduler midway through to change some settings, the preview breaks and no longer shows. You have to wait until the image is finished to check it. Eventually, it does fix itself, but it takes a while to start showing up again.

This extension has been the most reliable for me, and... IT JUST WORKS! (No pun intended).

How to add extensions yourself [Coming soon]

It's actually quite simple, I use brave since it has a simplefied element view by using right-click block element (But not actually block it) and will show you the name of the element you need to put in for it to work.

It looks like this, on Brave Browser: Right-Click anywhere: Screenshot 2024-12-20 150251

Click on the element you want to change and get the element name: Screenshot 2024-12-20 150303

After clicking you will get this: Screenshot 2024-12-20 150316

Now look at the bottom right corner: Screenshot 2024-12-20 150310

"#script_img2img_adetailer_ad_prompt" THIS IS WHAT YOU NEED!

If you see "#component-1663" (or any other number), you would not beable to add it, this is an autogenerated name once you run webui for the first time, because of this, SD-ATOM cannot identify it. This seems to be an internal Gradio thing that does not work with this extension.

ORIGINAL DESCRIPTION

This is a user script that adds a processing queue to the web ui of AUTOMATIC1111/stable-diffusion-webui. There is also an option to save one or more sets of settings for quickly loading them again later.

alt text

Installation

  1. Install as an WebUi extension, Open the webui and go to the Extensions tab, you can find the extension under Available > Web UI client queue. You can also use Install from URL and enter the url to the extension repo (https://github.com/Kryptortio/SDAtom-WebUi-client-queue-ext) and then click install.

  2. Run script without installing

  3. To install the user script I recommend installing an addon where you that let's you add user scripts

After you have installed an extension simply open the script and you will be asked if you want to install it.

The script assumes you are running the web interface on the url http://127.0.0.1:7860/ if you are using another url you can open the script yourself and just copy or modify the //match row to match the url you are using.

Updating

Hopefully the script will update autmatically but if the script doesn't have the latest version then it can be updated manually.

  1. (Extension for AUTOMATIC1111) click Extensions > Check for updates > Apply and restart UI.

  2. (Bookmarklet) Clear browser cache.

  3. (Userscript) Click this script link and reinstall it.

Usage

  • Change the prompt and other settings to your liking
  • Click the add to queue button (top right corner), adjust how many times it should run (default is 1)
  • Keep adding as many as you like
  • Click process queue to start running through the queue. You can keep adding to while it's working but when each item finishes current settings will be replaced with the ones in the queued item.

The interface is added below the normal interface with one floating button in the top right. If you are confused about what any button or field is for hold the mouse over it for a description. Settings and the queue are saved in your browser if you clear browser data it will be removed. The queue can be edited directly while it's being processed (maybe just avoid changing it just as it's finishing an item).

Prompt filter

Prompt filters can be used to process your prompts before they get added to the queue (textbox after the import/export text box). To add a filter you add a regular expression on the format [{"desc":"description/name","pattern":"regex pattern","replace":"replacement string/regex","flags":"regex flags"}] multiple regex can be added within the [] separated by commas. For experimenting with regex, this is a good site https://regex101.com/

Example pattern filters:

  • {"desc":"Remove multiple spaces","pattern":"\\s{2,}","replace":" ","flags":"g"}
  • {"desc":"Always \", \" (space after , not before)","pattern":"\\s*,\\s*","replace":", ","flags":"g"}
  • {"desc":"Add the prefix banana to all prompt","pattern":"^","replace":"banana, ","flags":"g"}
  • {"desc":"Add the postfix banana to all prompt","pattern":"$","replace":", banana","flags":"g"}

Feel free to share more in the discussions tab

Script extensions

This text field is where you can add your own script that gets executed after the ui has loaded. This can be used to make your own changes to the script without having to modify the script itself (and having to do it each time you update the script). Some examples of what you could add to the box (several are possible separated with ; and a new line):

  • Make the add to queue button orange conf.ui.addToQueueButton.style.background = '#CE6400';
  • Make the add to queue button text white conf.ui.addToQueueButton.style.color = 'white';
  • Move the add to queue button inside the main ui and remove the opacity
     conf.shadowDOM.root.querySelector('#quicksettings').appendChild(conf.ui.addToQueueButton);
     conf.ui.addToQueueButton.style.position = 'unset';
     conf.ui.addToQueueButton.style.opacity = '1';
    

Feel free to share more in the discussions tab (note that scripts has some security risks so some care should be taken when adding scripts)

Known issues

Since version 1.6.0 of the web ui, restore face and tiling options are now hidden by default. This will cause the script to complain but besides those not working the rest should work fine. To restore those two options go to Settings > User interface > Options in main UI - txt2img there you can add them back by typing tiling and face_restoration. After adding the two of them to both txt2img and img2img save and reload the UI.

Troubleshooting

Steps to try to fix issues

  • Check that you are running the latest version of the script and an updated version of the web ui.
    • To update the script click here.
    • To update AUTOMATIC1111 Stable Diffusion web UI you run the command git pull origin master in the same folder as webui.bat. Optionall you can note what version you have now first if you want the option to try going back later, to do that the command is git rev-parse HEAD
  • Check the Limitations section to see if your version matches the commit listed there, so that you haven't updated to a new version that is not yet supported. Newer versions of AUTOMATIC1111 might work fine but sometimes they change something that breaks the script.
    • If you want to try to go to a specific version of AUTOMATIC1111 you can use the command git checkout followed by the id you want to use (e.g. the one listed under limitations)
  • When updating the script your old queue entries might not work fully anymore (if the gui has changed). Then you need to load the entry manually and check that every setting gets loaded, manually set any that won't load anymore and then readd it to the queue.
  • If nothing else works to reset the script/extension press F12 to open the developer tools, then go to the Console tab and paste this delete localStorage.awqSavedSetting; delete localStorage.awqCurrentQueue; then press enter and reload the page. If you want you can copy the data first with the commands localStorage.awqSavedSetting and localStorage.awqCurrentQueue after each command you can copy the output.

Steps to try to find the cause of issues

  • Check the for errors in the output console (big white box at the bottom).
  • Activate verbose by clicking Script settings and then the Verbose console checkbox, reload the page and try again, are you seeing any errors in the optput console now?
  • Press F12 then go to the console tab and reload the page, do you see any errors in there?

Limitations

Latest commit (version of AUTOMATIC1111) confirmed to be working (1.6.0.2 5ef669de080814067961f28357256e8fe27544f4)

  • Only txt2img, img2img and extras are supported
  • For img2img/extras loading a new image is not supported
  • Settings for "Prompts from file or textbox" is not supported

About

Queue system for AUTOMATIC1111's webui

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%