Build HF Space storyboarding TUI (React + FastAPI + BFL images)
Session from build-small-agent-trace on Hugging Face by drdavidtang · MIT · condensed by Coders Talk
Build a self-contained Hugging Face Docker Space app: a React/TypeScript terminal-style UI backed by a FastAPI service that turns a rough idea into a four-scene storyboard with narrative text and generated ASCII art, for use in YouTube storytelling.
- +0Prompt · +0Build a complete HF Docker Space text-adventure/storyboarding app: React+Vite+xterm.js TUI frontend, FastAPI backend using serverless HF inference for narrative and ASCII art generation.
- +0mAgent did · +0mBuilt a Modal-hosted MiniCPM narrative backend and HF-token-gated FLUX image provider, verifying via local Docker builds and container health checks that secrets aren't exposed.
- +31mAgent did · +31mCommitted the Modal MiniCPM backend and FLUX secret integration (14 files, 402 insertions) and pushed to the Hugging Face Space main branch.
- Break · 14h 39m away, not counted
- +32mPrompt · +32mDeveloper asked where the Black Forest Labs API key was, then said they'd made a BFL key directly and didn't want to run inference via HF at all - asked to switch providers.
- +32mAgent did · +32mRewired the image provider from HF Inference to Black Forest Labs' direct API with polling, verified via container tests that the BFL secret is detected and not leaked, and prepared to generate 20 fallback images.
- Break · 6h 18m away, not counted
- +37mAgent did · +37mRebuilt the app as an intro → idea → storyboard flow, tuned the ASCII converter (dark backgrounds sparse, bright outlines dense, later upscaled to 120x80), and regenerated fallback assets, verifying with Docker builds, browser screenshots and regression tests.
- Break · 38m away, not counted
- +52mFail · +52mLive BFL fallback image generation crashed on the first object with 'BFL returned an invalid polling URL' - the host allowlist was too strict for the real API response.
- +53mAgent did · +53mWidened the polling-host validation to accept BFL-owned HTTPS domains and reran the generator, successfully producing all 20 fallback objects and a manifest.
- +55mOutcome · +55mAll 20 BFL fallback images generated with ASCII conversions, reviewed via a contact sheet as clean and distinct, and the final container build verified locally.
Next time I'd specify the image provider up front instead of starting with HF Inference and then switching to Black Forest Labs mid-session, since that caused a full rewrite of the image pipeline and its secret handling. The fix that actually mattered was loosening the overly strict polling-host allowlist, which was blocking every real BFL response until I widened it to any BFL-owned HTTPS domain. Ending with 20 generated fallback images, a passing regression test, and a working local Docker build gave me confidence to push.