Nodes/Chye ComfyUI Toolset/πŸ”€ CYH Prompt Tools | Enhancer (Editable)
ComfyUI Node

πŸ”€ CYH Prompt Tools | Enhancer (Editable)

The LLM prompt enhancer without the file management

By chyerΒ·Created about a year agoΒ·Updated 6 months agoΒ· 1
πŸ”€ CYH Prompt Tools | Enhancer (Editable)
    • enhanced_prompt
    β—„promptA beautiful landscapeβ–Ί
    β—„preprompt_templateYou are a professional photography prompt engineer. Enhance image generation prompts with: Technical Excellence: - Professional camera settings (aperture, shutter speed, ISO) - Lighting conditions and quality (golden hour, studio lighting, natural light) - Composition techniques (rule of thirds, leading lines, framing) Artistic Quality: - Professional photography terminology - Realistic details and textures - Mood and atmosphere descriptors Enhance this prompt while maintaining its core meaning: {prompt}β–Ί
    β—„providerdeepseekβ–Ί
    β—„api_key_overrideβ–Ί
    β—„temperature0.70β–Ί
    β—„max_tokens1000β–Ί

    The pack's other enhancer (PromptEnhancer) pulls its instruction template from a file on disk. This one puts the template right in the node as an editable text field - same LLM backends, same API-key handling, but no file editing, no custom_template_path, no "which file did I write it to" mental overhead. It's the version you reach for when you want to iterate on the template itself inside ComfyUI.

    It's the sibling node in the Chye ComfyUI Toolset's prompt_tools family. Same family, same dependencies, different ergonomics.

    How it works

    Identical plumbing to PromptEnhancer: the node takes your prompt, wraps it in the template, and calls the selected provider's chat API (deepseek/openai/anthropic) - or, on custom, just does the template fill locally with no API call. The only real differences are in the inputs.

    The inputs that matter

    • prompt - your raw prompt (multiline).
    • preprompt_template - the editable instruction block. The default is a solid photography prompt-engineering template (camera settings, lighting, composition, mood), and it must contain {prompt} - the node validates for it and returns a clear error if you delete it. This is the input you'll actually be editing.
    • provider - deepseek/openai/anthropic/custom.
    • api_key_override - skip the key-file lookup for a one-off.
    • temperature (default 0.7) and max_tokens (default 1000).

    Output: enhanced_prompt (STRING), straight into your text encoder.

    The differences that matter

    File-based vs. editable is the whole trade:

    • No Setup node requirement for the template - the editable template means the node works the moment the pack loads, unlike PromptEnhancer which needs Presets/Preprompts/ populated.
    • You still need an API key file unless you use custom. The node checks whether Presets/ exists and bails with "run Setup first" for non-custom providers. So run PromptToolsSetup once anyway, or use custom for pure-local template fills.
    • Templates don't persist as reusable files. Change the template here and it lives in the workflow JSON, not in a library you can reuse across projects. That's the actual reason to pick one version over the other: reuse (file-based) vs. quick iteration (editable).

    The gotcha

    The default template is good but long - it eats into your max_tokens if you ask for a big expansion. If output gets cut off, raise max_tokens (up to 4000) rather than assuming something broke. And remember the hardcoded model names (gpt-4-turbo-preview, claude-3-sonnet) apply here too - the wrappers don't use whatever's newest.

    Install

    ComfyUI Manager (search "Chye ComfyUI Toolset"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chyer/Chye-ComfyUI-Toolset
    cd Chye-ComfyUI-Toolset
    pip install -r requirements.txt
    

    Restart after. Needs requests for API calls. Zip installs need .git/.cnr-id (Chye-ComfyUI-Toolset) per the README.

    Verdict

    If you're experimenting with how prompt templates affect output, this is the better half of the pair - no file round-trips, just edit and re-run. If you've settled on a template you want everywhere, the file-based sibling is the one that scales. Both work; pick by how you like to manage your templates.

    Categoryprompt_tools

    Inputs (6)

    NameTypeDefaultDescription
    promptSTRINGA beautiful landscapeβ€”
    preprompt_templateSTRINGYou are a professional photography prompt engineer. Enhance image generation prompts with: Technical Excellence: - Professional camera settings (aperture, shutter speed, ISO) - Lighting conditions and quality (golden hour, studio lighting, natural light) - Composition techniques (rule of thirds, leading lines, framing) Artistic Quality: - Professional photography terminology - Realistic details and textures - Mood and atmosphere descriptors Enhance this prompt while maintaining its core meaning: {prompt}β€”
    providerCOMBOdeepseek4 options: deepseek, openai, anthropic, custom
    api_key_overrideoptSTRINGβ€”
    temperatureoptFLOAT0.700–1β€”
    max_tokensoptINT1000100–4000β€”

    Outputs (1)

    NameTypeDescription
    enhanced_promptSTRINGβ€”