Gerschel / sd_web_ui_preset_utils

Preset Manager moved private
252 stars 20 forks source link

Load saved parameters on top while preserving existing settings possible? #24

Closed hzielke closed 1 year ago

hzielke commented 1 year ago

I am using x-y(-z) plots a lot to get an idea of possible iterations. Would it be possible to load a saved set of limited presets on top of a preconfigured setup (for example - prompt, size, steps fields set in tab, preset with only plot parameters saved) without overwriting or clearing the previosly set parameters?

Gerschel commented 1 year ago

I'm not completely understanding the question.

If you mean apply one preset, then apply another, this can be done by saving both with detailed save. When applying from a detailed setting, it would only apply to that component. So you could save some for sizes, others for prompt trigger words, etc.
Then choose a preset to apply size, a different to apply prompt, and it should not affect the previous components.

This is the opposite of what quick saving does, where, it will save a value for every component (it's aware of), and when applied, will overwrite each component that's stored in it's save, even if empty value.

I would like to know more if I got it wrong, or if it's not working that way.

hzielke commented 1 year ago

No problem, I'll try to be more specific.

I am startig without any other extensions. I use the "reset" preset to reset all values. I change lets say width and heigth to 433x642. I do a detailed save for width and heigth as "test".

json is

"test": {
    "Width": 848,
    "Height": 1064
}

I pull the "reset" preset again to get "test" out of the dropdown. I put in a random prompt and negative prompt. I activate all radio buttons, pull all sliders to the right (not batch), and enter a random seed. I hit generate. I hit interrupt after 3 minutes and 2 pictures done. I pull the "test" preset from quick set. The 433x642 resolution is applied but all other settings revert to defaults and I lose the prompt and the seed. As workaround I transfer the settings from my last picture via the image browser extension after applying the selective preset (not now, all extensions are disabled). Combining several selectives is unfortunately impossible that way.

Edit: By the way, using your preset functionality is a gamechanger, just awesome!!!

Gerschel commented 1 year ago

Hmm. It shouldn't behave like that. I might have broken it during the last update. It should only apply if a setting in the save matches a component, and if component is present on page. I wonder if it had to do with me linking img2img and txt2img. I had a weird bug when I tried implementing a delete function, but one tab would resave data from the other.
So either I didn't apply the filter correctly, or it's leaking across.

Gerschel commented 1 year ago

REMEMBER, MAKE A BACKUP OF YOUR CONFIGS. I also included an update script that would rename the config files away from the names in the repository.
The idea is, they get automatically renamed if these new names do not exist, so on another update, it will check before writing. Then delete the flag (blank file), so on next start it doesn't update.
But this only runs from a fresh start, not a reapply.
So if you update through the extension tab, it'll probably throw errors, just shut it down, and restart.

Recommended way, update then start the ui.

I think I got it. I don't know how it worked, stupid auto-brackets, sometimes delete and don't.
Kept the old functionality, and added a checkbox to choose.
My code is getting pretty nasty, hard to read/remember, I had already started a rewrite to clean it up.

Gerschel commented 1 year ago

I will leave this issue open for a few days to see how it resolves.

hzielke commented 1 year ago

Great, works like a charm now!

Gerschel commented 1 year ago

Can you check my post and give an opinion. https://github.com/Gerschel/sd_web_ui_preset_utils/discussions/29#discussioncomment-4704061