mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
- Improved reference handling in NodeMapper to support integer node IDs and added error logging for reference processing failures. - Updated LoraLoaderMapper and LoraStackerMapper to handle lora_stack as a dictionary, ensuring compatibility with new data formats. - Refactored trace_model_path utility to perform a depth-first search for LoRA nodes, improving the accuracy of model path tracing. - Cleaned up unused code in parser.py related to LoRA processing, streamlining the workflow parsing logic.
25 lines
649 B
Python
25 lines
649 B
Python
import json
|
|
from py.workflow.parser import WorkflowParser
|
|
|
|
# Load workflow data
|
|
with open('refs/prompt.json', 'r') as f:
|
|
workflow_data = json.load(f)
|
|
|
|
# Parse workflow
|
|
parser = WorkflowParser()
|
|
try:
|
|
# Parse the workflow
|
|
result = parser.parse_workflow(workflow_data)
|
|
print("Parsing successful!")
|
|
|
|
# Print each component separately
|
|
print("\nGeneration Parameters:")
|
|
for k, v in result.get("gen_params", {}).items():
|
|
print(f" {k}: {v}")
|
|
|
|
print("\nLoRAs:")
|
|
print(result.get("loras", ""))
|
|
except Exception as e:
|
|
print(f"Error parsing workflow: {e}")
|
|
import traceback
|
|
traceback.print_exc() |