- The endpoint / model field is resolved as: an existing model folder, a folder name under models/VLM, or an explicit org/name id (local copy if present, otherwise - and only then - a download). A URL or any other value (a stray "1" from an old workflow asked Hugging Face for the repo "1") is ignored with a log line and a local model is auto-detected. With no local model the node stops with an error listing what is in models/VLM. - The model cache is keyed by the resolved folder, so the image pass and the text pass share one copy in VRAM instead of loading the same model twice. The Advanced video node's image pass uses the same model field as its text pass. - The system prompt is sent as a system turn; <think> blocks are removed from text answers. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VpCi6nw5UECMdZ7ayYJvN
141 lines
6.0 KiB
Python
141 lines
6.0 KiB
Python
"""
|
|
ComfyUI Nodes: Eric's Prompt Enhancers for ComfyUI
|
|
Description: A comprehensive suite of AI-powered prompt enhancement nodes for ComfyUI
|
|
using local LLMs (LM Studio or Ollama). Transform simple prompts into detailed,
|
|
platform-optimized descriptions for video and image generation.
|
|
|
|
Includes:
|
|
- Video Prompt Expander: Simple, preset-based video prompt expansion
|
|
- Video Prompt Expander (Advanced): Granular control over video aesthetics with 50+ controls
|
|
- Image-to-Video Prompt Expander: Vision model analyzes image + motion expansion
|
|
- Image-to-Image Prompt Expander: Platform-aware img2img prompt generation (5 platforms)
|
|
- Text-to-Image Prompt Enhancer: Advanced multi-platform image prompt generation (8 platforms)
|
|
- Alice T2V Prompt Refiner: Structures prompts specifically for the Alice T2V 14B MoE model
|
|
|
|
Features:
|
|
- 8 image platforms: Flux, SDXL, Pony Diffusion, Illustrious XL, Chroma, Qwen Image/Edit, Wan Image
|
|
- Multiple expansion tiers: Auto, Basic, Enhanced, Advanced, Cinematic
|
|
- Style presets: Cinematic, Surreal, Action, Stylized, Noir, Random
|
|
- Advanced controls: Camera, lighting, weather, time of day, composition, genre, framing, pose
|
|
- Reference image support with visual analysis
|
|
- Wildcard random options for variety
|
|
- Platform-specific token optimization
|
|
- Emphasis syntax: (keyword:1.5)
|
|
- Alternation syntax: {option1|option2|option3}
|
|
- LoRA trigger and keyword integration
|
|
- File export with metadata
|
|
|
|
Author: Eric Hiss (GitHub: EricRollei)
|
|
Contact: [eric@historic.camera, eric@rollei.us]
|
|
Version: 2.0.1
|
|
Date: September 2026
|
|
License: Dual License (Non-Commercial and Commercial Use)
|
|
Copyright (c) 2025 Eric Hiss. All rights reserved.
|
|
|
|
Dual License:
|
|
1. Non-Commercial Use: This software is licensed under the terms of the
|
|
Creative Commons Attribution-NonCommercial 4.0 International License.
|
|
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/
|
|
|
|
2. Commercial Use: For commercial use, a separate license is required.
|
|
Please contact Eric Hiss at [eric@historic.camera, eric@rollei.us] for licensing options.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
Dependencies and Credits:
|
|
- Python 3.8+ (https://www.python.org/) - PSF License
|
|
- PyTorch (https://pytorch.org/) - BSD-style License
|
|
- NumPy (https://numpy.org/) - BSD License
|
|
- Pillow/PIL (https://python-pillow.org/) - HPND License
|
|
- requests (https://requests.readthedocs.io/) - Apache 2.0 License
|
|
- ComfyUI (https://github.com/comfyanonymous/ComfyUI) - GPL-3.0 License
|
|
- LM Studio (https://lmstudio.ai/) - Proprietary (Optional)
|
|
- Ollama (https://ollama.ai/) - MIT License (Optional)
|
|
|
|
Platform Knowledge Credits:
|
|
- Flux by Black Forest Labs
|
|
- SDXL by Stability AI
|
|
- Pony Diffusion by Astralite
|
|
- Illustrious XL by OnomaAI Research
|
|
- Chroma by lodestones
|
|
- Qwen by Alibaba Cloud
|
|
- Wan by Alibaba (Wan team / Tongyi Lab)
|
|
- Alice T2V by Mirage (gomirageai)
|
|
"""
|
|
|
|
from .prompt_expander_node import AIVideoPromptExpander
|
|
from .prompt_expander_node_advanced import AIVideoPromptExpanderAdvanced
|
|
from .image_to_video_node import ImageToVideoPromptExpander
|
|
from .image_to_image_node import ImageToImagePromptExpander
|
|
from .text_to_image_node import TextToImagePromptEnhancer
|
|
from .alice_prompter_node import AlicePromptRefiner
|
|
|
|
# Prompt Database nodes
|
|
from .save_prompt_node import SavePromptToDatabase
|
|
from .search_prompt_node import SearchPromptDatabase
|
|
from .import_prompts_node import ImportPromptsToDatabase
|
|
from .browse_prompt_node import BrowsePromptDatabase
|
|
|
|
# Ideogram 4 nodes
|
|
from .ideogram_magic_node import IdeogramMagicPrompt
|
|
|
|
# Wildcard engine (core/wildcards) and variability engine (core/variability)
|
|
from .wildcard_processor_node import WildcardProcessor
|
|
from .semantic_variation_node import SemanticVariation
|
|
from .concept_survival_node import ConceptSurvivalCheck
|
|
|
|
# Platform profiles (core/profiles + profiles/*.yaml)
|
|
from .platform_rewriter_node import PlatformPromptRewriter
|
|
|
|
# Node class mappings for ComfyUI
|
|
NODE_CLASS_MAPPINGS = {
|
|
"EricVideoPromptExpander": AIVideoPromptExpander,
|
|
"EricVideoPromptExpanderAdvanced": AIVideoPromptExpanderAdvanced,
|
|
"EricImageToVideoPromptExpander": ImageToVideoPromptExpander,
|
|
"EricImageToImagePromptExpander": ImageToImagePromptExpander,
|
|
"EricTextToImagePromptEnhancer": TextToImagePromptEnhancer,
|
|
"EricAlicePromptRefiner": AlicePromptRefiner,
|
|
# Database nodes
|
|
"EricSavePromptToDB": SavePromptToDatabase,
|
|
"EricSearchPromptDB": SearchPromptDatabase,
|
|
"EricImportPromptsToDB": ImportPromptsToDatabase,
|
|
"EricBrowsePromptDB": BrowsePromptDatabase,
|
|
# Ideogram 4
|
|
"EricIdeogramMagicPrompt": IdeogramMagicPrompt,
|
|
# Wildcards
|
|
"EricWildcardProcessor": WildcardProcessor,
|
|
"EricSemanticVariation": SemanticVariation,
|
|
"EricConceptSurvivalCheck": ConceptSurvivalCheck,
|
|
# Platform profiles
|
|
"EricPlatformPromptRewriter": PlatformPromptRewriter,
|
|
}
|
|
|
|
# Display names in ComfyUI
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"EricVideoPromptExpander": "Video Prompt Expander",
|
|
"EricVideoPromptExpanderAdvanced": "Video Prompt Expander (Advanced)",
|
|
"EricImageToVideoPromptExpander": "Image-to-Video Prompt Expander",
|
|
"EricImageToImagePromptExpander": "Image-to-Image Prompt Expander",
|
|
"EricTextToImagePromptEnhancer": "Text-to-Image Prompt Enhancer",
|
|
"EricAlicePromptRefiner": "Alice T2V Prompt Refiner",
|
|
# Database nodes
|
|
"EricSavePromptToDB": "Save Prompt to DB",
|
|
"EricSearchPromptDB": "Search Prompt DB",
|
|
"EricImportPromptsToDB": "Import Prompts to DB",
|
|
"EricBrowsePromptDB": "Browse / Random Prompt DB",
|
|
# Ideogram 4
|
|
"EricIdeogramMagicPrompt": "Ideogram 4 Magic Prompt",
|
|
# Wildcards
|
|
"EricWildcardProcessor": "Wildcard Processor",
|
|
"EricSemanticVariation": "Semantic Variation",
|
|
"EricConceptSurvivalCheck": "Concept Survival Check",
|
|
# Platform profiles
|
|
"EricPlatformPromptRewriter": "Platform Prompt Rewriter",
|
|
}
|
|
|
|
WEB_DIRECTORY = "./web"
|
|
|
|
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', 'WEB_DIRECTORY']
|