π€ CYH Prompt Tools | Enhancer (Editable)
The LLM prompt enhancer without the file management
- enhanced_prompt
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 whetherPresets/exists and bails with "run Setup first" for non-custom providers. So run PromptToolsSetup once anyway, or usecustomfor 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A beautiful landscape | β |
| preprompt_template | STRING | You 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} | β |
| provider | COMBO | deepseek | 4 options: deepseek, openai, anthropic, custom |
| api_key_overrideopt | STRING | β | |
| temperatureopt | FLOAT | 0.700β1 | β |
| max_tokensopt | INT | 1000100β4000 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| enhanced_prompt | STRING | β |