Prompt Enhancer (Native)<div style="font-size: 0.8em"><div id="Y7_shortdesc" style="margin-bottom: 15px;">Takes a basic prompt and enhances it using any generation-capable text encoder already loaded by ComfyUI</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Unlike the other Y7 prompt enhancers, this node downloads and loads nothing itself. It takes a <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">CLIP</code> input from a standard <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">CLIPLoader</code> and lets ComfyUI handle all model loading and VRAM management. Nothing stays resident that ComfyUI is not already managing.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Supported models:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">Gemma 4</code> - E2B, E4B, 31B and the 12B unified model. Also handles image, video and audio, though this node only sends text.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">Gemma 3</code> - the 12B model, including the LTX-2 text encoder built on it.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">Qwen3</code> - 0.6B, 2B, 4B and 8B.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">Qwen3.5</code> - 0.8B, 2B, 4B, 9B and 27B.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">Qwen3-VL</code> - 4B and 8B.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Not supported - these encoders have no text generation path and the node will say so rather than failing obscurely:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">T5</code> (all sizes), <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">UMT5</code>, <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">CLIP-L</code>, <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">CLIP-G</code>, <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">Gemma 2</code>, <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">LLaMA-3.1</code></div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Weights must be safetensors placed in <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">models/text_encoders/</code>. GGUF will not work: ComfyUI core cannot load GGUF at all, and for Gemma 4 the tokenizer is embedded inside the safetensors file itself. The <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">CLIPLoader</code> <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">type</code> dropdown is ignored for Gemma 4 - the model is detected from the weights, so any value works.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Inputs:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">clip</code>: A generation-capable text encoder from <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">CLIPLoader</code> - see the supported models above.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">text</code>: Your basic prompt to enhance. Accepts a connection from any string node.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">instruction</code>: The instruction placed before your text. Edit this to change the style of enhancement.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">max_length</code>: Maximum NEW tokens to generate (64-32768, default 2048). This is not the context window. Reasoning is spent from the same budget, and the KV cache reserves ~84KB of VRAM per token up front.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">temperature</code>: Controls randomness (0.0-2.0, default 1.0, Google's recommended value for Gemma). 0 switches to greedy decoding and ignores top_k/top_p.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">top_k</code>: Limits selection to the k most likely tokens (0-1000, default 64, Google's recommended value). 0 disables.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">top_p</code>: Nucleus sampling (0.0-1.0, default 0.95, Google's recommended value). 1.0 disables.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">seed</code>: Random seed. Change it to re-roll - identical inputs return a cached result.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">thinking</code>: Let the model reason before answering. Its reasoning is always separated out, never mixed into the prompt.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Outputs:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">thinking_output</code>: The model's reasoning, if it produced any</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">enhanced_prompt</code>: The enhanced prompt, with all reasoning removed</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">On reasoning:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Gemma 4 emits reasoning inside a thought channel, and ComfyUI's decoder deliberately keeps that text rather than discarding it. Setting <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">thinking</code> to False only primes the model to skip it - Gemma 4 frequently reasons anyway, which is why the core <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">Generate Text</code> node can return a wall of planning notes ahead of the actual prompt.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">This node always splits the two apart, including the awkward case where the model reasons past the primed channel and closes it with an orphan tag. If <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">enhanced_prompt</code> ever comes back empty, the model spent the whole <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">max_length</code> budget reasoning - raise it, or lower <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">temperature</code>.</div></div>
By yushan777·Created about a year ago·Updated 11 days ago· 7
Y7 Prompt Enhancer (Native)
clip
thinking_output
enhanced_prompt
◄text►
◄instructionRewrite the user's text into a single detailed image generation prompt.
- Keep every element the user asked for. Invent concrete visual detail where they were vague: lighting, materials, textures, setting, composition.
- Describe only what is visible. No smell, taste, sound or emotion.
- Output the prompt only. No preamble, no explanation, no markdown, no quotes.►
◄max_length2048►
◄temperature1.00►
◄top_k64►
◄top_p0.95►
◄seed0►
◄thinkingfalse►
CategoryY7Nodes/Prompt
Inputs (9)
Name
Type
Default
Description
clip
CLIP
A generation-capable text encoder loaded with CLIPLoader (Gemma 3/4, Qwen3, Qwen3-VL). T5/CLIP-L will not work.
text
STRING
The basic prompt to enhance.
instruction
STRING
Rewrite the user's text into a single detailed image generation prompt.
- Keep every element the user asked for. Invent concrete visual detail where they were vague: lighting, materials, textures, setting, composition.
- Describe only what is visible. No smell, taste, sound or emotion.
- Output the prompt only. No preamble, no explanation, no markdown, no quotes.
System-style instruction placed before the text.
max_length
INT
204864–32768
Maximum NEW tokens to generate (not the context window). Reasoning is spent from this same budget. Costs ~84KB of VRAM per token in KV cache, reserved up front.
temperature
FLOAT
1.000–2
1.0 is Google's recommended value for Gemma. 0 switches to greedy decoding, which ignores top_k/top_p entirely.
top_k
INT
640–1000
Keep only the k most likely tokens. 64 is Google's recommended value for Gemma. 0 disables the filter.
top_p
FLOAT
0.950–1
Nucleus sampling: keep the smallest set of tokens whose probabilities sum to p. 0.95 is Google's recommended value for Gemma. 1.0 disables the filter.
seed
INT
00–18446744073709550000
—
thinkingopt
BOOLEAN
false
Let the model reason first. Its reasoning goes to the thinking output, never the prompt output.