A newer version of the Gradio SDK is available: 6.19.0
title: ShotCraft
emoji: π¬
colorFrom: purple
colorTo: pink
sdk: gradio
app_file: app.py
license: apache-2.0
short_description: AI art director for e-commerce product shots
tags:
- backyard-ai
- modal
π¬ ShotCraft β AI Shot Director
Upload a product photo β an 8B vision model designs 5 marketing shot concepts grounded in your actual product β a 12B image model renders them as production-ready stills.
Build Small Hackathon 2026 | Models: MiniCPM-V-2_6 (8B) + FLUX.1-schnell (12B) β both β€32B β
Pipeline
- Upload product photo + brand description + category + style preset
- MiniCPM-V-2_6 analyzes the photo β 5 shot concepts (scene, camera, lighting, palette, props, marketing angle, optimized prompt)
- Review & edit concepts
- FLUX.1-schnell renders 5 stills β pick hero frames β export ZIP
Team: Pawel (Stage 1) Β· Rafal (Stage 2) Β· Stefan (integration)
Architecture β powered by Modal β‘
This Space is the Gradio interface; all model inference runs on
Modal (modal_backend/shotcraft_inference.py in the
repo):
| Stage | Model | Modal GPU |
|---|---|---|
| 1 β Shot Director | MiniCPM-V-2_6 (8B, bf16) | A10G |
| 2 β Frame Generator | FLUX.1-schnell (12B, bf16, 4-step) | L40S |
- One HTTP call per stage; the whole 5-frame reel renders in a single batched call, per-frame regen is a 1-frame call (seeded, FR-2.3/2.4).
- Weights cached on a Modal Volume; containers stay warm 5 min between calls.
- The Space needs
SHOTCRAFT_API_URLβ the Modal endpoint. The deploy workflow can set it automatically fromSHOTCRAFT_MODAL_WORKSPACE,SHOTCRAFT_MODAL_APP, andSHOTCRAFT_MODAL_FUNCTION.
Dev notes
- Backend deploy:
modal deploy modal_backend/shotcraft_inference.py(ormodal servefor a dev loop). Health check:GET /health. - Tests:
python test_smoke.py(pure logic, no backend) andpython test_app_e2e.py(real end-to-end against the deployed backend β spends GPU time). - Plan: see
docs/shotcraft-IMPLEMENTATION_PLAN.mdfor the slice-by-slice build order.
Deployment configuration
Keep personal tokens in GitHub Secrets, not in code. This shared repo deploys
one shared Hugging Face Space, but can point that Space at Rafal's or Pawel's
Modal backend. Manual workflow runs ask for deployment_profile (rafal or
pawel). Pushes to main still deploy the default rafal profile.
Rafal uses the existing GitHub Secrets:
HF_TOKENβ Hugging Face write token for the target Space.MODAL_TOKEN_ID/MODAL_TOKEN_SECRETβ Modal token for the target workspace.
Pawel uses prefixed GitHub Secrets for Modal only:
PAWEL_MODAL_TOKEN_IDPAWEL_MODAL_TOKEN_SECRET
Rafal/default GitHub Variables:
HF_USERNAMEβ username used for HF git auth. Defaults torafalbog.HF_SPACE_REPOβ Space repo id, for examplebuild-small-hackathon/ai-video-generation.SHOTCRAFT_MODAL_WORKSPACEβ Modal workspace slug. Defaults torafalbogusdxc.SHOTCRAFT_MODAL_APPβ Modal app name. Defaults toshotcraft-inference.SHOTCRAFT_MODAL_FUNCTIONβ Modal ASGI function name. Defaults toapi.SHOTCRAFT_API_URLβ full backend URL override. If unset, the workflow buildshttps://<workspace>--<app>-<function>.modal.run.SHOTCRAFT_HF_SECRET_NAMEβ Modal secret that contains the HF token for model downloads. Defaults tohuggingface-secret.SHOTCRAFT_HF_CACHE_VOLUMEβ Modal volume for cached weights. Defaults toshotcraft-hf-cache.
Pawel-specific GitHub Variables use the same names with a PAWEL_ prefix:
PAWEL_SHOTCRAFT_MODAL_WORKSPACE- optional:
PAWEL_SHOTCRAFT_API_URL - optional:
PAWEL_SHOTCRAFT_MODAL_APP - optional:
PAWEL_SHOTCRAFT_MODAL_FUNCTION - optional:
PAWEL_SHOTCRAFT_HF_SECRET_NAME - optional:
PAWEL_SHOTCRAFT_HF_CACHE_VOLUME
For Rafal, the existing repository-level secrets/variables can stay as-is. For
Pawel, add the prefixed Modal secrets/variables under the same repository
Actions settings page, then run either deploy workflow manually and choose
deployment_profile=pawel. The frontend workflow still uses the existing
HF_TOKEN to update the shared Space at
build-small-hackathon/ai-video-generation.