Skip to main content
QUICK REVIEW

[Paper Review] Photoswap: Personalized Subject Swapping in Images

Jing Gu, Yilin Wang|arXiv (Cornell University)|May 29, 2023
Multimodal Machine Learning ApplicationsComputer Science7 citations
TL;DR

Photoswap enables training-free personalized subject swapping in images by transferring learned subject concepts into a source image through attention swapping in diffusion models, preserving pose and background and outperforming baselines in human evaluations.

ABSTRACT

In an era where images and visual content dominate our digital landscape, the ability to manipulate and personalize these images has become a necessity. Envision seamlessly substituting a tabby cat lounging on a sunlit window sill in a photograph with your own playful puppy, all while preserving the original charm and composition of the image. We present Photoswap, a novel approach that enables this immersive image editing experience through personalized subject swapping in existing images. Photoswap first learns the visual concept of the subject from reference images and then swaps it into the target image using pre-trained diffusion models in a training-free manner. We establish that a well-conceptualized visual subject can be seamlessly transferred to any image with appropriate self-attention and cross-attention manipulation, maintaining the pose of the swapped subject and the overall coherence of the image. Comprehensive experiments underscore the efficacy and controllability of Photoswap in personalized subject swapping. Furthermore, Photoswap significantly outperforms baseline methods in human ratings across subject swapping, background preservation, and overall quality, revealing its vast application potential, from entertainment to professional editing.

Motivation & Objective

  • Introduce a framework for personalized subject swapping in images.
  • Learn a target subject from reference images using a diffusion model without training at test time.
  • Transfer source image attention components to guide seamless subject replacement.
  • Preserve the pose and overall composition while inserting the reference subject.
  • Demonstrate effectiveness via extensive experiments and human evaluations.

Proposed method

  • Learn the target subject O_t from reference images using DreamBooth or similar concept learning to create a special token.
  • Fine-tune a pre-trained diffusion model to incorporate the new concept without test-time fine-tuning of the entire model.
  • In the source image generation, extract self-attention M, self-attention output phi, and cross-attention A, and later swap these intermediate variables into the target image generation process.
  • During early diffusion steps, replace phi, M, and A with their source-image counterparts while keeping the cross-attention output psi from the target prompt fixed to preserve the target identity.
  • Use an enhanced DDIM inversion with null-text optimization for real images to obtain a reliable starting noise z_T.
  • Control the swap via step parameters (lambda_phi, lambda_M, lambda_A) to balance layout preservation and subject identity.
  • Provide a training-free algorithm (Algorithm 1) for performing attention swapping without fine-tuning the entire diffusion model.

Experimental results

Research questions

  • RQ1Can a well-conceptualized visual subject be seamlessly transferred to a target image while preserving pose and image coherence?
  • RQ2To what extent can training-free attention manipulation in diffusion models enable personalized subject swapping using reference images?
  • RQ3How do different attention components (phi, M, A) contribute to layout preservation and identity transfer?
  • RQ4What is the impact of concept learning method (DreamBooth vs Text Inversion) on swapping quality?
  • RQ5How does Photoswap perform compared with baseline methods in human evaluations on subject swapping, background preservation, and overall quality?

Key findings

  • Photoswap enables seamless subject swapping with preserved pose and overall image coherence across synthetic and real images.
  • In human evaluations, Photoswap outperforms P2P+DreamBooth across subject swapping, background preservation, and overall quality (e.g., 50.8% vs 28.0% for overall quality).
  • Swapping self-attention outputs (phi) yields stronger layout control than cross-attention alone, and early initiation of swaps is crucial for maintaining original image layout.
  • Cross-attention maps (A) aid layout but can leak prompt information if swapped too aggressively; maintaining target identity requires keeping psi fixed from the target prompt.
  • DreamBooth-based concept learning proves effective; Text Inversion can also work but may underperform for complex subjects like faces.
  • Photoswap demonstrates robustness across multi-subject and occluded-subject scenarios, and can handle real images with inversion.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.