DiffSynth: ERNIE Image Inference
ERNIE Image Inference — layout and text, if you can live with the grid
- pipe
- image
This node is the reason to install the pack's ERNIE pipeline at all: text-to-image with real structure. ERNIE-Image is the model that will put "OPEN" on the sign, put the sign in the right place, and put the person standing under it rather than floating next to it. It is not the model that wins a photorealism contest, and it never became the model of the month - a two-week spike, then 183 threads in April down to 78 by June.
Required: pipe (from the ERNIE Loader), prompt, seed, num_inference_steps (default 50), height, width (1024). One output: image → Save Image.
Just three optional sockets, all worth knowing
cfg_scale- default 4. On the SFT base that's right. On ERNIE-Image-Turbo it is wrong in the specific way that 2026 models punish: Turbo is guidance-distilled, guidance is baked into the weights, and CFG 1 is the intended setting. The template runs 8 steps at CFG 1. Push CFG to 4 there and you don't get more adherence, you get an overcooked image and roughly double the render time, because you've forced the unconditional pass back on.negative_prompt- live at CFG 4 on the base, inert at CFG 1 on Turbo. If you need a constraint to hold on Turbo, write it into the positive prompt as a presence: "clean seamless backdrop, sharp focus" instead of a list of things you don't want.sigma_shift- default 3, a flow-matching schedule shift. The Turbo template runs 4. It's a fine-grained knob; change it one notch at a time and only after you have a baseline.
Settings, honestly
Base: 50 steps at CFG 4 is the recommended configuration, and 1024×1024 is native - going higher doesn't sharpen anything, it just gives the model more room to fall apart. Turbo: 8 steps at CFG 1, which is a fraction of the wall clock and the reason anyone bothers with the Turbo repo at all. Prompts want natural language; Baidu shipped an optional prompt enhancer and you can approximate it by simply being specific about layout - where things are, what's in the foreground, which direction the light comes from. Keep it under a hundred-odd tokens of real content instead of a paragraph of style adjectives.
Install
# Manager: search "DiffSynth-ComfyUI" → Install → restart
pip install git+https://github.com/modelscope/DiffSynth-Studio.git
cd ComfyUI/custom_nodes && git clone https://github.com/modelscope/DiffSynth-ComfyUI.git
Template tab → DiffSynth ERNIE workflow gives you both the base and Turbo variants pre-wired, which is the fastest way to see the difference in 8 steps versus 50. Downloaded weights land on first execute, from ModelScope unless a ModelConfig says otherwise.
Troubleshooting
Grid artifacts are the known defect - visible in most generations, and if you see them everywhere, that's the model talking, not your sampler. If a Turbo run looks washed out and over-contrasty, your cfg_scale is above 1. If the loader complains about a missing text encoder on a Turbo setup, you probably swapped the whole ModelConfig set to the Turbo repo instead of just the transformer. And memory: Baidu's number is 24GB for the base checkpoint; the pack's quantization config and CPU offload are how you land under it, so wire the VRAM Config node before you assume it won't run.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | DIFFSYNTH_PIPE | — | |
| prompt | STRING | — | |
| seed | INT | 00–4294967295 | — |
| num_inference_steps | INT | 501–200 | — |
| height | INT | 102464–4096 | — |
| width | INT | 102464–4096 | — |
| negative_promptopt | STRING | — | |
| cfg_scaleopt | FLOAT | 4.00–10000 | — |
| sigma_shiftopt | FLOAT | 3.00–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |