Eric ERNIE-Image Generate
Two checkpoints, one node, zero guesswork
- pipeline
- prompt_embeds
- negative_prompt_embeds
- image
This is the node you'll actually live in if you're generating ERNIE-Image in ComfyUI. Load Model gets the pipeline ready, Encode pre-computes embeddings if you want, but Eric ERNIE-Image Generate is where the image happens - and its defaults are chosen to match the two ERNIE checkpoints exactly, so you don't have to remember which knobs belong to which model.
The big split is between the two Baidu releases, and the node's tooltips just tell you the answer. ERNIE-Image (SFT): 50 steps, guidance_scale 4.0, stronger prompt following, higher general quality. ERNIE-Image-Turbo: 8 steps, guidance_scale 1.0 - it's DMD + RL distilled, so at CFG 1 guidance is effectively off and generation runs as a single pass. Both live behind the same loader; you just point at a different model_path and adjust these two fields.
The inputs that matter
- resolution - 20 aspect-ratio presets, of which the seven marked ★ are the official ERNIE training resolutions (~1 MP each). Stay at the presets. The DiT's 2D RoPE positional encoding goes out of distribution above ~1.5 MP and you get repetition artifacts - the KB documents ERNIE "mangling bodies" harder than Z-Image at high res, which is the model's fault, not yours.
- steps / guidance_scale - 50 / 4.0 for SFT, 8 / 1.0 for Turbo. Setting CFG 7 on Turbo doesn't add prompt adherence; it applies the correction twice and burns the image at double the render time.
- prompt - and here's the counterintuitive bit for SD1.5 brains: write long, detailed prompts. All of Baidu's official gallery images used PE-expanded 200+ word descriptions. ERNIE wants lighting, materials, camera, atmosphere - not "a girl" plus tags.
- sigma_schedule - the pack's interesting knob. Flow-matching schedulers have a
shiftthat controls how denoising effort splits between composition (structure) and detail. The defaultuniformjust passeslinspace(1.0, 0.0, N+1)to the scheduler and is what Baidu's own pipeline does - start there.fixed shiftforces the shift from the scheduler config (4.0), which pushes 64% of steps above sigma=0.7 into the structural phase;karrasandbetaadd different step redistribution;dynamicmakes shift resolution-dependent. You can switch schedules without reloading the model, so it's cheap to A/B. - negative_prompt - only does anything on SFT (CFG > 1). On Turbo at CFG 1 there's no unconditional pass, so the field is ignored. That's by design.
Two quality toggles are worth leaving on: vae_decode_fp32 (upcasts the VAE for decode - the tooltip's claim of "significant quality win" for a tiny speed cost checks out) and guidance_rescale (0.5–0.7 rescales CFG output toward unit variance to fight saturation if you're running high CFG on SFT).
Optional width/height are only used when resolution = custom, and max_mp caps whatever you feed in before the 16-px alignment. Keep max_mp at 1.0–1.5 for the reason above.
The embedding path
prompt_embeds and negative_prompt_embeds accept output from the pack's ErnieImageEncode node. When prompt_embeds is connected, the prompt text input is ignored and the text encoder is skipped entirely - encode once, then run N seeds with identical conditioning. If you connect prompt_embeds but no negative, the node auto-encodes an empty string for the CFG path. Good for A/B testing SFT vs Turbo with the same conditioning.
Wiring and install
Output is a standard IMAGE, straight into PreviewImage or SaveImage. Install once for the whole pack: Manager search "Eric ERNIE-Image", or git clone https://github.com/EricRollei/Ernie_Image_Real_Diffusers into custom_nodes, restart, and download a checkpoint from HuggingFace. Requires diffusers with ErnieImagePipeline support (pip install git+https://github.com/huggingface/diffusers if yours is old).
Common issues
- "Negative prompt does nothing" - not a bug; you're on Turbo at CFG 1.
- Grid / noise patterns in output - a documented property of the model, not your workflow. The community consensus is that this is ERNIE's signature defect, not something this node can fix.
- Blurry detail at high res - you're above the ~1.5 MP training ceiling. Drop back to a preset, or look at the pack's UltraGen node, which works around the ceiling in latent space.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| pipeline | ERNIE_PIPELINE | — | |
| prompt | STRING | Ignored when prompt_embeds is connected. | |
| resolution | COMBO | 1024x1024 (1:1) | 20 options: 3:1 panoramic, 21:9 cinemascope, 2:1 wide, 16:9 ★, 8:5, 3:2 ★, +14 |
| steps | INT | 501–100 | 50 for SFT, 8 for Turbo. |
| guidance_scale | FLOAT | 4.00–20 | 4.0 for SFT, 1.0 for Turbo. |
| seed | INT | 00–18446744073709550000 | — |
| use_pe | BOOLEAN | false | Requires load_pe=True in loader. |
| sigma_schedule | COMBO | uniform | 'uniform' = pipeline default (shift=4.0 from scheduler config). 'fixed shift' = override shift to shift_value below. 'karras' = shift + karras transform (more steps at both extremes). 'beta' = shift + beta distribution (good balance for fine detail). 'dynamic' = resolution-based shift. Change without reloading. |
| shift_value | FLOAT | 4.00.1–8 | Override scheduler shift for 'fixed shift', 'karras', 'beta' schedules. 1.0 = truly uniform (no shift bias). 4.0 = default (strong structural emphasis). Ignored when schedule = 'uniform' or 'dynamic'. |
| max_mp | FLOAT | 1.500.25–8 | Stay at 1.0-1.5 MP. ERNIE trained on 7 ~1MP presets. |
| guidance_rescale | FLOAT | 0.000–1 | Rescale CFG output toward unit variance to reduce saturation. 0.0 = off. 0.5-0.7 = moderate rescaling. Helps preserve fine detail at high guidance_scale. |
| vae_decode_fp32 | BOOLEAN | true | Upcast VAE to float32 for decode. Prevents bf16/fp16 quantization of fine textures. Tiny speed cost, significant quality win. |
| widthopt | INT | 1024256–8192 | Used only when resolution = 'custom'. |
| heightopt | INT | 1024256–8192 | Used only when resolution = 'custom'. |
| negative_promptopt | STRING | — | |
| prompt_embedsopt | ERNIE_EMBEDS | Pre-computed embeddings from ErnieImageEncode. When connected, the prompt text input is ignored. Enables reuse across seeds without re-running the text encoder. | |
| negative_prompt_embedsopt | ERNIE_EMBEDS | Pre-computed negative embeddings from ErnieImageEncode. When connected, negative_prompt text is ignored. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |