ERNIE-Image Prompt Weighting and Negative Prompt Advanced Guide: Complete CFG Scale / Negative Prompt Analysis
Published: 2026-06-05
Author: ERNIE-Image Technical Team
Keywords: ernie-image cfg scale ernie-image negative prompt ernie-image guidance scale ernie-image prompt weighting
Introduction
In AI image generation, the prompt is the core mechanism for controlling output quality. But for ERNIE-Image—a Diffusion Transformer model—having a good prompt text alone isn't enough. You need to master three key technical parameters: CFG Scale (Guidance Scale), Negative Prompt, and Prompt Weighting to achieve precise control over generation results.
Many new users encounter these frustrations with ERNIE-Image:
- "Why does my negative prompt have no effect at all?"
- "Why does raising CFG to 7 make the quality worse?"
- "How do I make the model focus more on a specific element in my prompt?"
This article answers each question and provides verified best practices.
1. CFG Scale (Guidance Scale): Controlling Prompt Adherence
1.1 What is CFG Scale?
CFG (Classifier-Free Guidance) Scale controls how closely the model follows the text prompt during generation. Simply put:
- CFG = 1: Model almost ignores the prompt, free-form generation
- CFG = 4.0 (default): Balanced adherence and creative freedom
- CFG ≥ 7: Strictly follows the prompt, but may lose color naturalness and diversity
1.2 ERNIE-Image Recommended CFG Values
| Mode | Default | Recommended Range | Notes |
|---|---|---|---|
| ERNIE-Image (Base) | 4.0 | 3.0 - 5.0 | Standard generation |
| ERNIE-Image-Turbo | 1.0 | 1.0 - 2.0 | DMD+RL optimized, low CFG works |
| Upscaling Phase | 3.0 | 2.5 - 3.5 | Lower CFG preserves original structure |
| Text Rendering | 4.5 | 4.0 - 5.5 | Higher CFG enhances text accuracy |
Key difference: ERNIE-Image-Turbo is optimized with DMD and RL, and achieves high quality at the default CFG of 1.0. Setting Turbo's CFG above 4.0 can actually produce oversaturation and artifacts.
1.3 CFG Scale Impact on Output Quality
CFG 1.0 → Soft colors, free composition, may drift from prompt
CFG 2.5 → Balanced state, the sweet spot for most scenarios
CFG 4.0 → Strict prompt adherence, standard recommended value
CFG 5.0 → Highly adherent, precise details but may be oversaturated
CFG 7.0+ → Color distortion, possible over-sharpening or artifacts
1.4 CFG in Diffusers
from diffusers import ERNIEImagePipeline
pipe = ERNIEImagePipeline.from_pretrained("baidu/ERNIE-Image")
Standard generation
image = pipe(
prompt="a cat sitting on a windowsill",
guidance_scale=4.0, # Default recommended value
num_inference_steps=50,
).images[0]
Turbo mode — low CFG
image_turbo = pipe(
prompt="a cat sitting on a windowsill",
guidance_scale=1.0, # Turbo default
num_inference_steps=8,
).images[0]
2. Negative Prompt: Excluding Undesired Content
2.1 Does ERNIE-Image Support Negative Prompts?
Yes, but with conditions. ERNIE-Image is based on the DiT architecture, and its Diffusers pipeline accepts the negative_prompt parameter. However, DiT models respond differently to negative prompts compared to traditional SD 1.x/2.x:
- Requires higher CFG Scale: Negative prompt effects are noticeable at CFG ≥ 3.0
- Limited effect in Turbo mode: Turbo's default CFG of 1.0 makes negative prompts nearly ineffective
- Separate Negative Guidance Scale in ComfyUI: Can be adjusted independently
2.2 Negative Prompt Best Practices
from diffusers import ERNIEImagePipeline
pipe = ERNIEImagePipeline.from_pretrained("baidu/ERNIE-Image")
Effective use of negative prompt
image = pipe(
prompt="a professional headshot portrait of a woman, studio lighting",
negative_prompt="cartoon, anime, drawing, painting, blurry, low quality, deformed, ugly, bad anatomy, extra limbs",
guidance_scale=4.5, # Higher CFG needed
num_inference_steps=50,
).images[0]
2.3 Negative Prompt Considerations
| Scenario | Recommendation |
|---|---|
| Base model + CFG ≥ 3.0 | ✅ Negative prompt effective |
| Turbo model | ⚠️ Limited effect (CFG defaults to 1.0) |
| In ComfyUI | ✅ Adjustable via Negative Guidance Scale |
| Text rendering | ⚠️ May interfere with text generation, use sparingly |
Important: ERNIE-Image-Turbo's DMD-distilled optimization uses default CFG=1.0, making negative prompts nearly ineffective. If you need negative prompts, use the Base model or raise Turbo's CFG to 3.0+ (but this may compromise Turbo's quality advantage).
3. Prompt Weighting: Fine-Controlling Element Importance
3.1 Why Do We Need Prompt Weighting?
In practice, you often need to emphasize certain elements in your prompt while deemphasizing others. For example:
- "A very detailed cat on a windowsill" → Want the model to focus more on cat details
- "Cyberpunk style city with pedestrians" → Want style to be more important than content
ERNIE-Image supports multiple prompt weighting syntaxes.
3.2 Prompt Weighting Syntax
Method 1: Parenthesis Weighting (word)
Add parentheses around words/phrases you want to emphasize:
# No weighting
"a cat on a windowsill with flowers"
Weighted — cat is more important
"(cat:1.3) on a windowsill with flowers"
Multiple weights — cat is most important, flowers secondary
"(cat:1.5) on a windowsill with (flowers:1.2)"
Method 2: Repetition Emphasis
Repeat keywords to increase their importance:
# Moderate emphasis
"cat, cat, on a windowsill"
Strong emphasis
"cat, cat, cat, on a windowsill"
Method 3: Position Priority
Diffusion models pay more attention to words at the beginning of the prompt. Place the most important descriptions first:
# Cat is the focus
"close-up portrait of a cat, detailed fur, sitting on windowsill, flowers in background"
Flowers as focus (not recommended, poor effect)
"sitting on windowsill, flowers, close-up portrait of a cat, detailed fur"
3.3 Weight Coefficient Reference
| Weight | Effect | Use Case |
|---|---|---|
| 1.0 | Standard weight | Default, no emphasis needed |
| 1.2 | Slight emphasis | Secondary elements need a bit more attention |
| 1.3-1.5 | Moderate emphasis | Core elements need more attention |
| 1.5+ | Strong emphasis | Key elements that must stand out |
| 0.5-0.8 | Reduced weight | Elements to de-emphasize |
Note: Excessively high weights (>2.0) can cause attention imbalance, producing anomalous outputs. Recommended weight range: 0.5-1.5.
4. Advanced Control in ComfyUI
4.1 CFG and Negative Guidance Scale in ComfyUI
ERNIE-Image workflows in ComfyUI provide finer-grained control:
KSampler Node:
├── positive — positive prompt
├── negative — negative prompt
├── cfg — CFG Scale (global)
└── denoise — denoising strength (img2img mode)
For Flux/DiT-class models, ComfyUI supports Negative Guidance Scale, which can be set independently in the CLIPTextEncodeFlux node:
CLIPTextEncodeFlux Node:
├── text — prompt text
├── guidance — this prompt's weight (default 3.5)
└── (negative guidance scale — negative weight)
4.2 Advanced Negative Prompt Usage in ComfyUI
The ComfyUI community discovered an interesting technique: even with an empty negative prompt, raising the Negative Guidance Scale can affect output quality:
Positive prompt: "a beautiful landscape"
Negative prompt: "" (empty)
CFG Scale: 6.0
Negative Guidance Scale: 30 (high value increases contrast and sharpness)
This technique is widely verified on FLUX Dev models, and ERNIE-Image as a same-architecture model may also benefit.
5. Best Parameter Combinations for Different Scenarios
5.1 Quick Reference Table
| Scenario | Model | CFG | Negative Prompt | Steps |
|---|---|---|---|---|
| Quick concept validation | Turbo | 1.0 | Not recommended | 8 |
| Standard photography | Base | 4.0 | Generic negative words | 50 |
| Text rendering | Base | 4.5 | Minimal/none | 50 |
| Anime style | Base | 3.5 | "realistic, photo" | 50 |
| Product photography | Base | 4.0 | "blurry, low quality" | 50 |
| Upscaling refinement | Base | 3.0 | Minimal | 20-30 |
| Stylized creation | Base | 2.5-3.0 | Style-dependent | 50 |
5.2 Universal Negative Prompt Templates
# Universal quality negatives (for most scenarios)
negative_prompt = "blurry, low quality, worst quality, deformed, distorted, disfigured, bad anatomy, extra limbs, poorly drawn face, poorly drawn hands, mutation, watermark, text, signature, username"
Photorealistic scenarios
negative_prompt = "cartoon, anime, drawing, painting, illustration, 3d render, blurry, low quality, deformed"
Anime/illustration scenarios
negative_prompt = "photorealistic, realistic photo, blurry, low quality, deformed, watermark"
Text rendering scenarios (use carefully)
negative_prompt = "blurry text, illegible text, distorted text"
6. FAQ and Troubleshooting
Q1: Negative prompt has no effect at all?
Troubleshooting steps:
- Confirm you're using the Base model (not Turbo)
- Confirm CFG Scale ≥ 3.0
- In ComfyUI, confirm negative prompt is correctly connected to KSampler
- Try simplifying the negative prompt (3-5 core words is enough)
Q2: Image looks ugly/oversaturated when I raise CFG?
- Lower CFG to 3.0-4.0 range
- Reduce inference steps (from 50 to 30)
- Try adding "natural lighting, soft colors" to your prompt
Q3: How do I make a specific element stand out?
- Use parenthesis weighting:
(element:1.5) - Place that element at the beginning of the prompt
- Add competing elements to negative prompt: e.g., "a cat, not a dog"
Q4: Negative prompt ineffective in Turbo mode?
This is normal behavior. Turbo's default CFG=1.0 makes negative prompts weak. Solutions:
- Use Base model for generation, then Turbo for upscaling/refinement
- Or manually raise Turbo's CFG to 3.0 (at the cost of some speed)
7. Summary
Mastering CFG Scale, Negative Prompt, and Prompt Weighting is the key to unlocking ERNIE-Image's full potential:
- CFG Scale: Base model recommended 3.0-5.0, Turbo recommended 1.0-2.0. Too high causes oversaturation; too low drifts from the prompt.
- Negative Prompt: Effective with Base model + CFG ≥ 3.0. Limited effect in Turbo mode.
- Prompt Weighting: Use parenthesis weighting
(word:1.3)and position-priority strategies for fine-grained element control.
Using these three parameters together, you can evolve from "luck-based generation" to "precise output control."