Files
EricRollei-Local_LLM_Prompt…/__init__.py
T
Eric HissandClaude Fable 5.1 df90d119b4 V2.1.0: surreal engine - generator / critic procedure, Surreal Premise node
- core/strategies/surreal: eight generator modes taken from how Magritte,
  Ernst, Dali, Varo, Uelsmann, Atget and Man Ray worked, feeding one critic
  (seeded code, or one LLM call). One anomaly stated as plain physical fact
  against a credible world, chosen for affinity rather than distance; count
  capped at 2. Output: brief, instruction block, why trace, title,
  counter-terms.
- Surreal Premise node; plugs into every enhancer's wildcard_instructions.
  Anomaly survival is measurable with the Concept Survival Check.
- The surreal preset (video nodes) and genre_style = surreal (Text-to-Image)
  route through the engine instead of style words; fail-soft to the old text.
- Lists in wildcards/surreal, personal iconography.yaml template,
  docs/SURREAL_GUIDE.md, dev/verify_surreal.py (78 checks).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VpCi6nw5UECMdZ7ayYJvN
2026-09-21 14:23:50 -07:00

144 lines
6.2 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.1.0
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
from .surreal_node import SurrealPremise
# 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,
"EricSurrealPremise": SurrealPremise,
# 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",
"EricSurrealPremise": "Surreal Premise",
# Platform profiles
"EricPlatformPromptRewriter": "Platform Prompt Rewriter",
}
WEB_DIRECTORY = "./web"
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', 'WEB_DIRECTORY']