Codex Claude Sonnet 4.6 commited on
Commit
0df3422
Β·
1 Parent(s): 166350a

Add full article + README links section with all sponsor/model URLs

Browse files

docs/article.md: public-facing article covering the product story,
each sponsor's contribution (OpenBMB, Black Forest Labs, HF), the
Tiny Titan philosophy, and character-consistency approach.

README: new Links table with live Space, article, Field Notes,
GitHub source, and direct links to all three model pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (2) hide show
  1. README.md +14 -0
  2. docs/article.md +144 -0
README.md CHANGED
@@ -33,6 +33,20 @@ Built for the **Build Small Hackathon 2026 Β· Adventure in Thousand Token Wood**
33
 
34
  ---
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  ## ✨ What it does
37
 
38
  1. **Draw & upload** a character (upload or webcam).
 
33
 
34
  ---
35
 
36
+ ## πŸ”— Links
37
+
38
+ | | |
39
+ |---|---|
40
+ | πŸš€ **Live Space** | [huggingface.co/spaces/build-small-hackathon/DoodleBook](https://huggingface.co/spaces/build-small-hackathon/DoodleBook) |
41
+ | πŸ“ **Article / Blog Post** | [docs/article.md](docs/article.md) |
42
+ | πŸ”¬ **Field Notes** (technical deep-dive) | [docs/blog.md](docs/blog.md) |
43
+ | πŸ’» **Source code** | [github.com/Sushruths04/Doodle-book](https://github.com/Sushruths04/Doodle-book) |
44
+ | πŸ€– **MiniCPM5-1B** (story) | [huggingface.co/openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B) |
45
+ | πŸ”Š **VoxCPM2** (narration) | [huggingface.co/openbmb/VoxCPM2](https://huggingface.co/openbmb/VoxCPM2) |
46
+ | 🎨 **FLUX.2-klein-4B** (illustration) | [huggingface.co/black-forest-labs/FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B) |
47
+
48
+ ---
49
+
50
  ## ✨ What it does
51
 
52
  1. **Draw & upload** a character (upload or webcam).
docs/article.md ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DoodleBook: A Child's Crayon Drawing Becomes a Narrated Storybook
2
+
3
+ *Built for the Build Small Hackathon 2026 Β· Adventure in Thousand Token Wood*
4
+
5
+ ---
6
+
7
+ 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.
8
+
9
+ > **Try it now β†’** [huggingface.co/spaces/build-small-hackathon/DoodleBook](https://huggingface.co/spaces/build-small-hackathon/DoodleBook)
10
+
11
+ ---
12
+
13
+ ## What DoodleBook Does
14
+
15
+ The flow is three taps:
16
+
17
+ 1. **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.
18
+ 2. **Pick a theme** β€” brave adventure, making a new friend, overcoming a fear, and more.
19
+ 3. **Tap "Make my book!"**
20
+
21
+ DoodleBook then:
22
+
23
+ - **Writes** a complete six-page story where the character in the drawing is the hero
24
+ - **Illustrates** every page in a crayon storybook style β€” keeping **the same character** across all six scenes
25
+ - **Narrates** the whole story aloud in a warm, child-friendly voice
26
+ - **Exports** a printable **Story PDF** and a matching **Coloring Book PDF** ready to print
27
+
28
+ The sample book loads the moment you open the Space, so you see the quality before waiting for GPU time.
29
+
30
+ ---
31
+
32
+ ## The "Tiny Titan" Philosophy
33
+
34
+ The hackathon theme is *Build Small* β€” and we took that seriously.
35
+
36
+ The *reasoning* behind DoodleBook β€” writing the story, planning the scenes, narrating the book β€” is done by a **~3 billion parameter model stack**:
37
+
38
+ | What it does | Model | Size |
39
+ |---|---|---|
40
+ | Writes the story + scene plan | MiniCPM5-1B | **1 B** |
41
+ | Reads the story aloud | VoxCPM2 | **2 B** |
42
+ | Illustrates the pages | FLUX.2-klein | 4 B |
43
+
44
+ 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.
45
+
46
+ ---
47
+
48
+ ## The Hard Part: One Hero, Six Pages
49
+
50
+ 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.
51
+
52
+ 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**:
53
+
54
+ 1. 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.
55
+ 2. 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.
56
+ 3. A locked seed and a fixed character description provide a second identity anchor and make every book reproducible.
57
+
58
+ The child's drawing is the source of truth. A cat doodle becomes a cat hero. A robot becomes a robot. No training required.
59
+
60
+ For the full technical write-up: **[Field Notes: Cross-Page Character Consistency β†’](blog.md)**
61
+
62
+ ---
63
+
64
+ ## The Coloring Book: Redraw, Don't Trace
65
+
66
+ 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.
67
+
68
+ 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.
69
+
70
+ ---
71
+
72
+ ## Sponsors Who Made DoodleBook Possible
73
+
74
+ ### OpenBMB β€” The Brain
75
+
76
+ **[OpenBMB](https://huggingface.co/openbmb)** builds the MiniCPM family of small language models and the VoxCPM voice models. Two of their models power the reasoning core of DoodleBook:
77
+
78
+ **[MiniCPM5-1B](https://huggingface.co/openbmb/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.
79
+
80
+ **[VoxCPM2](https://huggingface.co/openbmb/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.
81
+
82
+ 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.
83
+
84
+ ---
85
+
86
+ ### Black Forest Labs β€” The Illustrator
87
+
88
+ **[Black Forest Labs](https://huggingface.co/black-forest-labs)** built the FLUX family of image models. DoodleBook uses:
89
+
90
+ **[FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/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.
91
+
92
+ 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.
93
+
94
+ 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.
95
+
96
+ ---
97
+
98
+ ### Hugging Face β€” The Stage
99
+
100
+ **[Hugging Face Spaces](https://huggingface.co/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.
101
+
102
+ 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**.
103
+
104
+ ---
105
+
106
+ ## Open Trace
107
+
108
+ Every book DoodleBook produces is fully reproducible. Open **"Behind the magic β†’ Trace"** in the app and you get:
109
+
110
+ - The locked **seed** (same seed + inputs β†’ same book)
111
+ - The **per-page scene plan** and prompts
112
+ - The exact **model IDs** used
113
+ - **Stage timings**: story / illustrations / narration / PDF / coloring
114
+ - Any fallback reasons β€” nothing is silent
115
+
116
+ This is the hackathon's **Open Trace** badge in practice: full transparency into every generation.
117
+
118
+ ---
119
+
120
+ ## Try It
121
+
122
+ **Live Space:** [huggingface.co/spaces/build-small-hackathon/DoodleBook](https://huggingface.co/spaces/build-small-hackathon/DoodleBook)
123
+
124
+ Open the Space β€” a real sample book loads instantly. Then upload a drawing, pick a theme, and make your book.
125
+
126
+ **Source code:** [github.com/Sushruths04/Doodle-book](https://github.com/Sushruths04/Doodle-book)
127
+
128
+ **Technical Field Notes:** [Cross-page character consistency without per-user training β†’](blog.md)
129
+
130
+ ---
131
+
132
+ ## The Stack at a Glance
133
+
134
+ | Layer | Technology | Sponsor |
135
+ |---|---|---|
136
+ | Story writing | [MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B) | OpenBMB |
137
+ | Narration | [VoxCPM2](https://huggingface.co/openbmb/VoxCPM2) | OpenBMB |
138
+ | Illustration + line art | [FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B) | Black Forest Labs |
139
+ | Hosting + GPU | [HF Spaces + ZeroGPU](https://huggingface.co/spaces) | Hugging Face |
140
+ | UI framework | [Gradio 6](https://www.gradio.app) | Hugging Face |
141
+
142
+ ---
143
+
144
+ *DoodleBook was built for the **Build Small Hackathon 2026 Β· Adventure in Thousand Token Wood**. Apache-2.0 licensed.*