https://github.com/bytedance/deadiff

[CVPR 2024] Official implementation of "DEADiff: An Efficient Stylization Diffusion Model with Disentangled Representations"

https://github.com/bytedance/deadiff

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, scholar.google
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

[CVPR 2024] Official implementation of "DEADiff: An Efficient Stylization Diffusion Model with Disentangled Representations"

Basic Info
  • Host: GitHub
  • Owner: bytedance
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 12.9 MB
Statistics
  • Stars: 260
  • Watchers: 12
  • Forks: 10
  • Open Issues: 21
  • Releases: 0
Created over 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

DEADiff: An Efficient Stylization Diffusion Model with Disentangled Representations (CVPR 2024)

            _**[Tianhao Qi*](https://github.com/Tianhao-Qi/), [Shancheng Fang](https://tothebeginning.github.io/), [Yanze Wu✝](https://tothebeginning.github.io/), [Hongtao Xie✉](https://imcc.ustc.edu.cn/_upload/tpl/0d/13/3347/template3347/xiehongtao.html), [Jiawei Liu](https://scholar.google.com/citations?user=X21Fz-EAAAAJ&hl=en&authuser=1),
[Lang Chen](https://scholar.google.com/citations?user=h5xex20AAAAJ&hl=zh-CN), [Qian He](https://scholar.google.com/citations?view_op=list_works&hl=zh-CN&authuser=1&user=9rWWCgUAAAAJ), [Yongdong Zhang](https://scholar.google.com.hk/citations?user=hxGs4ukAAAAJ&hl=zh-CN)**_

(*Works done during the internship at ByteDance, ✝Project Lead, ✉Corresponding author) From University of Science and Technology of China and ByteDance.

🔆 Introduction

TL;DR: We propose DEADiff, a generic method facilitating the synthesis of novel images that embody the style of a given reference image and adhere to text prompts.

⭐⭐ Stylized Text-to-Image Generation.

Stylized text-to-image results. Resolution: 512 x 512. (Compressed)

⭐⭐ Style Transfer.

Style transfer results with ControlNet.

📝 Changelog

  • [2024.4.3]: 🔥🔥 Release the inference code and pretrained checkpoint.
  • [2024.3.5]: 🔥🔥 Release the project page.

⏳ TODO

  • [x] Release the inference code.
  • [ ] Release training data.

⚙️ Setup

bash conda create -n deadiff python=3.9.2 conda activate deadiff conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia pip install git+https://github.com/salesforce/LAVIS.git@20230801-blip-diffusion-edit pip install -r requirements.txt pip install -e .

💫 Inference

1) Download the pretrained model from Hugging Face and put it under ./pretrained/. 2) Run the commands in terminal. python3 python3 scripts/app.py The Gradio app allows you to transfer style from the reference image. Just try it for more details.

Prompt: "A curly-haired boy" p

Prompt: "A robot" p

Prompt: "A motorcycle" p

➕ Style Transfer with ControlNet

We support style transfer with structural control by combining DEADiff with ControlNet. This enables users to guide the spatial layout (e.g., edges or depth maps) of the generated images, while transferring the visual style from a reference image.

To perform style transfer with ControlNet, please download the following pretrained models: - control_sd15_canny.pth: Download → place it under ./pretrained/ - control_sd15_depth.pth: Download → place it under ./pretrained/ - dpt_hybrid-midas-501f0c75.pt (for depth estimation): Download → place it under ldm/controlnet/annotator/ckpts/ These checkpoints are required for Canny and Depth-based ControlNet stylization modes. Then run the following commands in terminal. ```python3

Canny-based control

python3 scripts/appcannycontrol.py ```

```python3

Depth-based control

python3 scripts/appdepthcontrol.py ```

📢 Disclaimer

We develop this repository for RESEARCH purposes, so it can only be used for personal/research/non-commercial purposes.


✈️ Citation

bibtex @article{qi2024deadiff, title={DEADiff: An Efficient Stylization Diffusion Model with Disentangled Representations}, author={Qi, Tianhao and Fang, Shancheng and Wu, Yanze and Xie, Hongtao and Liu, Jiawei and Chen, Lang and He, Qian and Zhang, Yongdong}, journal={arXiv preprint arXiv:2403.06951}, year={2024} }

📭 Contact

If your have any comments or questions, feel free to contact qth@mail.ustc.edu.cn

Owner

  • Name: Bytedance Inc.
  • Login: bytedance
  • Kind: organization
  • Location: Singapore

GitHub Events

Total
  • Issues event: 5
  • Watch event: 54
  • Issue comment event: 7
  • Fork event: 4
Last Year
  • Issues event: 5
  • Watch event: 54
  • Issue comment event: 7
  • Fork event: 4

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 7
  • Total Committers: 1
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Tianhao-Qi q****a@f****m 7
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 23
  • Total pull requests: 0
  • Average time to close issues: 23 days
  • Average time to close pull requests: N/A
  • Total issue authors: 21
  • Total pull request authors: 0
  • Average comments per issue: 2.04
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 17
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 15
  • Pull request authors: 0
  • Average comments per issue: 1.88
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fumoab (1)
  • pashanitw (1)
  • loboere (1)
  • ZouShilong1024 (1)
  • hanggun (1)
  • FlyingCan (1)
  • srymaker (1)
  • nancy6o6 (1)
  • thuwyh2003 (1)
  • 3BPM (1)
  • XiaojieGan (1)
  • Pomelover (1)
  • WonwoongCho (1)
  • Lshiii (1)
  • donahowe (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • PyYAML ==6.0
  • accelerate ==0.20.3
  • albumentations ==0.4.3
  • bson *
  • click ==8.1.3
  • decord *
  • diffusers ==0.16.0
  • easydict ==1.10
  • einops ==0.4.1
  • einops-exts ==0.0.3
  • entmax ==1.1
  • fairscale ==0.4.6
  • ftfy ==6.1.1
  • gradio ==3.50.2
  • httpx ==0.23.3
  • imageio ==2.9.0
  • imageio-ffmpeg ==0.4.2
  • invisible-watermark ==0.1.5
  • iopath *
  • ipykernel ==6.16.2
  • jupyter ==1.0.0
  • k-diffusion ==0.0.12
  • kornia ==0.6.8
  • lmdb ==1.4.0
  • matplotlib ==3.5.3
  • ninja ==1.10.0
  • notebook ==6.5.2
  • numpy ==1.22.0
  • omegaconf ==2.1.1
  • onnxruntime-gpu ==1.10.0
  • open_clip_torch ==2.7.0
  • opencv-python-headless ==4.6.0.66
  • pandas ==1.3.5
  • pudb ==2019.2
  • pycocoevalcap *
  • pylint ==2.10.2
  • pytorch_lightning ==1.8.6
  • safetensors ==0.4.2
  • scikit-image ==0.19.3
  • scipy ==1.7.3
  • spacy *
  • streamlit >=0.73.1
  • submitit ==1.4.5
  • test-tube >=0.7.5
  • thop ==0.1.1.post2209072238
  • timm ==0.5.4
  • torch-fidelity ==0.3.0
  • torchmetrics >=0.7.0
  • tqdm ==4.64.1
  • transformers ==4.28.0
  • webdataset *
  • xformers ==0.0.17
setup.py pypi
  • numpy *
  • torch *
  • tqdm *