Skip to content

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

55msession
0interventions
GOAL

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.

  1. Prompt · +0
    Build 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.
  2. Agent did · +0m
    Built 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.
  3. Agent did · +31m
    Committed the Modal MiniCPM backend and FLUX secret integration (14 files, 402 insertions) and pushed to the Hugging Face Space main branch.
  4. Break · 14h 39m away, not counted
  5. Prompt · +32m
    Developer 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.
  6. Agent did · +32m
    Rewired 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.
  7. Break · 6h 18m away, not counted
  8. Agent did · +37m
    Rebuilt 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.
  9. Break · 38m away, not counted
  10. Fail · +52m
    Live 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.
  11. Agent did · +53m
    Widened the polling-host validation to accept BFL-owned HTTPS domains and reran the generator, successfully producing all 20 fallback objects and a manifest.
  12. Outcome · +55m
    All 20 BFL fallback images generated with ASCII conversions, reviewed via a contact sheet as clean and distinct, and the final container build verified locally.
VERDICT

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.

I tried this · 0

Discussion · 0

How Builds work