MCPcopy Index your code
hub / github.com/Monalissaa/DisenDiff

github.com/Monalissaa/DisenDiff @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
277 symbols 857 edges 31 files 23 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DisenDiff

This repository is the official implementation of DisenDiff [CVPR-2024 Oral Presentation].

Attention Calibration for Disentangled Text-to-Image Personalization

Yanbing Zhang, Mengping Yang, Qin Zhou, Zhe Wang

pdf

Datasets

The training images are located in datasets/images, the test prompts are located in datasets/prompts, and the processed images for evaluating image-alignment can be found in datasets/data_eval.

Key modules

The crucial constraints for optimization are implemented in the function p_losses within src/model.py.

Results

Getting Started

conda env create -f environment.yml
conda activate ldm
git clone https://github.com/CompVis/stable-diffusion.git

Fine-tuning

## run training
bash run.sh

## sample and evaluate
bash eval.sh

The run.sh and eval.sh scripts include several hyperparameters such as classes in the input image,data_path, save_path, training caption, random seed, and more. Please modify these executable files to suit your specific requirements.

Contact Us

Yanbing Zhang: zhangyanbing@mail.ecust.edu.cn
Mengping Yang: kobeshegu@gmail.com

BibTeX

@article{zhang2024attention,
  title={Attention Calibration for Disentangled Text-to-Image Personalization},
  author={Zhang, Yanbing and Yang, Mengping and Zhou, Qin and Wang, Zhe},
  journal={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2024}
}

Acknowledgement

Our code is built upon the excellent codebase of Custom-Diffusion, we thank a lot for their work. We also kindly refer interesting researchers to these wonderful relted works:

We also thank the anonymous reviewers for their valuable suggestions during the rebuttal, which greatly help us improve the paper.

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Core symbols most depended-on inside this repo

encode
called by 5
src/custom_modules.py
tokenize
called by 4
utils/clip_eval.py
decode
called by 4
clip/simple_tokenizer.py
_make_layer
called by 4
clip/model.py
isimage
called by 4
src/finetune_data.py
get_image_features
called by 3
utils/clip_eval.py
extract_all_captions
called by 3
utils/clipscore/clipscore.py
multi_head_attention_forward
called by 3
clip/auxilary.py

Shape

Method 145
Function 93
Class 39

Languages

Python100%

Modules by API surface

clip/model.py38 symbols
train.py36 symbols
src/attention_controllers.py21 symbols
src/ptp_utils.py17 symbols
src/model.py17 symbols
utils/clipscore/clipscore.py15 symbols
utils/clip_eval.py14 symbols
src/diffusers_model_pipeline.py11 symbols
src/diffusers_data_pipeline.py10 symbols
src/custom_modules.py10 symbols
clip/simple_tokenizer.py10 symbols
sample.py8 symbols

For agents

$ claude mcp add DisenDiff \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact