t2i300m

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.

samples

Uncurated: the first and only sample for each prompt (seed 2026, 30 steps, guidance 4.5).

Try it

  • In your browser: open 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.
  • From the command line:
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 Python:
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")

Model

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.

Training

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
  • Data: jackyhate/text-to-image-2M (MIT), about 2M captioned images. Latents were pre-encoded on Kaggle T4s.
  • Compute: about 15.5 TPU-hours plus about 19 T4-hours of latent pre-encoding, all on Kaggle's free tier.
  • Optimizer: AdamW (β 0.9/0.95, weight decay 0.03), LR 2e-4 then 1e-4, gradient clip 1.0, 10% caption dropout for CFG.
  • The code is plain JAX, including the T5 encoder.

What it's good at

  • Photo-like scenes: food, landscapes, gardens, animals, moody lighting and depth of field.
  • Creatures and fantasy: monsters, dragons, concept-art looks.
  • Styles: watercolor, oil painting, digital art, pixel art.
  • Clean letterforms: individual letters come out crisp.

Limitations

  • Spelling: it draws clean letters but scrambles words ("HELLO" can come out as "HLETO"). T5 sees word pieces, not letters.
  • Composition and relations: prepositions and actions ("X next to Y", "a lighthouse keeper with a pipe") can lose the subject to the scene.
  • Hands and faces can be slightly warped.
  • Known characters: it learned well-known characters and brands from the data. Those are other people's trademarks and IP.
  • Bias: it reflects the biases of its training data.

Files

  • model.safetensors: DiT weights (EMA, fp32)
  • config.json: architecture, latent normalization stats, training summary
  • t2i300m.py: inference code (JAX + diffusers DC-AE decoder) and CLI
  • t2i300m_colab.ipynb: Colab notebook with the app UI
  • samples/: the images above

License

Apache-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).

Downloads last month
52
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train SmallAICreator/t2i300m