Update README.md
Browse files
README.md
CHANGED
|
@@ -7,7 +7,7 @@ pipeline_tag: text-to-image
|
|
| 7 |
tags:
|
| 8 |
- stable-diffusion
|
| 9 |
---
|
| 10 |
-
# 🧩 TokenCompose
|
| 11 |
|
| 12 |
[TokenCompose_SD21_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-v2-1**](https://huggingface.co/stabilityai/stable-diffusion-2-1) checkpoint at resolution 768x768 on the [VSR](https://github.com/cambridgeltl/visual-spatial-reasoning) split of [COCO image-caption pairs](https://cocodataset.org/#download) for 32,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 |
|
|
@@ -19,7 +19,7 @@ We strongly recommend using the [🤗Diffuser](https://github.com/huggingface/di
|
|
| 19 |
import torch
|
| 20 |
from diffusers import StableDiffusionPipeline
|
| 21 |
|
| 22 |
-
model_id = "mlpc-lab/
|
| 23 |
device = "cuda"
|
| 24 |
|
| 25 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
|
@@ -31,72 +31,12 @@ image = pipe(prompt).images[0]
|
|
| 31 |
image.save("cat_and_wine_glass.png")
|
| 32 |
```
|
| 33 |
|
| 34 |
-
# ⬆️Improvements over
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 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"> </th> -->
|
| 47 |
-
<th rowspan="2" align="center">Object Accuracy</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"> </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>
|
| 100 |
|
| 101 |
# 📰 Citation
|
| 102 |
Coming soon!
|
|
|
|
| 7 |
tags:
|
| 8 |
- stable-diffusion
|
| 9 |
---
|
| 10 |
+
# 🧩 TokenCompose SD21 Model Card
|
| 11 |
|
| 12 |
[TokenCompose_SD21_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-v2-1**](https://huggingface.co/stabilityai/stable-diffusion-2-1) checkpoint at resolution 768x768 on the [VSR](https://github.com/cambridgeltl/visual-spatial-reasoning) split of [COCO image-caption pairs](https://cocodataset.org/#download) for 32,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 |
|
|
|
|
| 19 |
import torch
|
| 20 |
from diffusers import StableDiffusionPipeline
|
| 21 |
|
| 22 |
+
model_id = "mlpc-lab/TokenCompose_SD21_A"
|
| 23 |
device = "cuda"
|
| 24 |
|
| 25 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
|
|
|
| 31 |
image.save("cat_and_wine_glass.png")
|
| 32 |
```
|
| 33 |
|
| 34 |
+
# ⬆️Improvements over SD21
|
| 35 |
|
| 36 |
+
| Model | Object Accuracy | MG3 COCO | MG4 COCO | MG5 COCO | MG3 ADE20K | MG4 ADE20K | MG5 ADE20K | FID COCO |
|
| 37 |
+
|---------------------|-----------------|----------|----------|----------|------------|------------|------------|----------|
|
| 38 |
+
| SD21 | 47.82 | 70.14 | 25.57 | 3.27 | 75.13 | 35.07 | 7.16 | 19.59 |
|
| 39 |
+
| TokenCompose (SD21) | 60.10 | 80.48 | 36.69 | 5.71 | 79.51 | 39.59 | 8.13 | 19.15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
# 📰 Citation
|
| 42 |
Coming soon!
|