EZIGen: Enhancing zero-shot subject-driven image generation with precise subject encoding and decoupled guidance

Zicheng Duan, Yuxuan Ding, Chenhui Gou, Ziqin Zhou, Ethan Smith, Lingqiao Liu · Submission to ICLR 2025 · Withdrawn

TL;DR

Balancing subject identity preservation with text prompt adherence is a major hurdle in zero-shot personalized image generation. EZIGen resolves this tension by using a frozen Stable Diffusion UNet as a low-noise subject encoder, coupled with a two-stage process that decouples text-driven layout generation from subject appearance transfer. The resulting framework achieves state-of-the-art fidelity and text alignment across generation and editing benchmarks while using 100× less training data than leading zero-shot methods.

What Problem Does This Paper Address?

Subject-driven image generation allows users to generate novel scenes featuring a specific object or character (e.g., placing a user’s pet dog into a "police outfit" or "in the snow").

While test-time tuning methods (like DreamBooth or Textual Inversion) achieve high fidelity, they require slow, per-subject fine-tuning. Conversely, zero-shot methods encode reference subjects on the fly, but frequently suffer from conflicting guidance:

  • Identity Bleed / Copy-Paste: Subject features injected too early override the text prompt’s semantic layout (e.g., copying the dog's bare fur over the requested police outfit).
  • Identity Loss: Prioritizing text alignment washes out fine identity details of the subject.
  • Suboptimal Feature Encoders: Off-the-shelf encoders (like CLIP or DINO) exhibit feature misalignment with the generation model, requiring massive training datasets to bridge the gap.

Methods

EZIGen builds upon Stable Diffusion V2.1 with three key architectural and procedural choices:

  1. Frozen Reference UNet as Subject Encoder:
    Instead of using CLIP/DINO or fine-tuning a Reference UNet across noisy timesteps, EZIGen uses a frozen Reference UNet ($U_{\text{ref}}$) fed with a background-removed subject image perturbed only by minimal Gaussian noise ($T_{\text{sub}} = 1$). This preserves the generator's native feature space while extracting crisp, uncorrupted spatial features ($F_{\text{sub}}$).

  2. Attention Adapters:
    A lightweight, trainable adapter module is inserted between the self-attention and cross-attention blocks in each transformer layer of the generation UNet. The adapter attends generation queries ($Q$) against concatenated keys and values from both the generation latent ($K, V$) and the subject encoder ($K_{\text{sub}}, V_{\text{sub}}$). Only the adapters are trained.

  3. Decoupled Guidance:
    Rather than applying text and subject guidance concurrently, generation is divided into two distinct phases:

  4. Layout Generation: The text prompt guides early denoising until an intermediate timestep $T_{\text{layout}}$, establishing the coarse scene structure and color composition without subject interference.

  5. Appearance Transfer: From $T_{\text{layout}}$ onward, subject features are injected via the adapters to bind subject appearance specifically to the matching semantics in the layout.
  6. Iterative Appearance Transfer:
    To improve matching when layout latents differ from the subject pose, the generated output is partially re-noised to $T_{\text{layout}}$ and refined iteratively until convergence.

  7. Extension to Editing:
    By substituting noise addition with DDIM inversion and applying a foreground mask $M$, EZIGen directly performs zero-shot subject replacement/editing while keeping backgrounds untouched.

Text Prompt ──> [Layout Generation (0 to T_layout)] ──> Coarse Layout Latent
                                                               │
Subject Image ──> [Frozen Ref UNet (T_sub=1)] ──> Adapters ────┴──> [Appearance Transfer] ──> Output
                                                                            │ (Iterate)
                                                                            └───────────────┘

Datasets

  • Training: 200k image pairs sampled equally (100k each) from COCO2014 (cropping 1–4 objects per image) and YouTube-VIS (pairing instances of the same object across different frames).
  • Evaluation:
  • DreamBench: 30 subjects with multiple prompts for zero-shot subject-driven generation.
  • DreamEditBench: Evaluates subject replacement and background preservation in image editing.
  • FastComposerBench: Evaluates human ID preservation and text consistency.

Key Insights and Ideas

  • Diffusion UNets encode better generative priors than CLIP or DINO: Because the Reference UNet shares the latent space of the generative model, EZIGen learns cross-image attention with only 200k image pairs—compared to 76M pairs for Subject Diffusion and 9M pairs for AnyDoor.
  • Do not corrupt reference features: Prior work (e.g., BootPIG) applied timestep-dependent noise to reference images and tuned the Reference UNet. EZIGen demonstrates that fine-tuning breaks native generative priors, and heavy noise corrupts subject identity. Setting a fixed, minimal noise timestep ($T_{\text{sub}} = 1$) yields significantly higher fidelity.
  • Decoupling prevents signal competition: Letting text guide early layout formation and injecting subject features only at later steps prevents the subject from wiping out scene-level prompt modifications.

Key Results

  • DreamBench Generation: EZIGen achieves state-of-the-art balance with a 0.316 CLIP-T (text alignment) and 0.718 DINO (subject identity), outperforming Subject Diffusion (0.293 / 0.711) and BootPIG (0.311 / 0.674) using a single reference image and a fraction of the data.
  • DreamEditBench: Outperforms DreamEdit and DreamBooth baselines in foreground identity (0.650 DINO-sub) and background retention (0.792 DINO-back).
  • Human Content Generation: Without human-specific fine-tuning or domain datasets, EZIGen matches Subject Diffusion's ID preservation (0.592 vs. 0.605) and beats FastComposer in identity retention (0.514).

Limitations and Future Work

  • Slight Semantic Trade-off in Iterations: The ablation indicates that while iterative appearance transfer boosts DINO subject similarity (from 0.560 to 0.718), it causes a slight marginal drop in prompt adherence (CLIP-T decreases from 0.321 to 0.316).
  • Mask Dependence for Editing: The editing pipeline requires user-provided or segmentation-derived masks to cleanly separate foreground updates from background preservation.
  • Failure Modes on Extreme Discrepancies: While iterative refinement mitigates large pose or structural mismatches between the initial text layout and subject, extreme geometric differences remain challenging for appearance transfer.

Summary updated

BibTeX
@misc{duan2024ezigen,
  author = {Zicheng Duan and Yuxuan Ding and Chenhui Gou and Ziqin Zhou and Ethan Smith and Lingqiao Liu},
  title = {{EZIGen: Enhancing zero-shot subject-driven image generation with precise subject encoding and decoupled guidance}},
  year = {2024},
  eprint = {2409.08091},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.08091},
}
Figure