Highly Personalized Text Embedding for Image Manipulation by Stable Diffusion

Inhwa Han, Serin Yang, Taesung Kwon, Jong Chul YearXiv 2023

Abstract

Diffusion models have shown superior performance in image generation and manipulation, but the inherent stochasticity presents challenges in preserving and manipulating image content and identity. While previous approaches like DreamBooth and Textual Inversion have proposed model or latent representation personalization to maintain the content, their reliance on multiple reference images and complex training limits their practicality. In this paper, we present a simple yet highly effective approach to personalization using highly personalized (HiPer) text embedding by decomposing the CLIP embedding space for personalization and content manipulation. Our method does not require model fine-tuning or identifiers, yet still enables manipulation of background, texture, and motion with just a single image and target text. Through experiments on diverse target texts, we demonstrate that our approach produces highly personalized and complex semantic image edits across a wide range of tasks. We believe that the novel understanding of the text embedding space presented in this work has the potential to inspire further research across various tasks.

Introduction

While diffusion models like Stable Diffusion are highly capable of generating images from text, they struggle with "personalization"—the ability to manipulate a specific object or person from a real photo while keeping their unique features intact. Existing solutions such as DreamBooth and Textual Inversion typically require 3–5 reference images and lengthy training sessions. Other methods like Imagic require model fine-tuning and complex embedding interpolation, which is computationally expensive and often fails to preserve fine details. Furthermore, the inherent stochasticity of diffusion often causes the subject to lose its identity during the editing process. This work introduces HiPer (Highly Personalized text embedding), a method designed to perform these edits quickly using just a single source image.

Methodology: Text Embedding Decomposition

The core innovation of HiPer is Text Embedding Decomposition. In Stable Diffusion, text prompts are converted into CLIP embeddings of a fixed length (77 tokens). For short prompts, the "tail" end of this embedding space is typically uninformative. HiPer repurposes this space through a two-stage workflow:

  1. Personalization (Training): Given a single source image and its description, the "semantic" part of the embedding (the actual words) is kept fixed. The system optimizes only the "personalized" part—the empty tail tokens ($e_{hper}$)—to reconstruct the source image. Crucially, the Stable Diffusion U-Net remains frozen; only a small portion of the text embedding is updated. This optimization takes approximately 3 minutes on an NVIDIA GTX 3090.
  2. Manipulation (Inference): To edit the image, a target prompt (e.g., "a dog jumping on the moon") is converted to an embedding and concatenated with the optimized $e_{hper}$ vector. A calibration scaling factor ($\alpha = 0.8$) is applied to balance the influence of the new text against the personalized identity.

Experimental Results

The researchers evaluated HiPer using datasets such as the Ted of Imagic and LAION. The method demonstrates a unique ability to perform "multi-aspect" edits, simultaneously changing a subject's motion, background, and artistic style without losing its identity.

Qualitative results of HiPer showing various semantic manipulations (style, action, and environment) for a single source image of a rabbit and a dog.

In a user study with 20 participants, HiPer significantly outperformed Imagic, DreamBooth, and Textual Inversion in Semantic Alignment (matching the target text). It also ranked second only to DreamBooth in Identity Preservation, despite requiring significantly less data and time. While Textual Inversion takes roughly 42 minutes and Imagic takes 14 minutes, HiPer achieves results in just 3 minutes.

Key Insights and Discussion

  • Latent Capacity: The unused capacity in the CLIP embedding space is sufficient to "memorize" the complex visual identity of a specific subject.
  • Decomposition vs. Fine-tuning: By separating identity (stored in tail tokens) from context (stored in lead tokens), the model avoids "identity leakage" or "catastrophic forgetting" common in full-network fine-tuning.
  • Practicality: Reducing the requirement to a single image and a 3-minute window moves personalization from a research curiosity toward a viable consumer photo-editing tool.

Limitations and Future Work

Despite its effectiveness, HiPer faces challenges with counting and quantity (e.g., changing one object into two) and color accuracy if colors are not explicitly mentioned in the target prompt. It also has more difficulty with highly structured, complex man-made objects compared to natural subjects. Future research may explore this decomposition in larger models like SDXL or integrate it with structural guidance tools like ControlNet.

Summary updated

BibTeX
@misc{han2023highly,
  author = {Inhwa Han and Serin Yang and Taesung Kwon and Jong Chul Ye},
  title = {{Highly Personalized Text Embedding for Image Manipulation by Stable Diffusion}},
  year = {2023},
  eprint = {2303.08767},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.08767},
}
Figure