jackyhate/text-to-image-2M
Updated • 8.1k • 198
A 311M-parameter text-to-image diffusion transformer, trained from scratch on two free Kaggle TPU sessions by SmallAICreator (UltraLabs).
512×512 images from a text prompt, in seconds on a GPU.
Uncurated: the first and only sample for each prompt (seed 2026, 30 steps, guidance 4.5).
t2i300m_colab.ipynb in Google Colab and click Runtime → Run all. It runs on the free T4 GPU and comes with a full app UI: 1/2/4 images, Fast/Quality, Stop, full-screen viewer, and Save.pip install -U jax transformers diffusers safetensors huggingface_hub sentencepiece torch pillow
# GPU: pip install -U "jax[cuda12]"
python t2i300m.py "a red fox standing in fresh snow at sunrise" -n 4 -o fox.png
from t2i300m import T2I300M
pipe = T2I300M() # downloads the weights from this repo
images = pipe("a bowl of ramen with a soft boiled egg, studio food photo", n=4, seed=0)
images[0].save("ramen.png")
| Architecture | DiT, PixArt-style: adaLN-single, 2D RoPE, QK-norm, cross-attention to text |
| Size | 311.7M parameters: hidden 1024, 18 layers, 16 heads |
| Latent space | DC-AE f32c32 (frozen): 512px becomes a 16×16×32 latent, so 256 tokens |
| Text encoder | flan-t5-base encoder (frozen), 120 tokens |
| Objective | Rectified flow (velocity prediction), logit-normal timesteps, timestep shift 2 at 512px |
| Sampling | Euler, 30 steps (15 works), classifier-free guidance 4.5 |
| Weights | EMA (decay 0.9998), fp32 safetensors |
The diffusion transformer was trained from random initialization. The text encoder and the autoencoder are frozen pretrained components, the same setup as Imagen, PixArt-α and Sana.
| Stage | Resolution | Steps | Batch | Images seen | Hardware |
|---|---|---|---|---|---|
| 1 | 256px | 40,437 | 2,048 | 82.8M | Kaggle TPU v5e-8 |
| 2 | 512px | 29,719 | 1,024 | 30.4M | Kaggle TPU v5e-8 |
model.safetensors: DiT weights (EMA, fp32)config.json: architecture, latent normalization stats, training summaryt2i300m.py: inference code (JAX + diffusers DC-AE decoder) and CLIt2i300m_colab.ipynb: Colab notebook with the app UIsamples/: the images aboveApache-2.0 for these weights and code. The frozen components keep their own licenses: flan-t5-base (Apache-2.0) and DC-AE (MIT). The training data is jackyhate/text-to-image-2M (MIT).