tonights-tale / README.md
Zhenzewu's picture
Upload folder using huggingface_hub
2a5d3f5 verified
|
Raw
History Blame Contribute Delete
2.43 kB

A newer version of the Gradio SDK is available: 6.20.0

Upgrade
metadata
title: Tonight's Tale
emoji: πŸŒ™
colorFrom: indigo
colorTo: pink
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
license: apache-2.0
models:
  - Qwen/Qwen3.5-4B
  - Tongyi-MAI/Z-Image-Turbo
  - hexgrad/Kokoro-82M
tags:
  - build-small-hackathon
short_description: Turn your child's day into an illustrated bedtime story

πŸŒ™ Tonight's Tale β€” Build Small Hackathon (Backyard AI track)

The real problem (mine, every single night): my kid had a rough moment today β€” wouldn't share toys, quarreled with a friend. Lecturing a 4-year-old at bedtime doesn't work. But a story about a little rabbit facing the same dilemma? That works.

What it does: describe what happened in your child's day. The app weaves it into an illustrated, narrated fairy tale starring your child's favorite recurring characters β€” with choice points the child decides. A "wrong" turn leads to a gentle, recoverable setback ending; then you rewind together: "what if we'd chosen differently?" β€” and replay the other branch to a warm ending. The moral is shown only to the parent; the story itself never preaches.

Small models, big adventure (β‰ˆ10B total, ≀ 32B βœ“)

Job Model Size
Story writing (zh/en/de/fr, branching, JSON) Qwen/Qwen3.5-4B 4B
Watercolor illustrations Tongyi-MAI/Z-Image-Turbo 6B
Bedtime narration hexgrad/Kokoro-82M 0.08B

Living with small-model limitations is the engineering core here, hardened on a 4GB-VRAM laptop before this Space existed: schema-in-prompt JSON generation with balanced-brace extraction, tolerant output normalization, business-invariant validation with corrective retries, and "soft issues" that retry once then accept. Character visual consistency uses fixed English appearance descriptions + one seed per story β€” no adapters needed.

Try it (10 seconds)

The cast is pre-filled. Just type what happened today β€” e.g. "Didn't want to share toys at kindergarten and quarreled with a best friend" β€” and press Weave tonight's story. Make a choice when the story pauses. If you land on the rainy ending, go back and try the other path. πŸŒ§οΈβ†’πŸŒ™

Run locally without any GPU: STORY_MOCK=1 python app.py (mock story/images/audio, full UI flow).