Home

Awesome

<div align="center"> <h1>FreeCustom: Tuning-Free Customized Image Generation for Multi-Concept Composition</h1>

Ganggui Ding*, Canyu Zhao*, Wen Wang*, Zhen Yang, Zide Liu, Hao Chenโ€ , Chunhua Shenโ€ 

(*equal contribution, โ€ corresponding author)

Zhejiang University

CVPR 2024

<a href="https://arxiv.org/abs/2405.13870"> <img src='https://img.shields.io/badge/arxiv-FreeCustom-blue' alt='Paper PDF'></a> <a href="https://aim-uofa.github.io/FreeCustom/"> <img src='https://img.shields.io/badge/Project-Website-orange' alt='Project Page'></a> </div>

๐Ÿ“– Abstract

results_of_multi_concept

<p> Benefiting from large-scale pre-trained text-to-image (T2I) generative models, impressive progress has been achieved in customized image generation, which aims to generate user-specified concepts. Existing approaches have extensively focused on single-concept customization and still encounter challenges when it comes to complex scenarios that involve combining multiple concepts. These approaches often require retraining/fine-tuning using a few images, leading to time-consuming training processes and impeding their swift implementation. Furthermore, the reliance on multiple images to represent a singular concept increases the difficulty of customization. </p> <p> To this end, we propose <b>FreeCustom</b>, a novel tuning-free method to generate customized images of multi-concept composition based on reference concepts, using only one image per concept as input. Specifically, we introduce a new multi-reference self-attention (MRSA) mechanism and a weighted mask strategy that enables the generated image to access and focus more on the reference concepts. In addition, MRSA leverages our key finding that input concepts are better preserved when providing images with context interactions. Experiments show that our method's produced images are consistent with the given concepts and better aligned with the input text. Our method outperforms or performs on par with other training-based methods in terms of multi-concept composition and single-concept customization, but is simpler. </p>

๐Ÿš€ Run

  1. install
conda create -n freecustom python=3.10 -y
conda activate freecustom
pip install -r requirements.txt
  1. run the following command to view the results
python freecustom_stable_diffusion.py

At this point, you can already see the customized results, but you can also try the following two methods:

  1. try another config
  1. prepare your own data

๐ŸŒ„ Demo of customized image generation

multi-concept composition

results_of_multi_concept

single-concept customization

results_of_single_concept

Our method excels at rapidly generating high-quality images with multiple concept combinations and single concept customization, without any model parameter tuning. The identity of each concept is remarkably preserved. Furthermore, our method exhibits great versatility and robustness when dealing with different categories of concepts. This versatility allows users to generate customized images that involve diverse combinations of concepts, catering to their specific needs and preferences. Best viewed on screen.

๐Ÿ—“๏ธ TODO

๐ŸŽซ License

For non-commercial academic use, this project is licensed under the 2-clause BSD License. For commercial use, please contact: Chunhua Shen

๐Ÿ–Š๏ธ BibTeX

If you find this project useful in your research, please consider cite:

@inproceedings{ding2024freecustom,
  title={FreeCustom: Tuning-Free Customized Image Generation for Multi-Concept Composition}, 
  author={Ganggui Ding and Canyu Zhao and Wen Wang and Zhen Yang and Zide Liu and Hao Chen and Chunhua Shen},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2024}
}

๐Ÿ™ Acknowledgements

We thank to Stable Diffusion, MasaCtrl, Grounded-Segment-Anything, HuggingFace, Prompt-to-Prompt, ControlNet

๐Ÿ“ง Contact

If you have any technical comments or questions, please open a new issue or feel free to contact Ganggui Ding