This commit introduces a new ComfyUI custom node that splits natural language prompts into separate SDXL (image) and WAN (video) prompts using Ollama. ## Features - Splits combined prompts into image and video components - Preserves LoRA tags (<lora:name:strength>) and WanLoRA tags (<wanlora:name:strength>) - Uses local Ollama models with configurable model selection - Automatic model downloading if not available locally - Comprehensive test coverage with mocked dependencies ## Files Added - nodes/prompt_splitter_node.py: Main node implementation - nodes/ollama_utils.py: Shared Ollama API utilities - nodes/logging_utils.py: Centralized logging with custom prefix - tests/test_prompt_splitter.py: Comprehensive test suite ## Dependencies - Uses requests library (gracefully handles absence) - Requires local Ollama installation for functionality - Compatible with existing ComfyUI custom node architecture ## Usage The node appears in ComfyUI as 'Prompt Splitter' under the conditioning category. Input a combined prompt and receive separate optimized prompts for SDXL and WAN. Closes: #XX (if applicable) Co-authored-by: Assistant
27 lines
815 B
Python
27 lines
815 B
Python
try:
|
|
from .nodes.lora_visualizer_node import LoRAVisualizerNode
|
|
from .nodes.prompt_splitter_node import PromptSplitterNode
|
|
except ImportError:
|
|
# Fallback for when this module is imported directly (e.g., during testing)
|
|
import sys
|
|
import os
|
|
|
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
sys.path.insert(0, current_dir)
|
|
from nodes.lora_visualizer_node import LoRAVisualizerNode
|
|
from nodes.prompt_splitter_node import PromptSplitterNode
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"LoRAVisualizer": LoRAVisualizerNode,
|
|
"PromptSplitter": PromptSplitterNode,
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"LoRAVisualizer": "LoRA Visualizer",
|
|
"PromptSplitter": "Prompt Splitter",
|
|
}
|
|
|
|
WEB_DIRECTORY = "./js"
|
|
|
|
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
|