Files
Oliver SwitzerandAssistant 1dcde08f91 feat: add Prompt Splitter node for SDXL/WAN prompt generation
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
2025-08-11 09:01:16 -04:00

30 lines
780 B
Python

"""
Pytest configuration for LoRA Visualizer tests
"""
import sys
from unittest.mock import Mock
# Mock ComfyUI dependencies before any imports
def pytest_configure():
"""Configure pytest with necessary mocks"""
# Mock folder_paths
mock_folder_paths = Mock()
mock_folder_paths.get_folder_paths.return_value = ["/fake/loras/path"]
sys.modules["folder_paths"] = mock_folder_paths
# Mock server
mock_server = Mock()
mock_prompt_server = Mock()
mock_prompt_server.instance = Mock()
mock_prompt_server.instance.send_sync = Mock()
mock_server.PromptServer = mock_prompt_server
sys.modules["server"] = mock_server
# Mock aiohttp
sys.modules["aiohttp"] = Mock()
mock_web = Mock()
sys.modules["aiohttp.web"] = mock_web