Views
No views yet
1import torch
2from diffusers import StableDiffusionPipeline
3
4model_id = "mlpc-lab/TokenCompose_SD21_A"
5device = "cuda"
6
7pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32)
8pipe = pipe.to(device)
9
10prompt = "A cat and a wine glass"
11image = pipe(prompt).images[0]
12
13image.save("cat_and_wine_glass.png")| Model | Object Accuracy | MG3 COCO | MG4 COCO | MG5 COCO | MG3 ADE20K | MG4 ADE20K | MG5 ADE20K | FID COCO |
|---|---|---|---|---|---|---|---|---|
| SD21 | 47.82 | 70.14 | 25.57 | 3.27 | 75.13 | 35.07 | 7.16 | 19.59 |
| TokenCompose (SD21) | 60.10 | 80.48 | 36.69 | 5.71 | 79.51 | 39.59 | 8.13 | 19.15 |
1@InProceedings{Wang2024TokenCompose,
2 author = {Wang, Zirui and Sha, Zhizhou and Ding, Zheng and Wang, Yilin and Tu, Zhuowen},
3 title = {TokenCompose: Text-to-Image Diffusion with Token-level Supervision},
4 booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
5 month = {June},
6 year = {2024},
7 pages = {8553-8564}
8}