mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: add Vue widget demo node and development support
- Add LoraManagerDemoNode to node mappings for Vue widget demonstration - Update .gitignore to exclude Vue widget development artifacts (node_modules, .vite, dist) - Implement automatic Vue widget build check in development mode with fallback handling - Maintain pytest compatibility with proper import error handling
This commit is contained in:
72
py/nodes/demo_vue_widget_node.py
Normal file
72
py/nodes/demo_vue_widget_node.py
Normal file
@@ -0,0 +1,72 @@
|
||||
"""
|
||||
Demo node to showcase Vue + PrimeVue widget integration in ComfyUI LoRA Manager.
|
||||
|
||||
This node demonstrates:
|
||||
- Vue 3 + PrimeVue custom widget
|
||||
- Widget state serialization
|
||||
- Integration with ComfyUI workflow
|
||||
"""
|
||||
|
||||
|
||||
class LoraManagerDemoNode:
|
||||
"""
|
||||
A demo node that uses a Vue + PrimeVue widget to configure LoRA parameters.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"lora_demo_widget": ("LORA_DEMO_WIDGET", {}),
|
||||
},
|
||||
"optional": {
|
||||
"text": ("STRING", {
|
||||
"default": "",
|
||||
"multiline": True,
|
||||
"placeholder": "Additional prompt text..."
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING", "FLOAT", "STRING")
|
||||
RETURN_NAMES = ("model_name", "strength", "info")
|
||||
|
||||
FUNCTION = "process"
|
||||
|
||||
CATEGORY = "loramanager/demo"
|
||||
|
||||
def process(self, lora_demo_widget, text=""):
|
||||
"""
|
||||
Process the widget data and return the configuration.
|
||||
|
||||
Args:
|
||||
lora_demo_widget: Widget data containing model_name and strength
|
||||
text: Optional text input
|
||||
|
||||
Returns:
|
||||
Tuple of (model_name, strength, info_string)
|
||||
"""
|
||||
model_name = lora_demo_widget.get("modelName", "")
|
||||
strength = lora_demo_widget.get("strength", 1.0)
|
||||
|
||||
info = f"Vue Widget Demo - Model: {model_name}, Strength: {strength}"
|
||||
if text:
|
||||
info += f"\nAdditional text: {text}"
|
||||
|
||||
print(f"[LoraManagerDemoNode] {info}")
|
||||
|
||||
return (model_name, strength, info)
|
||||
|
||||
|
||||
# Node class mappings for ComfyUI
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"LoraManagerDemoNode": LoraManagerDemoNode
|
||||
}
|
||||
|
||||
# Display name mappings
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"LoraManagerDemoNode": "LoRA Manager Demo (Vue)"
|
||||
}
|
||||
Reference in New Issue
Block a user