vvictoryuki / FreeDoM

[ICCV 2023] Official PyTorch implementation for the paper "FreeDoM: Training-Free Energy-Guided Conditional Diffusion Model"
260 stars 9 forks source link

FreeDoM 🕊️ (ICCV 2023)

FreeDoM: Training-Free Energy-Guided Conditional Diffusion Model

[Jiwen Yu](https://vvictoryuki.github.io/website/)1, [Yinhuai Wang](https://wyhuai.github.io/info/)1, [Chen Zhao](https://scholar.google.com/citations?user=dUWdX5EAAAAJ)2, [Bernard Ghanem](https://www.bernardghanem.com/)2, [Jian Zhang](https://jianzhang.tech/)1 1 Peking University, 2 KAUST [![arXiv](https://img.shields.io/badge/arXiv-<2303.09833>-.svg)](https://arxiv.org/abs/2303.09833) [![Camera Ready Paper](https://img.shields.io/badge/Paper--red.svg)](https://openaccess.thecvf.com/content/ICCV2023/papers/Yu_FreeDoM_Training-Free_Energy-Guided_Conditional_Diffusion_Model_ICCV_2023_paper.pdf) [![Camera Ready Paper](https://img.shields.io/badge/Supp--blue.svg)](https://openaccess.thecvf.com/content/ICCV2023/supplemental/Yu_FreeDoM_Training-Free_Energy-Guided_ICCV_2023_supplemental.pdf)

News

Todo

Introduction

FreeDoM is a simple but effective training-free method generating results under control from various conditions using unconditional diffusion models. Specifically, we use off-the-shelf pre-trained networks to construct the time-independent energy function, which measures the distance between the given conditions and the intermediately generated images. Then we compute the energy gradient and use it to guide the generation process. FreeDoM supports various conditions, including texts, segmentation maps, sketches, landmarks, face IDs, and style images. FreeDoM applies to different data domains, including human faces, images from ImageNet, and latent codes.

Overall Experimental Configurations

Model Source Data Domain Resolution Original Conditions Additional Training-free Conditions Sampling Time*(s/image)
SDEdit aligned human face $256\times256$ None parsing maps, sketches, landmarks, face IDs, texts ≈20s
guided-diffusion ImageNet $256\times256$ None texts, style images ≈140s
guided-diffusion ImageNet $256\times256$ class label style images ≈50s
Stable Diffusion general images $512\times512$(standard) texts style images ≈84s
ControlNet general images $512\times512$(standard) human poses, scribbles, texts face IDs, style images ≈120s

*The sampling time is tested on a GeForce RTX 3090 GPU card.

Results

Training-free style guidance + Stable Diffusion (click to expand)
Training-free style guidance + Scribble ControlNet (click to expand)
Training-free face ID guidance + Human-pose ControlNet (click to expand)
Training-free text guidance on human faces (click to expand)
Training-free segmentation guidance on human faces (click to expand)
Training-free sketch guidance on human faces (click to expand)
Training-free landmarks guidance on human faces (click to expand)
Training-free face ID guidance on human faces (click to expand)
Training-free face ID guidance + landmarks guidance on human faces (click to expand)
Training-free text guidance + segmentation guidance on human faces (click to expand)
Training-free style transferring guidance + Stable Diffusion (click to expand)
Training-free text-guided face editting (click to expand)

Acknowledgments

Our work is standing on the shoulders of giants. We want to thank the following contributors that our code is based on:

We also introduce some recent works that shared similar ideas by updating the clean intermediate results $\mathbf{x}_{0|t}$:

Citation

If this work is helpful for your research, please consider citing the following BibTeX entry.

@article{yu2023freedom,
title={FreeDoM: Training-Free Energy-Guided Conditional Diffusion Model},
author={Yu, Jiwen and Wang, Yinhuai and Zhao, Chen and Ghanem, Bernard and Zhang, Jian},
journal={Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
year={2023}
}