Ernie Prompt Enhancer Prompt
It doesn't enhance your prompt — it builds the envelope for a model that does
- enhanced_prompt
Let's get the honest name out of the way: Ernie Prompt Enhancer Prompt does not enhance anything. It formats. What it formats is the exact chat template that the Ernie Prompt Enhancer model expects, so that when you pipe the output through an LLM, you get back a properly expanded image prompt. Confusingly, this is not the same thing as the "prompt enhancer" that's baked into ERNIE-Image (that one's a separate light LM you toggle with use_pe). This is the standalone Ernie Prompt Enhancer - a fine-tuned Ministral-3B model that Baidu released to expand short image descriptions.
So why bother with a node that just wraps text? Because the template is genuinely fiddly and the wrapper hides all of it.
How it works
Sage Utils takes your prompt, plus a target width and height, and wraps them in the model's full prompt structure: a Chinese system prompt telling the model it's a professional text-to-image prompt enhancer, followed by a JSON payload with prompt, width, and height. The width and height aren't decoration - the model uses them to tailor the description to your target resolution. The output is one long enhanced_prompt string, ready to be fed into an LLM.
The important part: this node produces the input to the LLM, not the result. You still need to actually run that string through a language model. The node's own description suggests two ways: Sage's LLM nodes in "Native" mode with a CLIP loaded for Ernie's prompt enhancer, or ComfyUI core's TextGenerate node, which runs GGUF LLMs locally. Feed enhanced_prompt into whichever you use.
The inputs that matter
There are only three, all required:
prompt- your terse starting description. This is what the enhancer expands, so "woman in a garden at dusk" is fine; save the prose for the model.width/height- target generation resolution (default 1024×1024). The enhancer reads these and writes the description accordingly.
The single output, enhanced_prompt, is a plain STRING that wires straight into your LLM or TextGenerate node.
Installing and running it
The node ships in the Sage Utils pack, so the install is the pack's install:
cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils
pip install -r requirements.txt
…or just search "Sage Utils" in ComfyUI Manager and restart. The real work is the model itself - you need the Ernie Prompt Enhancer weights (as a GGUF that ComfyUI can load as a CLIP). The node will happily produce a template without it; nothing useful happens until the LLM is actually there.
Where people get burned
The classic failure mode is treating this node's output as the final prompt and pasting it straight into a KSampler's CLIP Text Encode. You'll get one long, baffling string of template syntax in your image. Remember the two-step nature: build the template here, then let the LLM do the enhancement. Also note the output is baked for a specific resolution - if you change the image size in the sampler but leave the width/height here alone, the enhancer is describing the wrong target. Sage Utils is a big, actively-maintained pack, so this node is genuinely the easiest way to bolt the Ernie enhancer onto a ComfyUI workflow - just don't expect it to do the thinking for you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | The base prompt to enhance for Ernie. | |
| width | INT | 10241–8192 | The target image width used by the Ernie prompt. |
| height | INT | 10241–8192 | The target image height used by the Ernie prompt. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| enhanced_prompt | STRING | The enhanced prompt generated for the Ernie model. |