DoodleBook: A Child's Crayon Drawing Becomes a Narrated Storybook
Built for the Build Small Hackathon 2026 Β· Adventure in Thousand Token Wood
Imagine a child scribbles a robot on a napkin. Wobbly arms, two big eyes, a lightning-bolt antenna. Forty-five seconds later they're holding a six-page illustrated storybook β their robot, in their style, starring in a real adventure β with a narrator's voice reading it aloud. That's DoodleBook.
Try it now β huggingface.co/spaces/build-small-hackathon/DoodleBook
What DoodleBook Does
The flow is three taps:
- Draw something β upload a photo of a drawing, or snap one with the webcam. Anything works: a cat, a dragon, a kid's self-portrait.
- Pick a theme β brave adventure, making a new friend, overcoming a fear, and more.
- Tap "Make my book!"
DoodleBook then:
- Writes a complete six-page story where the character in the drawing is the hero
- Illustrates every page in a crayon storybook style β keeping the same character across all six scenes
- Narrates the whole story aloud in a warm, child-friendly voice
- Exports a printable Story PDF and a matching Coloring Book PDF ready to print
The sample book loads the moment you open the Space, so you see the quality before waiting for GPU time.
The "Tiny Titan" Philosophy
The hackathon theme is Build Small β and we took that seriously.
The reasoning behind DoodleBook β writing the story, planning the scenes, narrating the book β is done by a ~3 billion parameter model stack:
| What it does | Model | Size |
|---|---|---|
| Writes the story + scene plan | MiniCPM5-1B | 1 B |
| Reads the story aloud | VoxCPM2 | 2 B |
| Illustrates the pages | FLUX.2-klein | 4 B |
FLUX is the renderer, not the brain. It prints what the small models decided. That's the Tiny Titan bet: small models drive the product experience; a strong image model just executes the instructions.
The Hard Part: One Hero, Six Pages
The hardest engineering problem in AI storybooks is character consistency. Generate six pages independently and you get six different creatures β different colors, different faces, different proportions. The magic collapses.
We solved it without per-user fine-tuning (LoRA training is minutes-to-hours β impractical for a live demo). Instead, DoodleBook uses a canonical-character pass:
- The child's doodle is run through FLUX img2img once, turning the rough drawing into a single clean "model-sheet" version of the character on a plain background.
- Every one of the six story pages is then rendered with that canonical image as the reference β so the same creature appears in every scene.
- A locked seed and a fixed character description provide a second identity anchor and make every book reproducible.
The child's drawing is the source of truth. A cat doodle becomes a cat hero. A robot becomes a robot. No training required.
For the full technical write-up: Field Notes: Cross-Page Character Consistency β
The Coloring Book: Redraw, Don't Trace
The matching coloring book was trickier than expected. Our first attempt traced the finished crayon pages using classical edge detection β but crayon texture shattered busy backgrounds into speckle. No child could color a page that looked like static.
The fix: hand each finished color page back to FLUX as img2img with a "clean coloring-book line art" prompt. The model redraws clean, colorable outlines that match the composition of the story page β instead of tracing texture, it understands the scene and produces shapes. A tiny local pass then thresholds the result to crisp black-on-white.
Sponsors Who Made DoodleBook Possible
OpenBMB β The Brain
OpenBMB builds the MiniCPM family of small language models and the VoxCPM voice models. Two of their models power the reasoning core of DoodleBook:
MiniCPM5-1B writes the story. Given the character name, a theme, and the child's hero description, MiniCPM5-1B produces a complete structured six-page story with per-page scene descriptions β in a single inference pass. At 1B parameters it is fast enough to run as the first stage in a live demo, and the quality of its structured JSON output is high enough that the story rarely needs a fallback.
VoxCPM2 narrates the book. It runs in parallel with the image generation stage, so the narration audio is typically ready before the illustrations finish β the "narration ready βΆ" status appears mid-generation. VoxCPM2 supports expressive voice design, letting us give the narrator a warm, storytelling tone suited to young listeners.
Together, MiniCPM5-1B and VoxCPM2 are the 3B "brain" of DoodleBook. They turn a drawing and a theme into a complete authored, performed story β before FLUX renders a single pixel.
Black Forest Labs β The Illustrator
Black Forest Labs built the FLUX family of image models. DoodleBook uses:
FLUX.2-klein-4B for every illustration in the book. Klein runs in as few as 6 inference steps at guidance_scale 1.0, which gives us six story-page illustrations and a canonical-character pass in a GPU slot that fits inside ZeroGPU's per-request limit. Despite running fast, the crayon storybook quality is strong: warm textures, clear character shapes, and readable scene composition.
FLUX.2-klein is also the engine for the coloring book pass β the same model that illustrated the story redraws each page as clean line art, keeping the composition consistent between the color book and the coloring book.
Without FLUX.2-klein's speed and quality at 4B, DoodleBook's full pipeline β canonical hero pass + six story pages + optional six coloring pages β would be too slow for a real demo.
Hugging Face β The Stage
Hugging Face Spaces hosts DoodleBook and provides ZeroGPU β free, on-demand GPU time that scales to zero when the Space is idle. The ZeroGPU pattern requires loading models on CUDA at module scope (not inside the request handler), which meant some non-obvious initialization work β but it made the Space fast and cost-free to run publicly.
The Gradio 6 framework provides the product shell. DoodleBook uses a fully custom Gradio Blocks layout with its own CSS, fonts (Gaegu, Caveat, Nunito), SVG filters for hand-drawn wobble borders, and a construction-paper scrapbook aesthetic β zero Gradio defaults visible.
Open Trace
Every book DoodleBook produces is fully reproducible. Open "Behind the magic β Trace" in the app and you get:
- The locked seed (same seed + inputs β same book)
- The per-page scene plan and prompts
- The exact model IDs used
- Stage timings: story / illustrations / narration / PDF / coloring
- Any fallback reasons β nothing is silent
This is the hackathon's Open Trace badge in practice: full transparency into every generation.
Try It
Live Space: huggingface.co/spaces/build-small-hackathon/DoodleBook
Open the Space β a real sample book loads instantly. Then upload a drawing, pick a theme, and make your book.
Source code: github.com/Sushruths04/Doodle-book
Technical Field Notes: Cross-page character consistency without per-user training β
The Stack at a Glance
| Layer | Technology | Sponsor |
|---|---|---|
| Story writing | MiniCPM5-1B | OpenBMB |
| Narration | VoxCPM2 | OpenBMB |
| Illustration + line art | FLUX.2-klein-4B | Black Forest Labs |
| Hosting + GPU | HF Spaces + ZeroGPU | Hugging Face |
| UI framework | Gradio 6 | Hugging Face |
DoodleBook was built for the Build Small Hackathon 2026 Β· Adventure in Thousand Token Wood. Apache-2.0 licensed.