A text-to-image latent diffusion model trained entirely from scratch on a
laptop. No Stable Diffusion, no CLIP, no pretrained weights of any kind.
13.7M parameters. 14 MB at int8. 186 ms per image on a CPU.
Two variants are included, and the difference between them is the point.
AS-I
AS-I-300
Glyphs it can draw
1254
300
Training samples per glyph
36
150
Final val loss
0.0913
0.0374
Size
14 MB
14 MB
Time per image
186 ms
192 ms
AS-I vs AS-I-300
Top row AS-I, bottom row AS-I-300, same prompts and seed:red heart · pizza · grinning face · cat face · birthday cake ·
hamburger · strawberry · cookie
Identical architecture, identical compute, identical size — 59% lower loss,
and the difference is visible rather than statistical. AS-I-300's strawberry has
seeds and a leaf where AS-I's is a red blob; its cookie has chocolate chips; its
pizza has pepperoni.
A fixed parameter budget buys a fixed amount of detail. Spreading it over 4×
more identities spends it on breadth instead of sharpness. Small models are
not bad models — they are models that have to choose.
Example input and output
AS-I samples
python
1python sample.py --prompt "red heart"2python sample.py --prompt "a large red heart in the center on a black background"3python sample.py --preset AS-I-300--prompt "pizza"
Prompt
What it draws
red heart
a clean, correctly-shaped red heart
soccer ball
black-and-white ball, pentagon pattern intact
rocket
rocket body with fins and nose cone
cat face
orange cat face with ears and whiskers
a small pizza in the top left on a navy background
exactly that
The prompt grammar — this is a closed vocabulary
<name>
a <size> <name> in the <position> on a <bg> background
size small | medium | large
position top left | top | top right | left | center | right
bottom left | bottom | bottom right
bg white | black | navy | grey | cream | teal
Prompt adherence, scored automatically over 120 prompts:
Attribute
AS-I
AS-I-300
background
100%
100%
size
100%
100%
position
88%
93%
What it cannot do
two astronauts playing chess — nothing. It knows emoji names and placement
words. Novel combinations of known words compose fine (pizza in the top left
never appeared in training). Novel concepts do not, and no amount of training
at this size will change that.
Open-domain text-to-image needs ~1B parameters and ~150,000 A100-hours. This is
what the same problem looks like when the budget is a laptop and the rule is
that every weight has to be yours.
Architecture
prompt -> word-level text encoder (0.45M params, trained here, NOT CLIP)
-> cross-attention U-Net (13.2M) on a 16x16x4 latent, 8 DDIM steps
-> VAE decoder -> 64x64 image
No codebook. The obvious reference (RQ-VAE, arXiv:2203.01941)
spends 16,384 codes × 256 dims × 4 quantizers ≈ 16.8M params — about 67 MB —
on lookup tables alone, more than this entire model. A continuous 4-channel
latent needs no table.
4× downsampling, not 8×. Stable Diffusion uses 8×, but it applies that to
512px images and lands on a 64×64 latent. Applying 8× to a 64px image lands on
8×8 — the same ratio with 64× fewer cells — and reconstructs a rainbow as a
brown smear at 21.7 dB. At 4× it is 26.3 dB and colour survives.