Turn a one-line premise into a complete AI manhwa recap video: original story narration β AI Horde images β TTS voice β Ken Burns motion MP4.
Live: https://manhwa-recap-robot.val.run/
| File | Purpose |
|---|---|
main.ts | HTTP server. Serves index.html/app.js (via staticHTTPServer) and the POST /api/generate AI Horde image backend. |
index.html | The app UI. |
app.js | All client logic β story writing, strict scripting engine, image/voice/video compilation. |
Instead of recapping real manhwa pages, the tool writes an original story from a premise and enforces a hard line-level style:
How it's enforced in app.js:
validateLine(line) β heuristic validator that returns { ok, words, issues[] }. It flags violations (past-tense verbs, passive β¦byβ¦, chained actions, filler phrases) rather than silently rewriting text, since programmatic grammar conversion is unreliable.renderValidation(lines) β paints each line in the storyboard green/red with its word count and the exact issue, plus a summary note.writeStory β after an LLM call, if more than ~30% of lines fail validation, it retries the LLM up to 2Γ, feeding back the precise list of failing lines ("Line 2 (14w): 14 wordsβ¦") so the model corrects itself. One or fewer bad lines is tolerated.defaultStory() β the no-key offline fallback. Fixed bug: the original returned a hard-coded 5 lines regardless of the panel count, so narration repeated verbatim. It now builds exactly count distinct lines via combinatorial slot-filling (NARR_OPEN Γ NARR_WHERE Γ NARR_THREAT), validated in place, so 12 panels never repeat.All keyed services are optional (click π Keys in the app and save β stored in your browser's localStorage):
sk-β¦ from OpenAI/OpenRouter/Groq) for AI story writing.AI_HORDE_KEY env var.tts-proxy).main.ts generates one image per panel on AI Horde as same-origin data URLs (so the canvas is never tainted), polling until done with a 2βmin/panel cap. Every panel shows a canvas placeholder instantly, then real art swaps in as each URL resolves.
Notes on the AI Horde integration (these were the bugs that blocked image generation):
apikey header is required on every request β it defaults to the shared anonymous key 0000000000.AI_HORDE_KEY lifts the cap to 2048 (full 720p/1080p quality).