Improve story, narration, and illustration prompts
Codex
67c02d3
Revert layout to original output card; keep timing order only
Codex+1: Claude Sonnet 4.6
d61efd6
book_display and coloring_display back inside the right output column.
The output card layout is restored to: audio → PDF buttons → book pages.
The three-step TIMING remains: audio appears first, then PDF download
button, then book pages — just all within the same column as before.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three-step output order: audio → PDF download → book pages
Codex+1: Claude Sonnet 4.6
3c0a4d2
1. After TTS: audio player appears first (_preparing placeholder in book area)
2. After PDF generated: download button appears (audio stays, book still hidden)
3. Final yield: illustrated book pages appear last
Users hear the narration before they can even see the book, which is the
intended experience. Book pages are the reward after listening.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move book pages below audio: audio always visible first
Codex+1: Claude Sonnet 4.6
e49e280
Audio player + download buttons stay in right column at eye level.
Illustrated storybook pages move to a full-width row below both columns,
so users see and use the narration before scrolling to the book pages.
Added a subtle scroll hint arrow between the two sections.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Yield audio before PDF: narration ready first, then downloads
Codex+1: Claude Sonnet 4.6
9ff3a4b
Add an intermediate yield after TTS completes that surfaces the audio
player and book HTML immediately, before PDF generation begins. The PDF
download button then appears in the next yield once the file is ready.
User can start listening the moment narration is done.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PDF cover: cream card layout matching in-app HTML cover
Codex+1: Claude Sonnet 4.6
620b7e6
Replace full-bleed approach with cream paper background + framed FLUX
illustration (sun inner border, ink outer border) + title below + badge —
identical visual language to the HTML cover shown in the app.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove char name field + page slider; illustrated PDF cover
Codex+1: Claude Sonnet 4.6
786a8ec
- Removed unused 'Character name' input field — only hero name is needed
- Removed 'Number of pages' slider — pages 7-10 generated identical filler
because the model reliably writes 6 pages; fixed at 6 for a complete book
- PDF cover now uses the first FLUX illustration as a full-bleed background
with dark banner overlays for kicker + title + badge, matching the in-app
HTML cover; fallback cream design kept for when no illustration is available
- Both story PDF and coloring PDF use the same illustrated cover system
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix voice recording page freeze: upload-only for custom voice
Codex+1: Claude Sonnet 4.6
7301102
Gradio's in-browser microphone freezes the page on stop-recording due to
client-side audio encoding. Switch to upload-only so users record on their
phone/voice memo app and upload the file — same cloning result, no freeze.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix voice freeze, cover design, output order, story continuity
Codex+1: Claude Sonnet 4.6
ef904db
- Voice cloning (my_voice) now runs sequentially AFTER FLUX images to avoid
ZeroGPU concurrency freeze: two concurrent @spaces.GPU threads caused the
browser to hang whenever the user recorded their voice
- Book cover now shows the first page illustration as a framed artwork above
the title, replacing the plain cream-background placeholder
- PDF downloads moved to the output card (below audio, above book pages) so
the output reads: audio → PDFs → storybook
- Removed 'Story spark' input — the 1B model couldn't reliably follow it
and it produced inconsistent results; input wiring updated (8 → 7 inputs)
- Story prompt rules tightened: explicit continuity requirement (each page
flows from the previous), distinctive hero trait anchoring, and required
lesson phrasing on the final page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix README colorFrom to valid HF color (red)
Codex+1: Codex
3375ac7
Co-Authored-By: Codex <noreply@codex.ai>
Single Storybook tab: remove Bedtime/Kannada, add Custom Voice + page count + 4 new themes
Codex+1: Codex
8d51e7b
- Remove Bedtime Voice tab and all Kannada/translation code (NLLB-200, IndicF5,
MMS-TTS, gTTS) — single Storybook tab now covers all features
- Add Custom Voice (My Voice) option: VoxCPM2 clones user's recorded/uploaded
voice via reference_wav_path; shown only when My Voice is selected
- Add page-count slider 6–10 pages (story, images, and narration all scale)
- Add optional Story Spark input for child-driven themes
- 4 new story themes: kindness to animals, the magic of imagination,
celebrating who you are, a rainy day adventure — each with 3 rich arc variants
- Expand FEW_SHOT exemplar rules for variable page counts
- Raise TTS budget to 180s (preset voices for 10 pages + voice cloning)
- Raise image budget to 200s (up to 10 pages × FLUX)
- Better header with feature strip; remove bedtime CSS (~250 lines)
- Update README with hackathon validator checklist, sponsor model table,
parameter counts (7B total, all under 32B cap), demo/social placeholders
- Remove gtts from requirem…
Kannada was silently failing with no diagnostic info. Three changes:
1. Error surfacing: generate_kannada_gpu now logs each step (translation
success/failure, TTS success/failure) and propagates the actual error
message to the UI status bar so the user can see what's going wrong.
2. 3-tier Kannada TTS in indic_tts.py:
- Tier 1: sush0401/IndicF5-Kannada-Bedtime-v2 (user's fine-tuned model)
- Tier 2: facebook/mms-tts-kan (VITS fallback, GPU)
- Tier 3: gTTS Kannada (Google, no GPU, always works)
Each tier logs its result. Tier 3 guarantees Kannada audio is always
produced regardless of GPU model availability.
3. English audio length: voice-cloning sentence cap raised from 6 to 15
(6 sentences gave ~26s; 15 sentences gives ~1-1.5 minutes of audio).
Co-Authored-By: Codex <noreply@codex.ai>
Improve story quality: richer 2-3 sentence pages, better narration
Codex+1: Codex
3e8abf3
Storybook and bedtime stories were generating 1-2 sentence pages (~1 min
of audio total). This updates all story generation to produce richer,
more emotionally engaging 2-3 sentence pages (~3 min of narration).
Changes:
- FEW_SHOT_EXEMPLAR: rewritten with 2-3 vivid sentences per page,
sensory details, clear story arc (introduce / build / resolve / teach)
- build_story_prompt: rules now ask for 2-3 warm, detailed sentences
with colours, sounds, emotions; clearer arc guidance
- generate_story_gpu: max_new_tokens 800 -> 1200, duration 60s -> 90s
- BEDTIME_FEW_SHOT: rewritten with 2-3 calm, lullaby-paced sentences,
soothing sensory details (moonlight, moss, slow breathing)
- generate_bedtime_story_gpu: rules updated, 800 -> 1200 tokens, 90s
- THEME_TEMPLATES arc A for all 6 themes: rewritten with 2-3 sentence
pages that are vivid, emotional, and meaningful as fallback stories
Co-Authored-By: Codex <noreply@codex.ai>
Fix ZeroGPU model re-download loop causing browser freeze
Codex+1: Codex
782f6e2
Root cause: indic_text.py and indic_tts.py called .to("cuda").eval() as
part of the module-scope assignment (e.g. _model = Model.from_pretrained().to("cuda")).
On ZeroGPU, after startup the runtime deletes 17GB of raw HF cache blobs and
keeps only its packed tensor format. When these assignments failed (because
the .to("cuda") chain prevents the variable from being set), _model/_mms_model
stayed None. At inference time, from_pretrained() tried to load from the
deleted HF cache, triggering a full re-download inside the GPU window -> hang.
Fix: load both NLLB-200 and MMS-TTS-Kan to CPU at module scope (no .to("cuda")),
so ZeroGPU packs their tensors along with the main models. Inside @spaces.GPU
functions, call model.to("cuda") so ZeroGPU transfers the pre-packed tensors
to GPU without any re-download.
Also reduce voice-cloning sentence cap from 10 to 6 (6 x ~15s = 90s, well
within the 180s GPU budget).
Co-Authored-By: Codex <noreply@codex.ai>
Fix Bedtime Voice tab hanging when voice clip submitted
Codex+1: Codex
82a3f36
Three root causes fixed:
1. Invalid VoxCPM2 kwargs caused silent English TTS crash: normalize=True,
retry_badcase=True, retry_badcase_max_times=3 are not valid params in
voxcpm==2.0.3. Removed all three; kept only reference_wav_path for
voice cloning. Also removed denoise=True (uncertain in 2.0.3).
2. Voice cloning GPU timeout: processing 20+ sentences through VoxCPM2
voice cloning far exceeds the 120s limit. Cap at 10 sentences when
ref_wav is present; increase duration to 180s.
3. Kannada GPU timeout: translating+narrating the full 6-page story
through NLLB-200+IndicF5/MMS-TTS exceeds 120s. Now pass condensed
text (title + first 3 pages) to generate_kannada_gpu and raise
its duration to 240s.
Co-Authored-By: Codex <noreply@codex.ai>
Fix Kannada narration: swap gated ai4bharat models for open alternatives
Codex
44cee7a
indic_text.py: replace gated indictrans2-en-indic-1B with
facebook/nllb-200-distilled-600M (non-gated, 600M params, kan_Knda target)
indic_tts.py: primary = sush0401/IndicF5-Kannada-Bedtime-v2 (user's
fine-tuned model, non-gated, full voice cloning via trust_remote_code);
fallback = facebook/mms-tts-kan (VITS, always works, no voice cloning)
app.py: restore load_translation + load_kannada_tts to module-scope ZeroGPU
block (models are no longer gated so pre-loading is safe again);
remove HF_TOKEN gate from generate_kannada_gpu
config.py: update TRANSLATION_MODEL + KANNADA_TTS_MODEL hub_ids;
remove KANNADA_FINETUNE (fine-tune is now the primary model itself)
requirements.txt: remove IndicTransToolkit (gated dependency, no longer needed)
README.md: update models list with the 3 new models
Built by Codex
Fix gated-model startup crash and bedtime UI contrast
Codex
cdeff8b
app.py:
- Remove load_translation + load_kannada_tts from module-scope ZeroGPU
loading — both ai4bharat models are gated and crash startup without
HF_TOKEN; now loaded lazily at inference time only
- generate_kannada_gpu: surface clear user message when HF_TOKEN missing
instead of opaque GatedRepoError
ui/layout.py:
- Swap bedtime tab palette from dark navy (invisible text on Gradio light
base) to twilight lavender (#ece4ff / #dfd6f8) — all text readable
- Cards: light purple gradient with indigo ink text
- Chips, fields, audio inputs: white-over-lavender with visible labels
- Button: gold/moon on lavender (unchanged)
- Story display: indigo-ink text on semi-transparent white panels
- .db-star: changed from white (invisible on paper bg) to purple
- Intro tagline + empty-state text: #4a2a9a / #7b5fc4 (was #9090c0)
Built by Codex
- ui/layout.py: full two-tab layout (Storybook + Bedtime Voice) with
night-sky dark palette, kid-friendly sparkle/star animations, and
moon-gold CSS for the bedtime panel
- app.py: BEDTIME_TEMPLATES expanded to 3 random arc variants per genre
(6 themes x 3 arcs), richer few-shot exemplars that enforce character
consistency, temperature sampling (0.85/0.92) for story variety,
generate_bedtime_story_gpu / generate_tts_cloned_gpu / generate_kannada_gpu,
create_bedtime generator wired to UI
- config.py: TRANSLATION_MODEL, KANNADA_TTS_MODEL, KANNADA_FINETUNE,
BEDTIME_GENRES, BEDTIME_MOODS added
- requirements.txt: librosa, IndicTransToolkit added
- audio_postprocess.py, audio_utils.py: voice reference prep helpers
- indic_text.py: English→Kannada via IndicTrans2
- indic_tts.py: Kannada narration via IndicF5 + fine-tuned bedtime checkpoint
- README.md: ai4bharat/IndicF5 and indictrans2-en-indic-1B added to models
Co-authored-by: Codex <noreply@codex.ai>
docs: DoodleDreams implementation plan
Codex
5504ddd
Add full article + README links section with all sponsor/model URLs
Codex+1: Claude Sonnet 4.6
0df3422
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>
Fix mobile layout: stack columns vertically, restore scroll
Codex+1: Claude Sonnet 4.6
166350a
Two-column row was clipping off-screen on phones. Columns now wrap to
full width on ≤820px. Also fixes iOS Safari scroll by switching
background-attachment to scroll and adding overflow-y: auto.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Detailed judge-facing README with honest badge claims + corrected Field Notes blog