Stable Flow: Vital Layers for Training-Free Image Editing

Omri Avrahami, Or Patashnik, Ohad Fried, Egor Nemchinov, Kfir Aberman +2 more
11/21/2024
cs.CVcs.GRcs.LG

No official code found. Best implementation: snap-research/stable-flow (409 stars, last commit 2025-06-08).

Abstract

Diffusion models have revolutionized the field of content synthesis and editing. Recent models have replaced the traditional UNet architecture with the Diffusion Transformer (DiT), and employed flow-matching for improved training and sampling. However, they exhibit limited generation diversity. In this work, we leverage this limitation to perform consistent image edits via selective injection of attention features. The main challenge is that, unlike the UNet-based models, DiT lacks a coarse-to-fine synthesis structure, making it unclear in which layers to perform the injection. Therefore, we propose an automatic method to identify "vital layers" within DiT, crucial for image formation, and demonstrate how these layers facilitate a range of controlled stable edits, from non-rigid modifications to object addition, using the same mechanism. Next, to enable real-image editing, we introduce an improved image inversion method for flow models. Finally, we evaluate our approach through qualitative and quantitative comparisons, along with a user study, and demonstrate its effectiveness across multiple applications. The project page is available at https://omriavrahami.com/stable-flow

View on arXivView PDF

Code Implementations(1)

Official implementation for "Stable Flow: Vital Layers for Training-Free Image Editing" [CVPR 2025]

40926PythonJan 22, 20251 years agoNOASSERTION
deep-learningdiffusion-modelsflow-modelsgenerative-aiimage-editing+2 more

Similar Papers

Cite this paper

@article{avrahami2024stable,
  title  = {Stable Flow: Vital Layers for Training-Free Image Editing},
  author = {Omri Avrahami and Or Patashnik and Ohad Fried and Egor Nemchinov and Kfir Aberman and Dani Lischinski and Daniel Cohen-Or},
  year   = {2024},
  eprint = {2411.14430},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.14430v2},
  journal = {CVPR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.14430.svg)](https://codeofpaper.com/paper/2411.14430)

Discussion