mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 05:32:12 -03:00
Update prompt configuration and enhance Lora management functionality
- Expanded the prompt.json file with new configurations for KSampler, CheckpointLoaderSimple, and various CLIPTextEncode nodes. - Introduced additional Lora management features, including a new Lora Stacker and improved trigger word handling. - Enhanced the loras_widget.js to log the generated prompt when saving recipes directly, aiding in debugging and user feedback. - Improved overall structure and organization of the prompt configurations for better maintainability.
This commit is contained in:
43
py/workflow_params/extensions/custom_node_example.py
Normal file
43
py/workflow_params/extensions/custom_node_example.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""
|
||||
Example of how to extend the workflow parser with custom node processors
|
||||
This file is not imported automatically - it serves as a template for creating extensions
|
||||
"""
|
||||
|
||||
from typing import Dict, Any
|
||||
from ..node_processors import NodeProcessor, register_processor
|
||||
|
||||
@register_processor
|
||||
class CustomNodeProcessor(NodeProcessor):
|
||||
"""Example processor for a custom node type"""
|
||||
|
||||
NODE_CLASS_TYPE = "CustomNodeType"
|
||||
REQUIRED_FIELDS = {"custom_field1", "custom_field2"}
|
||||
|
||||
def process(self, workflow_parser) -> Dict[str, Any]:
|
||||
"""Process a custom node"""
|
||||
# Example implementation
|
||||
result = {}
|
||||
|
||||
# Extract direct values
|
||||
if "custom_field1" in self.inputs:
|
||||
result["custom_value1"] = self.inputs["custom_field1"]
|
||||
|
||||
# Resolve references to other nodes
|
||||
if "custom_field2" in self.inputs:
|
||||
resolved_value = self.resolve_input("custom_field2", workflow_parser)
|
||||
if resolved_value:
|
||||
result["custom_value2"] = resolved_value
|
||||
|
||||
return result
|
||||
|
||||
# To use this extension, you would need to:
|
||||
# 1. Save this file in the extensions directory
|
||||
# 2. Import it in your code before using the WorkflowParser
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# from workflow_params.extensions import custom_node_example
|
||||
# from workflow_params import WorkflowParser
|
||||
#
|
||||
# parser = WorkflowParser()
|
||||
# result = parser.parse_workflow(workflow_json)
|
||||
Reference in New Issue
Block a user