-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: allow "Script" dropdown control #33
Conversation
This does not work as you expect it to. There is JavaScript tied to the scripts dropdown that expands/collapses the script HTML section. Simply selecting the value in the dropdown does not trigger the JavaScript. The same problem exists with the Hires fix checkbox, which required extra code to trigger. You can see this in But this also opens up the door to supporting the components within the scripts. Perhaps the suggestion you made in #34 would be a solution for that so all the components don't clog up the UI when creating a new preset. Basically make a new file that the user can edit for a custom list of component IDs, then show that in the config preset creation UI below the normal components. Would you like to try making that? |
So dropdown boxes seem to work differently to checkboxes, and this change I'm proposing actually works without change the javascript. I've been testing it all day on both Firefox and Chrome. |
I'm using Edge and changing the Script dropdown does not display the scripts body. |
I tested in Edge and also another 2 computers, but didn't see the problem you're describing. Anyway, I've updated the JS. But seeing as it doesn't happen on my end, can you give it a try please. |
Doesn't work. Upon further inspection, I don't think this particular problem is solvable. Each script body in the HTML does not have a unique selector that corresponds to the script dropdown values, so it's impossible to know which script body corresponds to which script dropdown value. Since we can't target the precise element we can't show it when appropriate. The script bodies are in the same order they appear in the script dropdown, but this doesn't help either. I briefly looked into the nth-child() selector but that wouldn't work because other extensions, such as ControlNet and DynamicPrompts, inject their HTML here which would screw it up. |
This works now after I updated to the latest A1111 commit (March 29). Looks like they changed how the Gradio dropdown HTML works. I'm busy with other stuff right now so I'll look into it more later. |
So they bumped the Gradio version up to 3.23 AUTOMATIC1111/stable-diffusion-webui@4697def on March 25 which changes how Gradio dropdowns work. One effect of this is that the dropdown values cannot be set via JavaScript anymore, but changing them via Python triggers any relevant events to be fired. So today I added new functionality to add any custom elements with an ID in a separate config file. I'll upload it after done playtesting. |
A simple change to allow controlling the "Script" dropdown.
Example configs: