Comments (7)
It's not quite that simple. The styles button reads the values from predefined 2 textboxes (prompt/neg prompt), but config presets needs to accept a variable number of arguments because it works with both txt2img and img2img tabs. To do this we need to make use of a coding trick with *args and anonymous functions. Combined with Gradio being really stupid with how their dropdowns work, desyncs happen between server and client, and I couldn't find a way to fix that desync.
Can you just get it to save the config and let us know its not usable until we restart the UI? I'm usually in the middle of something and restarting the UI interrupts me so I rarely ever create any preconfigs.
from config-presets.
There's some trickery going on with the code that was causing issues, and the only way I could figure out how to resolve it was to restart the UI after creating a new config preset. It should be possible to do it without a restart like before A1111's update a few weeks ago, but I couldn't get it to work after the update.
from config-presets.
Maybe you could look at the way styles are being saved, and copy that method?
from config-presets.
It's not quite that simple. The styles button reads the values from predefined 2 textboxes (prompt/neg prompt), but config presets needs to accept a variable number of arguments because it works with both txt2img and img2img tabs. To do this we need to make use of a coding trick with *args and anonymous functions. Combined with Gradio being really stupid with how their dropdowns work, desyncs happen between server and client, and I couldn't find a way to fix that desync.
from config-presets.
@medledan You need to comment out this function (line ~600) in config_presets (add #
before each line):
save_button.click( # need this to runa after save_config()
fn=None,
_js="config_preset_settings_restart_gradio()", # restart Gradio
)
All new presets will show up after a reset, and existing preset changes will take effect immediately, which isn't half bad.
@Zyin055 I've been plagued by basically the same thing in regional prompter's presets - the menu item is added to the dropdown with gr.update, but it isn't recognised by the selection event. Are you aware of any fix in recent gradio versions / issue opened in the repo on the matter?
from config-presets.
So I think I've located the cause for this in gradio-app/gradio#4210 ; the simple workaround is updating the dropdown with a persistent list object, same one its choices are inited with. You can check the PR / commit in regional prompter for details, my testing has shown it's working perfectly so far, no restart needed.
from config-presets.
Fixed with PR #41
from config-presets.
Related Issues (20)
- UI elements don't show up in 1.6 HOT 9
- Save Script name instead of index HOT 5
- FEATURE REQUEST: Checkbox groups HOT 5
- BUG: Config Presets breaks in A1111 v1.6 HOT 1
- Save causes error. HOT 5
- update my stable diffusion doesn't appear anymore HOT 2
- aDetailer Section Now Broken - Extension Load Fails HOT 6
- Tiled Diffusion - Tiled VAE elements changed IDs HOT 1
- Custom Options not applying HOT 4
- Feature request: Override setting field. HOT 1
- Confused on how to populate aDetailer fields in the add preset feature. HOT 4
- Feature Request : Ability to save Adetailer Separate Checkpoint HOT 1
- How do I save prompt and neg prompts? HOT 6
- [BUG] I get ERROR icons when saving sometimes AUTOMATIC1111 v1.7.0 HOT 9
- Uncommenting controlnet components breaks extension HOT 4
- Adding an Extension Checkbox Option HOT 5
- Config Presets not showing on img2img tab HOT 6
- Component with id 2096 not a valid input component. HOT 1
- The 4/13/2024 update breaks compatibility with Forge UI HOT 3
- Incompatibility with Tiled Diffusion HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from config-presets.