Fluxo Estável: Camadas Vitais para Edição de Imagens sem Treinamento
Stable Flow: Vital Layers for Training-Free Image Editing
November 21, 2024
Autores: Omri Avrahami, Or Patashnik, Ohad Fried, Egor Nemchinov, Kfir Aberman, Dani Lischinski, Daniel Cohen-Or
cs.AI
Resumo
Os modelos de difusão revolucionaram o campo de síntese e edição de conteúdo. Modelos recentes substituíram a arquitetura UNet tradicional pelo Transformador de Difusão (DiT) e empregaram o ajuste de fluxo para melhorar o treinamento e a amostragem. No entanto, eles apresentam uma diversidade de geração limitada. Neste trabalho, aproveitamos essa limitação para realizar edições de imagem consistentes por meio da injeção seletiva de características de atenção. O principal desafio é que, ao contrário dos modelos baseados em UNet, o DiT não possui uma estrutura de síntese de grossa a fina, tornando incerto em quais camadas realizar a injeção. Portanto, propomos um método automático para identificar "camadas vitais" dentro do DiT, cruciais para a formação da imagem, e demonstramos como essas camadas facilitam uma variedade de edições estáveis controladas, desde modificações não rígidas até adição de objetos, usando o mesmo mecanismo. Em seguida, para permitir a edição de imagens reais, introduzimos um método de inversão de imagem aprimorado para modelos de fluxo. Por fim, avaliamos nossa abordagem por meio de comparações qualitativas e quantitativas, juntamente com um estudo de usuários, e demonstramos sua eficácia em várias aplicações. A página do projeto está disponível em https://omriavrahami.com/stable-flow
English
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-flowSummary
AI-Generated Summary