Table of Contents
Fetching ...

Textualize Visual Prompt for Image Editing via Diffusion Bridge

Pengcheng Xu, Qingnan Fan, Fei Kou, Shuai Qin, Hong Gu, Ruoyu Zhao, Charles Ling, Boyu Wang

TL;DR

The paper tackles the challenge of editing real images from indescribable visual prompts by learning a text embedding that encodes the transformation described by a before/after image pair. It introduces a diffusion-bridge framework built on a single text-to-image model and the probability-flow ODE, enabling the translation of visual prompts into text guidance without retraining TI2I models. A differential attention control mechanism is proposed to disentangle transformation content from invariant image content, improving generalization across diverse images. Experiments on real images demonstrate competitive fidelity, contextual coherence, and robustness compared with existing baselines, highlighting the scalability of leveraging large T2I priors for complex visual transformations.

Abstract

Visual prompt, a pair of before-and-after edited images, can convey indescribable imagery transformations and prosper in image editing. However, current visual prompt methods rely on a pretrained text-guided image-to-image generative model that requires a triplet of text, before, and after images for retraining over a text-to-image model. Such crafting triplets and retraining processes limit the scalability and generalization of editing. In this paper, we present a framework based on any single text-to-image model without reliance on the explicit image-to-image model thus enhancing the generalizability and scalability. Specifically, by leveraging the probability-flow ordinary equation, we construct a diffusion bridge to transfer the distribution between before-and-after images under the text guidance. By optimizing the text via the bridge, the framework adaptively textualizes the editing transformation conveyed by visual prompts into text embeddings without other models. Meanwhile, we introduce differential attention control during text optimization, which disentangles the text embedding from the invariance of the before-and-after images and makes it solely capture the delicate transformation and generalize to edit various images. Experiments on real images validate competitive results on the generalization, contextual coherence, and high fidelity for delicate editing with just one image pair as the visual prompt.

Textualize Visual Prompt for Image Editing via Diffusion Bridge

TL;DR

The paper tackles the challenge of editing real images from indescribable visual prompts by learning a text embedding that encodes the transformation described by a before/after image pair. It introduces a diffusion-bridge framework built on a single text-to-image model and the probability-flow ODE, enabling the translation of visual prompts into text guidance without retraining TI2I models. A differential attention control mechanism is proposed to disentangle transformation content from invariant image content, improving generalization across diverse images. Experiments on real images demonstrate competitive fidelity, contextual coherence, and robustness compared with existing baselines, highlighting the scalability of leveraging large T2I priors for complex visual transformations.

Abstract

Visual prompt, a pair of before-and-after edited images, can convey indescribable imagery transformations and prosper in image editing. However, current visual prompt methods rely on a pretrained text-guided image-to-image generative model that requires a triplet of text, before, and after images for retraining over a text-to-image model. Such crafting triplets and retraining processes limit the scalability and generalization of editing. In this paper, we present a framework based on any single text-to-image model without reliance on the explicit image-to-image model thus enhancing the generalizability and scalability. Specifically, by leveraging the probability-flow ordinary equation, we construct a diffusion bridge to transfer the distribution between before-and-after images under the text guidance. By optimizing the text via the bridge, the framework adaptively textualizes the editing transformation conveyed by visual prompts into text embeddings without other models. Meanwhile, we introduce differential attention control during text optimization, which disentangles the text embedding from the invariance of the before-and-after images and makes it solely capture the delicate transformation and generalize to edit various images. Experiments on real images validate competitive results on the generalization, contextual coherence, and high fidelity for delicate editing with just one image pair as the visual prompt.
Paper Structure (20 sections, 15 equations, 16 figures, 2 tables, 1 algorithm)

This paper contains 20 sections, 15 equations, 16 figures, 2 tables, 1 algorithm.

Figures (16)

  • Figure 1: Image editing via visual prompt. The visual prompt defines the visual transformation, which is difficult to describe accurately by language, by a before-and-after image pair. Our method learns such delicate transformation into pseudo text (<A> and <C>), supports hybrid editing with natural text, and can control the intensity of editing with rigorous consistency.
  • Figure 2: Textualization of the diffusion bridge. Left: The before-image is first transferred to a deterministic latent encoding via the unconditional model and then to the after-image under the text guidance. The text embeddings are optimized with fixed start (latent $\mathbf{x}_T$) and end (after-image $\mathbf{x}_0^a$) states. Right: In training, the attention of the before-image $M_t^b$ is first timed with the column-transformation matrix $\mathbf{\Lambda}$ to switch the column of <E> (end) token, then masked with $\mathbf{F}$. The attention of the after-image $M_t^a$ is masked with $1-\mathbf{F}$ to get the attention of the $y$ tokens. The final $M_t$ is the addition of two masked attentions. This preserves the linguistic format of cross-attention and enables the embedding to learn disentangled and generalized transformation.
  • Figure 3: Qualitative comparisons on real images. Visual prompts with different editing types and different levels of geometric changes. Our method generalizes to different editing types and scenes while preserving different levels of geometric structures.
  • Figure 4: Generalization in heterogeneous scenes and categories. Results of tone and style editing show our method does not introduce leaked content (bear texture, dog face, color) from visual prompts when the category and scene of test images differ greatly from the visual prompts.
  • Figure 5: Train and test results with/without attention. 1st column: the visual prompt; 2nd column: training results without/with injected attention. 3rd column: test images; 4&5 columns: test results without and with attention control.
  • ...and 11 more figures