SYZhang0805 commited on
Commit
262b794
1 Parent(s): 03943ba

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -3
README.md CHANGED
@@ -1,3 +1,73 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: diffusers
4
+ tags:
5
+ - text-to-image
6
+ - stable-diffusion
7
+ - diffusion distillation
8
+
9
+ ---
10
+
11
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63943c882b9483beb473ec25/f8ws6nGK2ZkPEiizha2t9.png)
12
+
13
+ > [**Distribution Backtracking Builds A Faster Convergence Trajectory for One-step Diffusion Distillation**](https://github.com/SYZhang0805/DisBack),
14
+ > *[Shengyuan Zhang](https://github.com/SYZhang0805)<sup>1</sup>, [Ling Yang](https://github.com/YangLing0818)<sup>2</sup>, [Zejian Li*](https://zejianli.github.io/)<sup>1</sup>, An Zhao<sup>1</sup>, Chenye Meng<sup>1</sup>, Changyuan Yang<sup>3</sup>, Guang Yang<sup>3</sup>, Zhiyuan Yang<sup>3</sup>, [Lingyun Sun](https://person.zju.edu.cn/sly)<sup>1</sup>*
15
+ > <sup>1</sup>Zhejiang University <sup>2</sup>Peking University <sup>3</sup>Alibaba Group*
16
+ >
17
+ ## Contact
18
+
19
+ Feel free to contact us if you have any questions about the paper!
20
+
21
+ Shengyuan Zhang [[email protected]](mailto:[email protected])
22
+
23
+ ## Usage
24
+
25
+ For one-step text-to-image generation, DisBack can use the standard diffuser pipeline:
26
+
27
+ ```python
28
+ import torch
29
+ from diffusers import DiffusionPipeline, UNet2DConditionModel, LCMScheduler
30
+ from huggingface_hub import hf_hub_download
31
+
32
+ base_model_id = "stabilityai/stable-diffusion-xl-base-1.0"
33
+ repo_name = "SYZhang0805/DisBack"
34
+ ckpt_name = "SDXL_DisBack.bin"
35
+
36
+ unet = UNet2DConditionModel.from_config(base_model_id, subfolder="unet").to("cuda", torch.float16)
37
+ unet.load_state_dict(torch.load(hf_hub_download(repo_name, ckpt_name), map_location="cuda"))
38
+
39
+ pipe = DiffusionPipeline.from_pretrained(base_model_id, unet=unet, torch_dtype=torch.float16, use_safetensors=True, variant="fp16").to("cuda")
40
+ pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
41
+ prompt="A photo of a dog."
42
+ image=pipe(prompt=prompt, num_inference_steps=1, guidance_scale=0, timesteps=[399], height=1024, width=1024).images[0]
43
+ image.save('output.png', 'PNG')
44
+ ```
45
+
46
+ For more details, please refer to our [github repository](https://github.com/SYZhang0805/DisBack)
47
+
48
+ ## License
49
+
50
+ DisBack is released under [MIT license](https://choosealicense.com/licenses/mit/)
51
+
52
+ ## Citation
53
+ If you find our paper useful or relevant to your research, please kindly cite our papers:
54
+ ```bib
55
+ @article{zhang2024distributionbacktrackingbuildsfaster,
56
+ title={Distribution Backtracking Builds A Faster Convergence Trajectory for One-step Diffusion Distillation},
57
+ author={Shengyuan Zhang and Ling Yang and Zejian Li and An Zhao and Chenye Meng and Changyuan Yang and Guang Yang and Zhiyuan Yang and Lingyun Sun},
58
+ journal={arXiv 2408.15991},
59
+ year={2024}
60
+ }
61
+ ```
62
+
63
+ ## Credits
64
+
65
+ DisBack is highly built on the following amazing open-source projects:
66
+
67
+ [DMD2](https://tianweiy.github.io/dmd2/): Improved Distribution Matching Distillation for Fast Image Synthesis
68
+
69
+ [Diff-Instruct](https://github.com/pkulwj1994/diff_instruct/tree/main): Diff-Instruct: A Universal Approach for Transferring Knowledge From Pre-trained Diffusion Models
70
+
71
+ [ScoreGAN](https://github.com/White-Link/gpm): Unifying GANs and Score-Based Diffusion as Generative Particle Models
72
+
73
+ Thanks to the maintainers of these projects for their contribution to this project!