Spaces:
Runtime error
A newer version of the Gradio SDK is available: 6.19.0
title: NumZoo
emoji: π¦
colorFrom: purple
colorTo: pink
sdk: gradio
sdk_version: 6.17.3
app_file: app.py
pinned: false
license: apache-2.0
tags:
- flux
- text-to-image
- kids
- education
- math
- track:backyard
- sponsor:modal
- achievement:offgrid
- achievement:welltuned
- achievement:offbrand
- achievement:fieldnotes
π¦ NumZoo
A mental math app for kids β answer questions, earn cute AI-generated animal images as rewards!
π Built for the π€ Hugging Face "Small Models, Big Adventures" hackathon. A small (4B) image model, fine-tuned with a custom LoRA, turned into a delightful kids' reward loop.
How it works
- Enter your name
- Pick your favourite animals πΎ and places π (used to personalise reward images)
- Answer math questions β every 3 correct answers earns a reward image
- Level up: Additions β Subtractions β Multiplications β Mix
See it in action
βΆοΈ Demo video (Loom) Β· π£ Launch post
Levels
| Level | Operation | Goal |
|---|---|---|
| 1 | β Additions | 5 correct |
| 2 | β Subtractions | 5 correct |
| 3 | βοΈ Multiplications | 5 correct |
| 4 | π² Mix | Endless |
Image model
Rewards are generated with FLUX.2-klein-4B (4B params, Apache 2.0) via π€ Diffusers, plus a custom NumZoo style LoRA (below). Images start generating in the background as soon as the quiz begins, so a reward is usually ready the moment it's earned.
β¨ Custom AI art: the NumZoo LoRA
Out of the box, FLUX.2-klein renders the same prompt in wildly different styles β often photorealistic β which doesn't fit a soft, cozy kids' app. So we fine-tuned a style LoRA that pins every reward to the same kawaii children's-book look.
Before β after (same prompt: "a cute baby panda on a snowy mountain top"):
More rewards from the LoRA:
How we made it
- Dataset β 54 cozy scenes generated with Qwen-Image (12 animals Γ 10 places,
incl. multi-animal/multi-place combos), captioned
NUMZOO. <content>with the style left undescribed so the trigger word carries it. Seescripts/generate_dataset.pyandtraining/for the images + captions. - Training β LoRA (rank 32, 1500 steps) on
FLUX.2-klein-base-4Bvia ostris/ai-toolkit, running on a Modal A100 (~45 min, serverless GPU). Reproducible setup intraining/lora_trainer/. - Inference β the LoRA loads on the distilled 4-step klein in
image_generator.py; the app simply prepends theNUMZOOtrigger to every prompt.
Published LoRA: π€ goumsss/numzoo-flux2-klein-lora
Run locally
Requires Python on Apple Silicon (arm64). Recommended: Miniforge.
# 1. Install dependencies
~/miniforge3/bin/pip install -r requirements.txt
# 2. Accept FLUX.2-klein-4B license on HuggingFace
# β https://huggingface.co/black-forest-labs/FLUX.2-klein-4B
# Then log in:
hf auth login
# 3. Run
~/miniforge3/bin/python3 app.py
# Opens at http://localhost:7860
# First run downloads ~23GB of model weights (cached after that)
On standard Python/pip (non-Apple Silicon):
pip install -r requirements.txt python app.py







