zwcolin commited on
Commit
5f82ed4
·
1 Parent(s): d6016ce

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +89 -2
README.md CHANGED
@@ -7,6 +7,93 @@ pipeline_tag: text-to-image
7
  tags:
8
  - stable-diffusion
9
  ---
10
- # TokenCompose SD14 Model Card
11
 
12
- [TokenCompose_SD14_A](https://mlpc-ucsd.github.io/TokenCompose/) is a [latent text-to-image diffusion model](https://arxiv.org/abs/2112.10752) finetuned from the [**Stable-Diffusion-v1-4**](https://huggingface.co/CompVis/stable-diffusion-v1-4) checkpoint at resolution 512x512 on the [VSR](https://github.com/cambridgeltl/visual-spatial-reasoning) split of [COCO image-caption pairs](https://cocodataset.org/#download) for 24,000 steps with a learning rate of 5e-6. The training objective involves token-level grounding terms in addition to denoising loss for enhanced multi-category instance composition and photorealism.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  tags:
8
  - stable-diffusion
9
  ---
10
+ # 🧩 TokenCompose SD14 Model Card
11
 
12
+ [TokenCompose_SD14_A](https://mlpc-ucsd.github.io/TokenCompose/) is a [latent text-to-image diffusion model](https://arxiv.org/abs/2112.10752) finetuned from the [**Stable-Diffusion-v1-4**](https://huggingface.co/CompVis/stable-diffusion-v1-4) checkpoint at resolution 512x512 on the [VSR](https://github.com/cambridgeltl/visual-spatial-reasoning) split of [COCO image-caption pairs](https://cocodataset.org/#download) for 24,000 steps with a learning rate of 5e-6. The training objective involves token-level grounding terms in addition to denoising loss for enhanced multi-category instance composition and photorealism. The "_A/B" postfix indicates different finetuning runs of the model using the same above configurations.
13
+
14
+ # 🧨Example Usage
15
+
16
+ We strongly recommend using the [🤗Diffuser](https://github.com/huggingface/diffusers) library to run our model.
17
+
18
+ ```python
19
+ import torch
20
+ from diffusers import StableDiffusionPipeline
21
+
22
+ model_id = "mlpc-lab/TokenCompose_SD14_A"
23
+ device = "cuda"
24
+
25
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
26
+ pipe = pipe.to(device)
27
+
28
+ prompt = "A cat and a wine glass"
29
+ image = pipe(prompt).images[0]
30
+
31
+ image.save("cat_and_wine_glass.png")
32
+ ```
33
+
34
+ # ⬆️Improvements over SD14
35
+
36
+ <table>
37
+
38
+ <tr>
39
+ <th rowspan="3" align="center">Method</th>
40
+ <th colspan="9" align="center">Multi-category Instance Composition</th>
41
+ <th colspan="2" align="center">Photorealism</th>
42
+ <th colspan="1" align="center">Efficiency</th>
43
+ </tr>
44
+
45
+ <tr>
46
+ <!-- <th align="center">&nbsp;</th> -->
47
+ <th rowspan="2" align="center">Object Accuray</th>
48
+ <th colspan="4" align="center">COCO</th>
49
+ <th colspan="4" align="center">ADE20K</th>
50
+ <th rowspan="2" align="center">FID (COCO)</th>
51
+ <th rowspan="2" align="center">FID (Flickr30K)</th>
52
+ <th rowspan="2" align="center">Latency</th>
53
+ </tr>
54
+
55
+ <tr>
56
+ <!-- <th align="center">&nbsp;</th> -->
57
+ <th align="center">MG2</th>
58
+ <th align="center">MG3</th>
59
+ <th align="center">MG4</th>
60
+ <th align="center">MG5</th>
61
+ <th align="center">MG2</th>
62
+ <th align="center">MG3</th>
63
+ <th align="center">MG4</th>
64
+ <th align="center">MG5</th>
65
+ </tr>
66
+
67
+ <tr>
68
+ <td align="center"><a href="https://huggingface.co/CompVis/stable-diffusion-v1-4">SD 1.4</a></td>
69
+ <td align="center">29.86</td>
70
+ <td align="center">90.72<sub>1.33</sub></td>
71
+ <td align="center">50.74<sub>0.89</sub></td>
72
+ <td align="center">11.68<sub>0.45</sub></td>
73
+ <td align="center">0.88<sub>0.21</sub></td>
74
+ <td align="center">89.81<sub>0.40</sub></td>
75
+ <td align="center">53.96<sub>1.14</sub></td>
76
+ <td align="center">16.52<sub>1.13</sub></td>
77
+ <td align="center">1.89<sub>0.34</sub></td>
78
+ <td align="center"><u>20.88</u></td>
79
+ <td align="center"><u>71.46</u></td>
80
+ <td align="center"><b>7.54</b><sub>0.17</sub></td>
81
+ </tr>
82
+
83
+ <tr>
84
+ <td align="center"><a href="https://github.com/mlpc-ucsd/TokenCompose"><strong>TokenCompose (Ours)</strong></a></td>
85
+ <td align="center"><b>52.15</b></td>
86
+ <td align="center"><b>98.08</b><sub>0.40</sub></td>
87
+ <td align="center"><b>76.16</b><sub>1.04</sub></td>
88
+ <td align="center"><b>28.81</b><sub>0.95</sub></td>
89
+ <td align="center"><u>3.28</u><sub>0.48</sub></td>
90
+ <td align="center"><b>97.75</b><sub>0.34</sub></td>
91
+ <td align="center"><b>76.93</b><sub>1.09</sub></td>
92
+ <td align="center"><b>33.92</b><sub>1.47</sub></td>
93
+ <td align="center"><b>6.21</b><sub>0.62</sub></td>
94
+ <td align="center"><b>20.19</b></td>
95
+ <td align="center"><b>71.13</b></td>
96
+ <td align="center"><b>7.56</b><sub>0.14</sub></td>
97
+ </tr>
98
+
99
+ </table>