Custom-Edit: Text-Guided Image Editing with Customized Diffusion Models

Jooyoung Choi, Yunjey Choi, Yunji Kim, Junho Kim, Sungroh YoonarXiv 2023 · DOI

Abstract

Text-to-image diffusion models often struggle with "out-of-vocabulary" concepts, providing generic representations instead of specific, personalized objects. Custom-Edit addresses this by introducing a framework that performs high-fidelity image editing using unique reference concepts. By fine-tuning only language-relevant parameters and employing structure-preserving editing techniques, Custom-Edit achieves a superior balance between layout preservation and the injection of personalized visual details.

Introduction

While models like Stable Diffusion excel at generating images from general text prompts, they lack the precision required for specific object editing. For instance, a prompt for a "ceramic cat figurine" typically yields a generic result rather than a specific, user-provided reference. Existing customization methods like DreamBooth are primarily designed for noise-to-image generation and often fail to maintain the spatial structure of a source image during editing. Custom-Edit bridges this gap, enabling "image-to-image" customization that respects both the source layout and the reference object's unique textures and patterns.

Methodology

The Custom-Edit framework operates in two distinct phases: Customization and Editing.

1. Customization

The model is first fine-tuned on a small set (3-5) of reference images. To maintain the model's general editing capabilities, the authors optimize only the language-relevant parameters—specifically the keys (K) and values (V) of the cross-attention layers—alongside a new [rare token] embedding. This selective tuning prevents the catastrophic forgetting often seen in full-model fine-tuning. Furthermore, "augmented prompts" (e.g., "V* patterned teapot") are used to help the model distinguish the unique reference features from the broader object category.

2. Editing

Once customized, the model performs editing using Prompt-to-Prompt (P2P) and Null-text inversion. P2P facilitates the swapping of words while preserving spatial structure by injecting attention maps from the source image into the edited generation process.

The Custom-Edit workflow: (a) Customization via selective cross-attention tuning and (b) Editing using Prompt-to-Prompt (P2P) injection.

Experimental Evaluation

The researchers evaluated Custom-Edit across 8 distinct reference concepts, including pets, household objects, and artistic styles. Source images were drawn from high-quality datasets such as Imagen and eDiff-I. To maintain general knowledge, 200 images from the LAION dataset were used for prior preservation during the customization phase.

Key Results and Insights

Quantitative analysis using CLIP-based similarity metrics shows that Custom-Edit consistently outperforms baselines like Textual Inversion and DreamBooth. It achieves a more favorable Pareto frontier, providing higher reference similarity without sacrificing source image fidelity.

Qualitative comparison showing Custom-Edit's ability to preserve source structure while accurately reflecting reference object details compared to BLIP-Edit.

Key insights from the study include:

  • Selective Tuning: Focusing on cross-attention layers allows the model to learn appearance without losing structural control.
  • The Source-Reference Trade-off: The "strength" of the edit is controllable by adjusting the number of denoising steps that utilize the original image's self-attention maps.
  • Prompt Refinement: The authors found that refining prompts (adding detail) is more effective than simple word swapping when working with customized tokens.

Conclusion and Future Work

Custom-Edit represents a significant step forward in personalized image editing. However, the method remains dependent on the accuracy of the base model's attention maps. Future work may involve utilizing models with larger text encoders (e.g., T5) or integrating explicit grounding techniques like GLIGEN to improve spatial accuracy in complex or cluttered scenes.

Reference: Choi, J., et al. (2023). Custom-Edit: Text-Guided Image Editing with Customized Diffusion Models. arXiv:2305.15779v1.

Summary updated

BibTeX
@misc{choi2023custom,
  author = {Jooyoung Choi and Yunjey Choi and Yunji Kim and Junho Kim and Sungroh Yoon},
  title = {{Custom-Edit: Text-Guided Image Editing with Customized Diffusion Models}},
  year = {2023},
  eprint = {2305.15779},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.15779},
}
Figure