AITTI: Learning Adaptive Inclusive Token for Text-to-Image Generation
Xinyu Hou, Xiaoming Li, Chen Change Loy
Paper | Code | Project Page
This repository hosts all released AITTI inclusive tokens for Stable Diffusion v1.5. Insert an inclusive token in front of a profession (e.g. A photo of a <gender-inclusive> doctor) to obtain more attribute-balanced generations, without fine-tuning the diffusion model.
Available tokens
| Token | Attribute | Folder |
|---|---|---|
<gender-inclusive> |
gender | gender/ |
<race-inclusive> |
race | race/ |
<age-inclusive> |
age | age/ |
Each folder contains:
adaptive_mapping.safetensors— the adaptive token mapping network (~61 MB)learned_embeds.safetensors— the learned inclusive token embeddingconfig.json— token name and default inference settings (e.g.change_step)
Quick start (🧨 Diffusers)
pip install diffusers transformers accelerate safetensors
import torch
from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained(
"stable-diffusion-v1-5/stable-diffusion-v1-5",
custom_pipeline="itsmag11/AITTI", # loads pipeline.py from this repo
trust_remote_code=True,
torch_dtype=torch.float16,
).to("cuda")
token = pipe.load_aitti("gender") # "gender" | "race" | "age" -> "<gender-inclusive>"
image = pipe(f"A photo of a {token} doctor", num_inference_steps=25, guidance_scale=7.5).images[0]
image.save("doctor.png")
load_aitti downloads only the files of the requested token. To switch attributes, simply call pipe.load_aitti("race") / pipe.load_aitti("age") on the same pipeline.
Prompt format. Use the template A photo of a <token> <profession>. The profession (the words directly after the token) is inferred automatically; you can also pass it explicitly, e.g. pipe(prompt, profession_name="software developer").
Download the weights
Web UI: open the Files and versions tab, enter a folder (e.g.
gender/) and click the download icon next to each file.CLI:
hf download itsmag11/AITTI --local-dir checkpoints/AITTI # all tokens hf download itsmag11/AITTI --include "gender/*" --local-dir checkpoints/AITTI # a single tokenPython:
from huggingface_hub import snapshot_download snapshot_download("itsmag11/AITTI", allow_patterns=["gender/*"], local_dir="checkpoints/AITTI")
Local copies can be loaded with pipe.load_aitti("gender", pretrained_model_name_or_path="checkpoints/AITTI").
Evaluation scripts
The evaluation scripts in the GitHub repository load these weights directly from this repo:
git clone https://github.com/itsmag11/AITTI.git && cd AITTI
bash inference/inference_gender.sh # or inference_race.sh / inference_age.sh
Limitations
AITTI tokens were trained and evaluated on single-person profession prompts with Stable Diffusion v1.5, using CLIP-based classifiers over a limited set of attribute categories. Such categories are a simplification of real human diversity, and the tokens may transfer less reliably to other base models or prompt styles.
License
The weights are released under the S-Lab License 1.0 (non-commercial use). They are used with Stable Diffusion v1.5, which is subject to the CreativeML Open RAIL-M License.
Citation
@article{hou2025aitti,
title={AITTI: Learning Adaptive Inclusive Token for Text-to-Image Generation},
author={Hou, Xinyu and Li, Xiaoming and Loy, Chen Change},
journal={International Journal of Computer Vision (IJCV)},
year={2025}
}
Model tree for itsmag11/AITTI
Base model
stable-diffusion-v1-5/stable-diffusion-v1-5