ERNIE-Image High-Res Output and Upscaling Workflow: Complete Guide from 1024 to 2K+

Jun 5, 2026

ERNIE-Image High-Res Output and Upscaling Workflow: Complete Guide from 1024 to 2K+

Published: 2026-06-05
Author: ERNIE-Image Technical Team
Keywords: ernie-image high resolution ernie-image upscaling ernie-image 2K output ernie-image tile upscaling ernie-image hires fix


Introduction

ERNIE-Image natively outputs 1024×1024 resolution (based on FLUX.2 VAE's 64×64 latent space), which is sufficient for most screen-display scenarios. However, real-world applications often demand higher resolutions: printed posters need 300 DPI (~3500×3500 pixels), e-commerce product images require 1600×1600+, and wallpapers/backgrounds often need 4K and beyond.

This article presents the complete workflow from ERNIE-Image's native output to 2K+ high-definition images, covering four core approaches: native high-resolution output, latent upscaling, tile upscaling, and two-stage refinement.


1. ERNIE-Image Native Resolution Limits and Breakthroughs

1.1 Native Resolution Fundamentals

ERNIE-Image uses FLUX.2 VAE as its variational autoencoder. Its latent space resolution is 64×64, corresponding to 1024×1024 in pixel space (scale factor 16). This is a hard limit determined by the VAE architecture.

Parameter Value
VAE FLUX.2 VAE (flux-2-2025)
Latent space resolution 64×64
Native output resolution 1024×1024
Supported aspect ratios 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, etc.

1.2 Native Multi-Aspect-Ratio Support

While the max side is capped at 1024 pixels, ERNIE-Image supports flexible aspect ratios:

from diffusers import ERNIEImagePipeline

pipe = ERNIEImagePipeline.from_pretrained("baidu/ERNIE-Image")

16:9 widescreen (1024×576)

image = pipe(prompt="landscape scene", width=1024, height=576).images[0]

9:16 portrait (576×1024)

image = pipe(prompt="portrait photo", width=576, height=1024).images[0]

4:3 standard (1024×768)

image = pipe(prompt="document scan", width=1024, height=768).images[0]

Tip: Aspect ratio choice affects composition. Wide-screen suits landscapes and posters, portrait fits character photos and phone wallpapers, and 4:3 works well for documents and infographics.


2. Four High-Res Output Approaches Compared

Approach Overview

Approach Target Resolution Quality Speed VRAM Best For
1. Native Multi-AR 1024px max side ⭐⭐⭐ Fastest Lowest Screens, social media
2. Latent Upscaling 2048×2048 ⭐⭐⭐⭐ Fast Medium E-commerce, wallpapers
3. Tile Upscaling 2K-4K ⭐⭐⭐⭐⭐ Medium High Print posters, professional design
4. Two-Stage Refinement 2K+ ⭐⭐⭐⭐⭐ Slowest Highest High-end print, art creation

3. Approach 1: Native Multi-Aspect-Ratio Output (1024px)

Use Cases

  • Social media posts (Instagram 1080×1080, Weibo 1024×1024)
  • YouTube thumbnails (1280×720, slight stretch from 1024×576)
  • Quick previews and concept validation

Best Practices

# Diffusers example
from diffusers import ERNIEImagePipeline

pipe = ERNIEImagePipeline.from_pretrained("baidu/ERNIE-Image")

Social media square

img = pipe(
prompt="professional product photo of a smartwatch on marble surface",
width=1024, height=1024,
num_inference_steps=50,
guidance_scale=4.0,
).images[0]

Social media widescreen

img_wide = pipe(
prompt="cinematic landscape with mountain sunset",
width=1024, height=576, # 16:9
num_inference_steps=50,
guidance_scale=4.0,
).images[0]

ERNIE-Image-Turbo only needs 8 steps, making it ideal for rapid iteration. For 1024px output, Turbo quality is within 5% of Base mode.


4. Approach 2: Latent Upscaling (2048×2048)

Principle

Latent upscaling downsamples the ERNIE-Image generated 1024×1024 image to latent space, upscales it, then performs low-intensity denoising redrawing — increasing detail while preserving composition.

ComfyUI Workflow

The ComfyUI community has a mature Z-Image-Turbo 2K upscaling workflow. ERNIE-Image can follow a similar architecture:

Load Image (1024×1024)
    ↓
Image Scale (to 2048×2048, nearest neighbor)
    ↓
ERNIE-Image KSampler (denoise=0.3-0.5, steps=20)
    ↓
Save Image (2048×2048)

Diffusers Code Implementation

import torch
from diffusers import ERNIEImagePipeline
from PIL import Image

pipe = ERNIEImagePipeline.from_pretrained("baidu/ERNIE-Image")

Step 1: Generate 1024×1024 base image

base_image = pipe(
prompt="detailed architectural blueprint of a modern house",
width=1024, height=1024,
num_inference_steps=50,
guidance_scale=4.0,
).images[0]

Step 2: Upscale to 2048×2048

upscaled = base_image.resize((2048, 2048), Image.LANCZOS)

Step 3: Low-strength redraw for detail enhancement

final = pipe(
prompt="detailed architectural blueprint of a modern house",
image=upscaled,
strength=0.4, # Low strength, preserve composition
num_inference_steps=30,
guidance_scale=3.0,
).images[0]

Key parameter: strength=0.3-0.5 is critical. Too high changes composition; too low adds minimal detail. For text rendering scenarios, use strength=0.3 to maintain text clarity.


5. Approach 3: Tile Upscaling (2K-4K)

Principle

Tile upscaling splits the original image into overlapping tiles, independently upscales and redraws each tile, then merges them. This approach:

  1. Bypasses VRAM limits: processes one small region at a time
  2. Preserves local detail: each tile gets full denoising iterations
  3. Reduces global distortion: overlapping regions blend smoothly, avoiding seam artifacts

ComfyUI Tile Upscale Workflow

Original Image (1024×1024)
    ↓
Tile Preprocessor (tile_size=512, overlap=64)
    ↓
ForEach Tile:
    Tile Scale (512→1024)
    ERNIE-Image KSampler (denoise=0.35)
    ↓
Tile Merged (with overlap blending)
    ↓
Output (2048×2048 or higher)

Key Parameter Tuning

Parameter Recommended Value Notes
tile_size 512 Tile size; smaller = less VRAM
overlap 64 Overlap region, reduces seam artifacts
denoise 0.3-0.4 Denoising strength, preserves original structure
guidance_scale 3.0-3.5 Lower CFG during upscaling phase
steps 20-30 Can reduce steps during upscaling

VRAM optimization: Using NVFP4 quantization (4.78GB VRAM) or INT8 quantization (~9GB VRAM), Tile Upscale can handle 4K output on consumer GPUs.


6. Approach 4: Two-Stage Refinement Workflow (2K+)

Principle

Two-stage refinement combines ERNIE-Image's text rendering strength with Z-Image Turbo's detail optimization capability, forming a complementary pipeline:

Stage 1: ERNIE-Image (composition + text)
    ↓ 1024×1024
Stage 2: Z-Image Turbo / Upscaling (detail enhancement)
    ↓ 2048×2048
Stage 3: Optional — ERNIE-Image text area refinement
    ↓
Final Output

Complete Code Example

import torch
from diffusers import ERNIEImagePipeline
from PIL import Image

Stage 1: ERNIE-Image generates base composition and text

ernie_pipe = ERNIEImagePipeline.from_pretrained("baidu/ERNIE-Image")

base = ernie_pipe(
prompt="commercial poster: 'SALE 50% OFF' with modern design, clean typography",
width=1024, height=1024,
num_inference_steps=50,
guidance_scale=4.0,
).images[0]

Stage 2: Upscale to 2048×2048

upscaled = base.resize((2048, 2048), Image.LANCZOS)

Stage 3: Low-strength redraw for detail

final = ernie_pipe(
prompt="commercial poster: 'SALE 50% OFF' with modern design, clean typography",
image=upscaled,
strength=0.35,
num_inference_steps=25,
guidance_scale=3.0,
).images[0]

final.save("poster_2k.png")

Two-Stage Approach Use Cases

Scenario Stage 1 Model Stage 2 Model Target Resolution
Poster Design ERNIE-Image (text) ERNIE-Image (details) 2048×2048
E-commerce Products ERNIE-Image-Turbo (fast) ERNIE-Image (refine) 2048×2048
Wallpaper/Background ERNIE-Image (composition) Tile Upscale 3840×2160 (4K)
Print Materials ERNIE-Image (HQ) Double upscale 3500×3500+

7. Platform Resolution Requirements Reference

Platform/Use Recommended Resolution Approach
Instagram Post 1080×1080 Approach 1 (native 1024 slight stretch)
Instagram Story 1080×1920 Approach 1 (native 576×1024 2x upscale)
YouTube Thumbnail 1280×720 Approach 1 (native 1024×576 stretch)
E-commerce Main Image 1600×1600 Approach 2 (latent upscale)
Print Poster (A3) 2480×3508 Approach 3 (Tile Upscale)
Print Poster (A2) 3508×4961 Approach 4 (two-stage + Tile)
4K Wallpaper 3840×2160 Approach 3/4
Social Media Banner 1500×500 Approach 1 (native 1024×341 upscale)

8. Performance Optimization Tips

8.1 VRAM Optimization

# Use NVFP4 quantization, only 4.78GB VRAM needed
# See EI-028 NVFP4 Quantized Deployment Guide

Use FP8 quantization, ~5-6GB VRAM

See EI-040 FP8-INT8 Quantization Advanced Guide

Use GGUF quantization, ~8-10GB VRAM

See EI-015 GGUF Quantized Deployment Guide

8.2 Speed Optimization

  • Turbo mode: 8-step generation, ideal for Approach 1 rapid iteration
  • SGLang deployment: See EI-034 and EI-070 for SGLang inference acceleration
  • Batch processing: Use batch_size=2-4 in upscaling phase for higher throughput

8.3 Quality Optimization

  • guidance_scale in upscaling phase should be 0.5-1.0 lower than generation phase
  • num_inference_steps in upscaling phase can be reduced to 20-30
  • Use strength=0.3-0.5 to maintain composition stability
  • For text-heavy scenes, prefer Approach 2 (latent upscale) to avoid tile seams breaking text

9. FAQ

Q: Can ERNIE-Image directly output 4K?

A: Not directly. ERNIE-Image's VAE limits native max resolution to 1024×1024. Higher resolutions require upscaling workflows (Approaches 2/3/4).

Q: Will text become blurry after upscaling?

A: With latent upscaling (Approach 2) and strength ≤ 0.3, text clarity is well maintained. Tile upscaling (Approach 3) may affect text at tile boundaries — prefer Approach 2 for text-heavy scenes.

Q: Will upscaling cause artifacts?

A: Tile Upscale may produce minor artifacts at tile boundaries. Solutions:

  1. Increase overlap value (64→128)
  2. Use ERNIE-Image (not Turbo) for upscaling redraw
  3. Score upscaled results with ERNIE-Image-Aes to select optimal outputs

10. Summary

While ERNIE-Image natively outputs 1024×1024, reasonable workflow combinations can easily extend to 2K-4K resolution:

  1. Daily screen display: Native 1024px is sufficient, use ERNIE-Image-Turbo for fast generation
  2. E-commerce/Social media: Approach 2 (latent upscale) to 2048×2048, best cost-performance ratio
  3. Print/Professional design: Approach 3/4 (Tile Upscale + two-stage refinement) for best quality

Combined with ERNIE-Image's text rendering advantage and ComfyUI's flexible workflows, ERNIE-Image can fully meet high-resolution output needs from social media to professional printing.

ERNIE-Image Team