Skip to content
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

UI option never hidden, always starts out unchecked #53

Open
Black-Platypus opened this issue Dec 20, 2024 · 7 comments
Open

UI option never hidden, always starts out unchecked #53

Black-Platypus opened this issue Dec 20, 2024 · 7 comments

Comments

@Black-Platypus
Copy link

The accordion UI item is never hidden, like the setting "Hide in Txt2Img/Img2Img tab" suggests.
This leads to the menu spawning in unchecked, which has lead to much confusion 😅
I don't know how the UI/Settings system works, but it looks like the settings value for "negpip_hide" is read into opt_hideui, without that variable ever being used.

opt_hideui = getattr(shared.opts,OPT_HIDE, False)

The settings value is queried again only in process_batch.
Also, I can't get the "Toggle startup Active" button to work. I assume the checkbox should start out being checked?

hako-mikan added a commit that referenced this issue Jan 9, 2025
@hako-mikan
Copy link
Owner

Thanks!
It looks like I missed that the visible setting was left out when I approved pull request #45.
Fixed it.

@Black-Platypus
Copy link
Author

The hiding option works now.
However, it always starts off disabled (including when it is hidden); that problem still persists.
Using a fresh install with only NegPiP installed (except for the built-in extensions)

My ui-config.json contains:

    "customscript/negpip.py/txt2img/NegPiP/visible": true,
    "customscript/negpip.py/txt2img/NegPiP/value": false,
    "txt2img/Toggle startup with Active(Now:None)/visible": true,
    "customscript/negpip.py/img2img/NegPiP/visible": true,
    "customscript/negpip.py/img2img/NegPiP/value": null,
    "img2img/Toggle startup with Active(Now:None)/visible": true,
    "customscript/negpip.py/txt2img/Active/value": true,
    "txt2img/Toggle startup with Active(Now:False)/visible": true,
    "txt2img/Toggle startup with Active(Now:True)/visible": true

customscript/negpip.py/txt2img/NegPiP/value always seems to stay false

Does it matter that the caption text is different between

toggle = gr.Button(elem_id="switch_default", value=f"Toggle startup with Active(Now:{startup_i if is_img2img else startup_t})", variant="primary")
and
return gr.update(value = f"Toggle startup Active(Now:{data[key]})")
?
I.e. "Toggle startup [WITH ]Active"?
Does that somehow affect things? I wouldn't think so, but I want to make sure 😅

Capture.2025-01-09.20-50-51.mp4

@hako-mikan
Copy link
Owner

If you hide it, you can turn the functionality on or off in the "Active" setting under Settings.
At this time, all settings on the generation tab will be disabled.

@Black-Platypus
Copy link
Author

No, it always starts out deactivated for me, even when it is hidden and the "Active" setting it set.
Re-toggling the setting, reloading, nothing makes it work

@hako-mikan
Copy link
Owner

Judging from the situation, it seems that the contents of ui-config.json are either not being correctly rewritten or not being properly loaded.

@Black-Platypus
Copy link
Author

Can you reproduce the issue, or do you have to work from my reports?
I.e. is this an issue on my end somehow? If so, that's strange: I tested the above on a fresh install, and without much customizing of settings 🤔
That does mean though that I do have two separate "installs" of SD-WebUI. Maybe there's one thing that the clean install shares with the setup I actively use? 🥴
Nothing that I can see should cause an issue, of course, so I'm at a loss.

But if I'm the only person experiencing this, there must be something I have to do 😅
Let me know your thoughts, and thank you for your time and effort :)

@Black-Platypus
Copy link
Author

I just tested the latest update (b054b92): Now it works for loading the UI for the first time! 🥳
However, changes only take effect when first starting the WebUI.
If you make changes while the server keeps running and refresh the page, it loads the state to what it was when the server was started.
(A restart is needed to see the effect)

If you could make it read its current setting on render (? refresh? I don't know which callbacks/events exist in the Automatic1111 WebUI 😅), that would complete the last bit of the issue.
Otherwise, a message indicating that you have to restart for the toggle/change to take effect would be nice on or after the button 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants