SADIK Image AI — Tiny DDPM v1

A genuine text-conditioned diffusion model trained from scratch on a CPU. It contains no Stable Diffusion, SDXL or FLUX weights. It is the first published model from the SADIK IMAGE AI local image studio.

This is a small research/demo model: 64 × 64 pixels, 12.27 M parameters, trained on eight synthetic shape concepts. It is not a photorealistic image generator and should not be presented as one.

600-step DDPM sample

Prompt: “a cyan star on a deep purple background”, seed 1234, DDPM 600 steps. The output is an abstract colour study, not a crisp star — see the full grid below.

Model summary

Field Value
Architecture Pixel-space UNet2DConditionModel with cross-attention
Parameters 12,274,371 (12.27 M)
Resolution 64 × 64
Conditioning Learned word embeddings, 34-token vocabulary, 32-token context
Diffusion DDPM, 1,000 train timesteps, linear beta schedule, epsilon prediction
Sampler DDPM (default, 400 steps) · DDIM also supported
Precision float32
License Apache-2.0
Language English captions

Training run

Field Value
Dataset 192 synthetic images, 8 shape classes, generated with Pillow
Split 173 train / 19 validation, 64 × 64
Steps 1,200
Batch size 8
Optimizer AdamW, lr 2e-4, weight decay 0.01, betas (0.9, 0.99)
Gradient clipping 1.0
Hardware Intel Core i5-6500T, 4 cores, 16 GB RAM, no CUDA
Final validation loss 0.0052 (step 1,200)
Average training loss (last 50 steps) 0.0109
Wall-clock time 89 minutes (5,340 s)
Checkpoint tiny_model.pt (46.9 MiB, float32, split into parts for upload)

The loss curve, CSV log and step samples are included in this repository. Training used the same code path as the desktop app's Training page and supports checkpoint resume.

Samples

Final sample grid

The 4×2 grid was generated from the published float32 checkpoint, using the eight training prompts in order, DDPM 400 steps, seeds 1234–1241. Results are deliberately not cherry-picked: some prompts keep their colour family (yellow square, orange moon, magenta heart) while others collapse to the dataset's average pink/purple. Shapes are abstract blobs. This is the real output of a 12.27 M parameter model trained for 89 minutes on four CPU cores, and the model card does not claim otherwise.

Individual images are in samples/:

File Prompt Seed
red-circle.png a red circle on a dark blue background 1234
green-triangle.png a green triangle on a black background 1235
yellow-square.png a yellow square on a navy background 1236
cyan-star.png a cyan star on a deep purple background 1237
magenta-heart.png a magenta heart on a dark teal background 1238
orange-moon.png an orange crescent moon on a midnight blue background 1239
white-ring.png a white ring on a charcoal background 1240
pink-diamond.png a pink diamond on a dark green background 1241
cyan-star-600steps.png a cyan star on a deep purple background 1234

Dataset

The dataset is fully synthetic and generated by the script in the SADIK IMAGE AI project (scripts/make_demo_dataset.py). It draws eight concepts with random position, size, colour jitter, vignette and grain:

  1. a red circle on a dark blue background
  2. a green triangle on a black background
  3. a yellow square on a navy background
  4. a cyan star on a deep purple background
  5. a magenta heart on a dark teal background
  6. an orange crescent moon on a midnight blue background
  7. a white ring on a charcoal background
  8. a pink diamond on a dark green background

No third-party images, people, logos or copyrighted characters are included.

Files

File Purpose
tiny_model.pt.part01 … part12 Final state dict (46.9 MiB, float32) split into 4 MiB parts
tiny_model.sha256 SHA-256 of the joined tiny_model.pt
join_model.py Joins the parts and verifies the checksum
model_config.json Architecture and tokenizer dimensions
tokenizer.json Word-level vocabulary learned from the captions
trainer_state.json Final step, loss and run configuration
training_log.csv Per-step loss, learning rate and elapsed time
train.log Timestamped training log including validation checkpoints
loss_plot.png Training loss curve
samples/ Step samples during training, final per-concept samples and the 4×2 grid
sample.py Standalone DDPM/DDIM sampler (PyTorch + Diffusers + Pillow)

The checkpoint is split because the publisher's upstream connection resets on single transfers larger than roughly 25 MB. sample.py joins the parts automatically on first run, or run python join_model.py explicitly.

Quick start

pip install torch diffusers pillow
python sample.py --prompt "a cyan star on a deep purple background" --steps 400 --sampler ddpm --seed 1234 --out star.png

sample.py reads the checkpoint, config and tokenizer from the repository folder. It does not import the desktop application. DDPM is the default because the deterministic DDIM sampler collapses toward a low-contrast mean on this small checkpoint; DDIM still works with --sampler ddim. On the CPU used for training, a 400-step DDPM sample takes about 65 seconds and a 600-step sample about 100 seconds.

Minimal Python:

from PIL import Image
from sample import find_checkpoint, generate

checkpoint = find_checkpoint("path/to/sadik-image-ai-tiny-ddpm")
image: Image.Image = generate(
    checkpoint,
    prompt="an orange crescent moon on a midnight blue background",
    steps=400,
    seed=1234,
    sampler="ddpm",
)
image.save("moon.png")

Use prompts close to the training captions. The model understands the eight concepts above plus their colours and backgrounds; arbitrary prompts will be mapped to the nearest learned concept or produce noise.

Architecture

  • Three down blocks and three up blocks with channel widths 64, 128 and 256.

  • One residual layer per block, attention at 32 × 32 and 16 × 16.

  • Cross-attention dimension 192; 8 attention heads.

  • Learned nn.Embedding token table (34 entries) followed by LayerNorm.

  • Standard DDPM training objective:

    L = E[ || ε - εθ(x_t, t, caption) ||² ]

  • 32-token padded context; padding is masked out of the conditioning.

  • 64 × 64 RGB pixels in [-1, 1]; no VAE.

Intended use

  • Demonstrate a complete, reproducible text-to-image training pipeline.
  • Test the SADIK IMAGE AI dataset, training, checkpoint and sampling code.
  • Teach diffusion fundamentals with a model that trains on a CPU.

Out of scope

  • Photorealism, faces, text rendering or professional artwork.
  • Any resolution other than 64 × 64.
  • Safety filtering. The model only knows synthetic shapes, but it has no classifier-free guidance, safety checker or content filter.
  • Production or commercial image generation.
  • Claims that this model is Stable Diffusion or is based on third-party weights.

Limitations

  • Output is small and simple. At 1,200 steps the final samples are recognisable as colour-conditioned shapes on the trained backgrounds, but they remain abstract blobs rather than crisp geometric icons.
  • Colour adherence depends on the seed: some prompts render in the right colour family (yellow, orange, magenta), while others collapse toward the dataset's average pink/purple. Backgrounds are approximate.
  • Prompt adherence is limited by the 34-word vocabulary and tiny dataset.
  • The model was trained for 1,200 steps on CPU; longer training would improve shape fidelity.
  • No negative prompt or classifier-free guidance is implemented.
  • Colours and backgrounds follow the training captions; unusual combinations are not reliable.
  • The model is deterministic for a fixed seed only on the same PyTorch build and device.

License and attribution

Weights, configuration, tokenizer and sample.py: Apache-2.0, © 2026 Sadik Nawaz AI.

The training dataset is synthetic and generated for this project. No third-party model weights or image datasets were used. The wider SADIK IMAGE AI application downloads third-party base models separately under their own licenses (LCM Dreamshaper v7 — MIT; Tiny SD and SD 1.5 — CreativeML OpenRAIL-M); none of those weights are present in this repository.

Created by Sadik Nawaz AI.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using SadikNawazAI/sadik-image-ai-tiny-ddpm 1