DiffMorpher: Unleashing the Capability of Diffusion Models for Image Morphing

Kaiwen Zhang, Yifan Zhou, Xudong Xu, Bo Dai, Xingang Pan

Abstract

Image morphing aims to create smooth, natural transitions between two images. While Generative Adversarial Networks (GANs) have traditionally excelled at this due to their structured latent spaces, Diffusion Models (DMs) often struggle despite their superior generative power. We present DiffMorpher, a novel framework that enables high-fidelity image morphing using pre-trained diffusion models like Stable Diffusion. By interpolating within the parameter space of image-specific LoRAs and employing new attention-steering techniques, DiffMorpher bridges the functional gap between GANs and DMs.

Introduction

Image morphing has been a stronghold for GANs because they possess a "meaningful" latent space where linear interpolation results in smooth semantic changes. In contrast, the latent space of Diffusion Models is essentially a high-dimensional noise map lacking inherent semantic structure. Naively interpolating between the latent noise of two images usually results in "ghosting" artifacts, abrupt content jumps, or flickering textures. DiffMorpher addresses this by harnessing the prior knowledge of a diffusion model to achieve smooth, "rational" transitions.

Methods

The authors propose a multi-faceted approach to force smoothness onto the diffusion process by treating the model's weights as a latent space.

Overview of the DiffMorpher framework, illustrating LoRA training, latent noise interpolation, and self-attention replacement.
  1. LoRA Parameter Interpolation: Instead of just interpolating noise, the authors fit two separate Low-Rank Adaptations (LoRAs) to the source and target images. Because these LoRAs are fine-tuned from the same base model, their parameter spaces are highly correlated. DiffMorpher linearly interpolates between the weights of these two LoRAs to create a "semantic bridge" for the model itself.
  2. Latent Noise & Text Interpolation: The framework uses spherical linear interpolation (slerp) for Gaussian noise maps and linear interpolation for text embeddings.
  3. Self-Attention Interpolation and Replacement: To fix low-level texture flickering, the system extracts Key ($K$) and Value ($V$) matrices from the self-attention layers of the source and target images. During the generation of intermediate frames, it injects an interpolated version of these matrices, allowing intermediate pixels to "query" the structures of both original images.
  4. AdaIN Adjustment: Adaptive Instance Normalization is applied to the interpolated latent noise to ensure color and brightness consistency.
  5. Reschedule Sampling: To ensure a constant rate of visual change, the authors propose a new schedule that uses perceptual distance rather than a naive linear interpolation of the interpolation ratio ($\alpha$).

Experiments and Results

The paper introduces MorphBench, a new benchmark for evaluating image morphing consisting of 90 image pairs divided into Metamorphosis (different categories) and Animation (same object, different states).

Qualitative results showing smooth transitions for artistic portraits, architecture, and animals.

Key Findings

  • Qualitative Superiority: DiffMorpher produces significantly smoother transitions with fewer artifacts (like "double heads") compared to previous diffusion-based methods.
  • Quantitative Gains: On MorphBench, DiffMorpher achieved a significantly lower Perceptual Path Length (PPL) than all other deep-learning-based baselines. In metamorphosis tasks, its PPL was 18.19, compared to 27.80 for standard DDIM.
  • User Preference: In a user study with 800 responses, DiffMorpher was preferred 72.88% of the time over five other state-of-the-art baselines.
  • Efficiency: Training the required LoRAs takes only about 20 seconds per image on an NVIDIA A100.

Discussion and Conclusion

The most profound insight of DiffMorpher is that the LoRA parameter space acts as a more effective "semantic latent space" for diffusion models than the actual noise latents. By blending the model's "knowledge" of the two images, the transition becomes a property of the model's weights. While the method currently requires per-image optimization and accurate text prompts, it represents a significant step forward in generative image manipulation. Future work may involve automating prompt generation or finding ways to perform this interpolation without the need for per-image LoRA training.

Summary updated

BibTeX
@inproceedings{zhang2023diffmorpher,
  author = {Kaiwen Zhang and Yifan Zhou and Xudong Xu and Bo Dai and Xingang Pan},
  title = {{DiffMorpher: Unleashing the Capability of Diffusion Models for Image Morphing}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure