Dual Inversion for Text-to-Image Diffusion Models: From Both Prompt and Noise Perspectives

Xiaolong Liu, Junjian Li, Yuan Xiao, Jiaqi Deng, Dayong Ye, Tianqing Zhu, Huan HuoarXiv 2026

TL;DR

Dualin introduces a two-stage "dual inversion" framework for text-to-image diffusion models that recovers both a human-interpretable text prompt and the exact latent noise of a target image. By combining vision-language models for semantic extraction with unconditional DDIM noise inversion, it achieves state-of-the-art image reconstruction fidelity and enables precise, zero-optimization image editing.

What Problem Does This Paper Address?

Prompt inversion is the reverse engineering of text-to-image (T2I) models—finding the text prompt that can recreate a specific target image. It is a cornerstone technique for semantic image editing, model safety auditing, and automated prompt discovery. However, current methods fall into two flawed camps:

  1. Gradient-based methods optimize in the continuous embedding space, often yielding uninterpretable, gibberish prompts (e.g., "A tiger !!, gtrth big") and images with severe artifacts.
  2. Gradient-free methods use language models to generate clean, human-readable prompts, but they lack fine-grained detail alignment, resulting in low visual fidelity compared to the original image.

The authors point out a fundamental blind spot: existing methods treat prompt inversion as a sufficient condition for image reconstruction, completely ignoring the role of the initial latent noise which encodes crucial structural and spatial layout information.

Methods

The authors propose Dualin (Dual Inversion), which splits the reverse engineering process into two distinct, complementary stages:

  • Stage I: Prompt Inversion (Semantic): Instead of optimizing tokens directly via gradients, Dualin uses a three-step gradient-free pipeline:
  • Semantic Content Extraction: A pre-trained Vision-Language Model (VLM), specifically Qwen3-VL-7B-Instruct, extracts the core visual content of the image.
  • Zero-Shot Concept Retrieval: A CLIP-based Interrogator matches the image against a predefined "Concept Bank" of aesthetic, style, and lighting tags to capture nuances VLMs often miss.
  • Prompt Generation and Selection: An LLM (Llama-3-8B-Instruct) fuses the semantic description and aesthetic tags into candidate prompts. A CLIP discriminator then selects the prompt with the highest image-text similarity.
  • Stage II: Noise Inversion (Structural): To capture the exact layout, Dualin performs unconditional DDIM inversion. Crucially, by making the noise inversion unconditional (using an empty/null input), they mathematically prove a Decoupling Property: the inverted noise captures the spatial layout independently of the text prompt. This allows the noise to be frozen and combined with modified text prompts for downstream editing tasks.
The Dualin framework decouples reverse engineering into semantic prompt inversion and structural noise inversion.

Datasets

The method was evaluated across three diverse datasets:

  • MS COCO: The standard benchmark for general image captioning and generation.
  • LAION: A large-scale dataset used to test generalization on diverse web images.
  • DiffusionDB: A prompt gallery dataset where the target images were originally generated by T2I models, serving as a clean ground-truth testbed.

Key Insights and Ideas

  • Noise is the Missing Link: Prompt inversion alone is mathematically insufficient for high-fidelity reconstruction. Because diffusion models rely heavily on random sampling noise for generation diversity, using the correct prompt with the wrong noise seed results in massive structural and stylistic drift.
  • The Power of Unconditional Inversion: Inverting noise unconditionally (rather than conditioning it on the inverted prompt) is the secret to clean disentanglement. It ensures that the noise purely encodes spatial structure, preventing text-conditioning errors from corrupting the latent layout.
  • Collaborative AI for Prompts: Combining VLMs (good at identifying objects), CLIP (good at matching artistic styles), and LLMs (good at synthesizing coherent text) creates a highly interpretable "hard prompt" that outperforms pure optimization techniques.

Key Results

Dualin was tested across multiple diffusion architectures, including Stable Diffusion V1.5, SDXL, and Pixart-$\alpha$, consistently outperforming baselines like PEZ, PH2P, BLIP, and VGD.

  • Image Fidelity: On MS COCO using SD-V1.5, Dualin achieved a CLIP-I score of 0.906 and an SSIM of 0.627, vastly outperforming the next best gradient-free method, VGD (CLIP-I: 0.804, SSIM: 0.212).
  • Prompt Alignment: Dualin scored a CLIP-T of 0.351 on MS COCO, proving that its generated prompts are more semantically aligned with the target image than baseline methods.
  • Efficiency: Dualin takes roughly 18.73 seconds per image. While slightly slower than pure gradient-free captioning methods due to the extra noise inversion step, it is orders of magnitude faster than gradient-based optimization methods like PH2P, which can take hours.
  • Downstream Applications: Thanks to the Decoupling Property, Dualin excels at zero-optimization image editing tasks like subject replacement, background editing, and style transfer while perfectly preserving the original image's layout.
Qualitative comparison showing Dualin's superior prompt interpretability and pixel-level image reconstruction fidelity compared to baselines.

Limitations and Future Work

  • Computational Overhead: Dualin introduces an extra noise inversion stage, making it slightly slower than basic caption-based prompt inversion methods (though still much faster than gradient-based ones).
  • Step-Dependency: The quality of the noise reconstruction depends on the number of DDIM inversion steps. While performance saturates around 35–50 steps, finding ways to accelerate this process to fewer steps remains an open area for optimization.

Summary updated

BibTeX
@misc{liu2026dual,
  author = {Xiaolong Liu and Junjian Li and Yuan Xiao and Jiaqi Deng and Dayong Ye and Tianqing Zhu and Huan Huo},
  title = {{Dual Inversion for Text-to-Image Diffusion Models: From Both Prompt and Noise Perspectives}},
  year = {2026},
  eprint = {2607.26735},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.26735},
}
Figure