Entity-Level Text-Guided Image Manipulation

Yikai Wang, Jianan Wang, Guansong Lu, Hang Xu, Zhenguo Li, Wei Zhang, Yanwei Fu · DOI

Abstract

Text-guided image manipulation (TGIM) has traditionally struggled with localized precision, often resulting in unwanted global changes or artifacts. This paper introduces SeMani, a framework designed for entity-level text-guided image manipulation (eL-TGIM). By decoupling the editing process into a semantic alignment phase for object localization and a generative phase for manipulation, SeMani achieves high-fidelity, zero-shot edits that preserve background integrity while ensuring the modified entity blends naturally into the scene.

Introduction

Recent advancements in generative models have made text-to-image synthesis remarkably powerful. However, the task of "surgical" editing—modifying a specific object within a complex image based on a text prompt—remains a challenge. Standard models often suffer from "global bleed," where a prompt like "change the bird to red" inadvertently alters the color of the sky or the texture of the branch the bird is perched on.

To address this, the researchers define three pillars for effective image editing:

  1. Consistency: The edited entity must strictly adhere to the new text description.
  2. Preservation: All regions outside the target entity must remain bit-for-bit identical to the original.
  3. Naturalness: The transition between the edited entity and the original background must be seamless and physically plausible.

The SeMani Framework

SeMani (Semantic Manipulation) operates through a two-stage pipeline that automates the editing process without requiring manual user masks.

1. Semantic Alignment Phase

In the first stage, the model segments the input image into distinct entities. It then employs a semantic alignment module, powered by CLIP (Contrastive Language-Image Pre-training), to identify which segment matches the user's "prompt word" (e.g., "cake" or "rabbit"). This process generates a precise binary mask, isolating the target for modification.

2. Image Manipulation Phase

Once the target area is defined, the framework applies a generative model to fill the mask based on a detailed target description. The paper explores two distinct architectural approaches for this phase:

  • SeMani-Trans: This variant uses a VQGAN-style autoencoder to represent the image as discrete tokens, processed by an auto-regressive Transformer. To maintain structural integrity, the authors introduce Vision Guidance, which feeds a grayscale version of the original entity back into the model to serve as a geometric prior.
  • SeMani-Diff: Based on Latent Diffusion Models (LDM), this variant utilizes a fine-tuned CLIP model via mask prompt tuning. This allows the diffusion process to better capture the global features of the masked entity, resulting in superior texture generation and lighting integration.
Fine-grained attribute manipulation on a cake entity, demonstrating the model's ability to handle complex textures and specific decorative prompts.

Key Insights: Shape vs. Style

The research highlights a fundamental trade-off between the two variants. SeMani-Trans, with its vision guidance, is highly effective at preserving the exact silhouette and pose of the original object, making it ideal for color or pattern swaps. Conversely, SeMani-Diff provides higher-quality textures and more realistic environmental blending, though it may occasionally alter the object's pose to better fit the target description.

Evaluation and Results

The framework was rigorously tested on the CUB-200-2011 (birds), Oxford-102 (flowers), and COCO (complex real-world scenes) datasets.

Quantitative Performance

On the CUB dataset, SeMani-Diff significantly outperformed existing baselines like ManiGAN and Blended LDM, achieving a CLIP-score of 24.03 and an Inception Score (IS) of 5.13. These metrics indicate that SeMani produces images that are both more realistic and more closely aligned with the provided text prompts.

Qualitative Superiority

Visual analysis confirms that SeMani excels at background preservation. While competing models often introduce "ghosting" or change the background color to match the new entity, SeMani keeps the background pixels unchanged. This is particularly evident in "in-the-wild" scenarios where the lighting and context are complex.

An example of entity-level manipulation where a rabbit's appearance is changed while the architectural background remains perfectly intact.

Conclusion and Future Work

SeMani represents a significant step forward in automated, high-precision image editing. By leveraging the open-vocabulary capabilities of CLIP, it enables zero-shot manipulation of virtually any entity in a scene. Future work will focus on integrating structural priors into the diffusion-based variant to improve shape preservation and optimizing inference speeds for real-time applications.

Summary updated

BibTeX
@misc{wang2023entity,
  author = {Yikai Wang and Jianan Wang and Guansong Lu and Hang Xu and Zhenguo Li and Wei Zhang and Yanwei Fu},
  title = {{Entity-Level Text-Guided Image Manipulation}},
  year = {2023},
  eprint = {2302.11383},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.11383},
}
Figure