Skip to content
Python

simplify move gradio components dict logic to plugin system

Chris Malone86f2325914f9
diff --git a/shared/utils/plugins.py b/shared/utils/plugins.py
index f03366b..c079d57 100644
--- a/shared/utils/plugins.py
+++ b/shared/utils/plugins.py
@@ -245,6 +245,9 @@ class WAN2GPApplication:
def finalize_ui_setup(self, main_module_globals: Dict[str, Any], all_ui_components: Dict[str, Any]):
self._create_plugin_tabs(main_module_globals)
- self.ui_components = all_ui_components
+ self.ui_components = {
+ name: obj for name, obj in all_ui_components.items()
+ if isinstance(obj, (gr.Blocks, gr.components.Component, gr.Row, gr.Column, gr.Tabs, gr.Group, gr.Accordion))
+ }
if self.plugin_manager:
self.plugin_manager.run_post_ui_setup(self.ui_components)
\ No newline at end of file
diff --git a/wgp.py b/wgp.py
index ae6c7d1..49c7389 100644
--- a/wgp.py
+++ b/wgp.py
@@ -8878,9 +8878,7 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non
outputs=[modal_container]
)
- tab_locals_dict = { name: obj for name, obj in locals().items() if isinstance(obj, (gr.Blocks, gr.components.Component, gr.Row, gr.Column, gr.Tabs, gr.Group, gr.Accordion)) }
-
- return ( state, loras_choices, lset_name, resolution, refresh_form_trigger, save_form_trigger, tab_locals_dict,
+ return ( state, loras_choices, lset_name, resolution, refresh_form_trigger, save_form_trigger, locals(),
# video_guide, image_guide, video_mask, image_mask, image_refs,
)