Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
These are the pretrained weights for \<age-inclusive\> token from [AITTI: Learning Adaptive Inclusive Token for Text-to-Image Generation](https://arxiv.org/abs/2406.12805) (IJCV, 2025).
|
| 5 |
+
|
| 6 |
+
Download the weights and load them following the [AITTI inference script](https://github.com/itsmag11/AITTI/blob/main/inference/inference_aitti.py) like:
|
| 7 |
+
|
| 8 |
+
```
|
| 9 |
+
...
|
| 10 |
+
embed_dim = 1024 if args.sd_model == "stabilityai/stable-diffusion-2-1" else 768
|
| 11 |
+
adaptive_mapping = AdaptiveTokenMapping_v1(embed_dim, embed_dim, embed_dim).to(dtype=torch.float16)
|
| 12 |
+
adaptive_mapping.load_state_dict(torch.load(os.path.join(path/to/download/dir, 'adaptive_mapping.safetensors'), map_location=torch.device('cpu')), strict=True)
|
| 13 |
+
pipe = StableDiffusionAdaptiveTokenPipeline.from_pretrained(args.sd_model, adaptive_mapping=adaptive_mapping, torch_dtype=torch.float16).to(device)
|
| 14 |
+
pipe.load_textual_inversion(path/to/download/dir, weight_name='learned_embeds.safetensors', token=args.token_name)
|
| 15 |
+
...
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
If you find our work helpful, please cite:
|
| 19 |
+
```bibtex
|
| 20 |
+
@inproceedings{hou2025aitti,
|
| 21 |
+
title={AITTI: Learning Adaptive Inclusive Token for Text-to-Image Generation},
|
| 22 |
+
author={Hou, Xinyu and Li, Xiaoming and Loy, Chen Change},
|
| 23 |
+
booktitle={International Journal of Computer Vision (IJCV)},
|
| 24 |
+
year={2025}
|
| 25 |
+
}
|
| 26 |
+
```
|