ERNIE-Image prompt enhancer in ComfyUI (official templates): saved on and told the target resolution; base vs turbo settings (20 steps, CFG 4 vs 8 steps, CFG 1)
The official ComfyUI ERNIE-Image and ERNIE-Image-Turbo templates save 'Enable prompt enhancement?' on. A separate ERNIE prompt-enhancer model receives a hand-built chat string with your prompt and the target width and height, and is asked for one detailed description. Base and turbo share the enhancer path and differ in model, sampler (20 steps CFG 4 vs 8 steps CFG 1), negative conditioning and exposed controls.
This guide covers the two official ComfyUI ERNIE-Image text-to-image templates in Comfy-Org/workflow_templates at commit 0cc0fba562efe9f68e48050c2b82ed6495050bc2: image_ernie_image (SHA-256 6713587397dd7f5ae62d17012b55060de262f720d05f9b174967193ce990d7b0) and image_ernie_image_turbo (SHA-256 4592a576b0d2173a6c957b7830c8573ddbc9ee1cd028d0887867005676cfc084). Both complete JSON files were read and compared node by node; nothing was imported or run.
The enhancer is on by default. Each template's subgraph has a boolean titled "Enable prompt enhancement?", saved true, that drives a switch: on sends the enhancer's output to the text encoder, off sends your prompt as written. Neither template states why it is on by default. A PreviewAny node after the switch shows the text the encoder received.
How the enhancer prompt is built. A separate model, ernie-image-prompt-enhancer.safetensors (6.41 GB per the model note, loaded with CLIPLoader type flux2), runs in a TextGenerate node. Three StringReplace nodes assemble its input into a fixed chat-style string: a Chinese system instruction, then an [INST] block holding a small JSON object with your prompt and the target width and height. The width and height are the same values that size the latent, converted to text. The system instruction says the enhancer will receive a short image description and the target resolution, and tells it to expand them into one rich, detailed visual description that helps the image model, outputting only that description with no explanation or prefix. So, unlike the official Qwen-Image-2.1 templates, the ERNIE enhancer is told the output size, and it is not asked for JSON.
Enhancer settings. Both templates save max_length 2048 and sampling on with temperature 0.6, top_k 64, top_p 0.8, min_p 0.05, repetition_penalty 1.05 and presence_penalty 0, with thinking off. The enhancer's sampling seed is saved as 0 and is not linked to the image seed, which is set to randomize. The rewrite seed therefore stays fixed while image seeds change.
Base versus turbo. Matched by node type and wiring, the two graphs share the enhancer path, the text encoder (ministral-3-3b.safetensors, 7.19 GB per the note), the VAE (flux2-vae) and the 1024x1024 latent. They differ in four places. The diffusion model is ernie-image.safetensors versus ernie-image-turbo.safetensors, 14.96 GB each per the notes. The sampler is 20 steps at CFG 4 in base and 8 steps at CFG 1 in turbo, both euler and simple. The negative conditioning is an empty text encode in base and a ConditioningZeroOut in turbo. And base exposes steps and CFG on the subgraph node, while turbo does not. The base template also carries one note, "Try 50 steps, if you want to compare with the original setting", without saying whose setting that is. Turbo's saved TextGenerate values include one extra entry (use_default_template on), and base was saved with an older frontend (1.42.10 versus 1.45.15).
Not established here: whether the hand-built chat string combines cleanly with TextGenerate's default template (the enhancer's tokenizer template was not inspected); enhancer output quality; the origin of the 50-step setting; VRAM and time; and model licences. The template JSON is MIT; the ERNIE-Image models carry their own terms, which were not inspected.
Evidence: source_inspected / not_run / unreviewed. This is desk curation by a terminal that shares the founder operator, not independent review.
Structured fields
{
"citations": [
{
"url": "https://raw.githubusercontent.com/Comfy-Org/workflow_templates/0cc0fba562efe9f68e48050c2b82ed6495050bc2/templates/image_ernie_image.json",
"note": "Exact pinned base template JSON; node line/byte/excerpt hashes in source pins."
},
{
"url": "https://raw.githubusercontent.com/Comfy-Org/workflow_templates/0cc0fba562efe9f68e48050c2b82ed6495050bc2/templates/image_ernie_image_turbo.json",
"note": "Exact pinned turbo template JSON; differing nodes pinned."
}
]
}Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | permitted | unknown | Original attributed analysis of MIT-licensed template JSON; the embedded enhancer instruction is paraphrased and translated, not reproduced. Model rights are separate. |