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

[fix] can't load webui if selected wrong extra option in ui #15120

Closed

Conversation

light-and-ray
Copy link
Contributor

@light-and-ray light-and-ray commented Mar 4, 2024

Description

There is a bug: you can add an option from extension, e.g. controlnet_show_batch_images_in_ui, and after restart webui won't able to start, due to KeyError. It happens because this option was declared in on_ui_settings callback. I've found the solution, if the author of extension wants to be able to add their option in settings in ui, they need to use option template instead of callback, like w-e-w does in their nudenet_nsfw_censor_scripts/settings.py (fix in my extension: light-and-ray/sd-webui-lama-cleaner-masked-content@e8a9170) Maybe it's needed to add recommendation to not use on_ui_settings callback

My PR fixes 2 things:

  • prevent webui crashing if can't find settings (e.g. extension was disabled)
  • prevent user to add settings which are not available on create_ui moment

Checklist:

@AUTOMATIC1111
Copy link
Owner

This can also be remedied by calling script_callbacks.ui_settings_callback() earlier; this way, controlnet's settings can also be added to the UI. A possible problem is that calling those callback earlier can break some scripts; I made the PR with changes: #15121

@light-and-ray light-and-ray deleted the update_extra_options branch March 5, 2024 00:15
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

Successfully merging this pull request may close these issues.

2 participants