Skip to content
Python

simplify setup routines (2)

Chris Malone5cdd7cf6b965
diff --git a/plugin_system.py b/plugin_system.py
index a1eaa54..5c42121 100644
--- a/plugin_system.py
+++ b/plugin_system.py
@@ -19,6 +19,7 @@ class WAN2GPPlugin:
self.name = self.__class__.__name__
self.version = "1.0.0"
self._component_requests: List[str] = []
+ self._setup_complete = False
def setup_ui(self) -> None:
pass
diff --git a/plugins/example_plugin.py b/plugins/example_plugin.py
index 9ab36ec..874d97c 100644
--- a/plugins/example_plugin.py
+++ b/plugins/example_plugin.py
@@ -7,6 +7,11 @@ class ExamplePlugin(WAN2GPPlugin):
super().__init__()
self.name = "Example Plugin"
self.version = "1.0.1"
+ self.add_tab(
+ tab_id="example_plugin_tab",
+ label="Example Plugin",
+ component_constructor=self.create_hello_world_tab
+ )
def create_hello_world_tab(self):
with gr.Blocks() as demo:
@@ -21,11 +26,4 @@ class ExamplePlugin(WAN2GPPlugin):
inputs=[name],
outputs=output
)
- return demo
-
- def setup_ui(self) -> None:
- self.add_tab(
- tab_id="example_plugin_tab",
- label="Example Plugin",
- component_constructor=self.create_hello_world_tab
- )
\ No newline at end of file
+ return demo
\ No newline at end of file
diff --git a/plugins/lora_setter_plugin.py b/plugins/lora_setter_plugin.py
index ce901c9..d7a57d4 100644
--- a/plugins/lora_setter_plugin.py
+++ b/plugins/lora_setter_plugin.py
@@ -14,7 +14,4 @@ class LoraSetterPlugin(WAN2GPPlugin):
self.loras_multipliers: gr.Textbox(value="test")
}
- return {}
-
- def setup_ui(self) -> None:
- pass
\ No newline at end of file
+ return {}
\ No newline at end of file