TL;DR
MirrorDiffusion introduces a "prompt redescription" mechanism to stabilize the inversion and sampling processes in zero-shot image-to-image translation. By aligning text prompts with latent codes at every time step, it eliminates the "displacement effect" that typically causes edited images to lose their original structure, resulting in state-of-the-art performance in preserving content while accurately shifting domains.
What Problem Does This Paper Address?
Text-to-image diffusion models like DDPM and DDIM are powerful, but using them for zero-shot image-to-image (I2I) translation—transforming an image (e.g., cat $\to$ dog) without any training examples of the target domain—is notoriously difficult.
The core issue is the displacement effect. In theory, if you "invert" an image into noise and then "sample" it back, you should get the exact same image. In practice, because these processes are stochastic and numerical errors accumulate over dozens of timesteps, the reconstructed latent codes drift away from the source. When you try to edit the image during this process, this drift causes the output to lose structural consistency—the background might change, the subject's pose might shift, or fine details might vanish.
Methods
The authors propose MirrorDiffusion, which centers on a Prompt Redescription Strategy to ensure a "mirror effect" between the source and reconstructed images.
- Revised DDIM Inversion: Instead of using a static text prompt, MirrorDiffusion optimizes the text embedding ($c$) at each individual timestep of the inversion process.
- Prompt Redescription Mechanism: The model calculates a loss ($L_{rewrite}$) based on the difference between the latent codes during inversion and reconstruction. It then uses the gradient of this loss to update the text embedding, creating a "redescribed" prompt ($c_{rewrite}$) that is mathematically aligned with the specific image structure at that moment.
- Domain Gap via CLIP: To perform the actual translation, the authors use CLIP to calculate a "domain gap" ($\Delta c$). They take the mean difference between embeddings of multiple source sentences (e.g., "A cat is sleeping") and target sentences (e.g., "A dog is sleeping").
- Structure-Preserving Translation: The final image is generated by sampling with the optimized $c_{rewrite} + \Delta c$. Because $c_{rewrite}$ is so tightly coupled to the original image's structure, the translation remains faithful to the source's geometry and background.
Datasets
The researchers evaluated MirrorDiffusion across several diverse tasks using:
- LAION-5B: Subsets of cat, horse, and sketch images (250 images each).
- CelebA-HQ: Used for human-centric tasks like "Male $\to$ Female" and "Add Glasses."
- AFHQ (Animal Faces HQ): Used for animal-specific translations like "Fox $\to$ Dog."
- Tasks included: Cat-to-Dog (C2D-F), Horse-to-Zebra (H2Z-F), Sketch-to-Pastel (S2O-F), and Add Glasses to Cat (C2G-F).
Key Insights and Ideas
- Text as a Stabilizer: Usually, we think of the latent code as the "content" and the prompt as the "instruction." MirrorDiffusion treats the prompt as a flexible tool that can be "redescribed" to anchor the latent code, preventing it from drifting during the noisy diffusion process.
- The "Mirror" Philosophy: By forcing the reconstruction to be an exact mirror of the source through prompt optimization, the model ensures that any subsequent "delta" (the translation) is applied to a perfectly preserved structural base.
- Averaging the Gap: Using the mean difference of multiple CLIP-encoded sentences to find the domain gap ($\Delta c$) provides a much more stable and accurate translation vector than relying on a single word swap.
Key Results
MirrorDiffusion consistently outperformed state-of-the-art baselines like Pix2Pix-Zero, Null-Text Inversion, and SDEdit in both qualitative and quantitative measures:
- Quantitative: In the "Cat to Dog" (C2G-F) task, MirrorDiffusion achieved a CLIP-ACC of 83.9%, significantly higher than Pix2Pix-Zero (80.3%) and Null-Text Inversion (83.2%). It also showed the lowest Structure Distance (0.024), indicating superior preservation of the original image's layout.
- Qualitative: Visual results show that MirrorDiffusion maintains complex backgrounds and lighting conditions that other models often "hallucinate" over. For example, when adding glasses to a cat, the cat's fur texture and the specific pattern of the rug it sits on remain identical, whereas baseline models often alter the rug or the cat's pose.
Limitations and Future Work
While the paper demonstrates high stability, the Prompt Redescription involves optimization at each timestep, which can be computationally more intensive than simple feed-forward methods.
The authors suggest that this "mirroring" logic could be extended beyond zero-shot translation to other areas of generative AI, such as video editing or 3D asset manipulation, where structural consistency over time or across views is the primary challenge. Future work may also look into reducing the optimization time to make the process real-time.
Summary updated