A clonable Comfy Router app and development guide
  • TypeScript 82.6%
  • CSS 17.4%
Find a file
Bryan Wade f223ccf5b8 Send API key setup directly to the platform
Link key creation to the platform API keys page instead of a documentation page. Use Router onboarding for Cinematic Studio and Comfy API onboarding for Reshoot.

Confidence: high
Scope-risk: narrow
Tested: Platform route and onboarding implementation; README link assertions; git diff --check
Not-tested: Creating a real API key
2026-09-29 16:01:19 -07:00
app Use the FLUX.2 Pro result field when returning an image 2026-09-29 12:32:19 -07:00
components Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
lib Use the FLUX.2 Pro result field when returning an image 2026-09-29 12:32:19 -07:00
test Use the FLUX.2 Pro result field when returning an image 2026-09-29 12:32:19 -07:00
.env.example Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
.gitignore Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
LICENSE Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
next-env.d.ts Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
next.config.ts Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
package-lock.json Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
package.json Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00
README.md Send API key setup directly to the platform 2026-09-29 16:01:19 -07:00
tsconfig.json Give Comfy app builders a working first Router integration 2026-09-29 12:22:27 -07:00

Cinematic Studio

A standalone app for generating cinematic images with Comfy Router.

Run locally

  1. Install Node.js 22.6 or newer and create a Comfy API key for a workspace with Router access and credits.

  2. Clone and configure the app:

    git clone https://github.com/Comfy-Org/comfy-cinematic-studio.git
    cd comfy-cinematic-studio
    cp .env.example .env.local
    
  3. Put your key in COMFY_API_KEY in .env.local, then install and start:

    npm ci
    npm run dev
    
  4. Open http://localhost:3000, describe a scene, choose the shot, camera, light, and look, then select Generate image. Each run uses Comfy credits from the workspace that owns the API key.

Keep COMFY_API_KEY in .env.local; only the server route reads it. Do not prefix it with NEXT_PUBLIC_ or commit the file.

Request flow

Generate image posts the scene and selected shot, camera, lighting, and look to /api/generate. The route validates these values, combines them into a prompt with cinematicPrompt() in lib/prompt.ts, and calls bfl/flux-2-pro through the Comfy SDK. The server fetches the result and returns the image to the browser.

This app uses Comfy Router's hosted model API. It does not submit a Comfy workflow.

Make a change

Add the option to the corresponding list in lib/prompt.ts and add a matching <option> in components/app-runner.tsx. The prompt preview and API route both call cinematicPrompt() from lib/prompt.ts.

app/api/generate/route.ts calls bfl/flux-2-pro with a prompt. To use another model, update the model ID and parameters to match its schema, then update lib/flux-output.ts for its response. The current parser reads an HTTPS image URL from result.sample.

If a run fails

  • Missing key: make sure .env.local has COMFY_API_KEY, then restart npm run dev.
  • Insufficient credits or access: check Router access and balance for the workspace that created the key.
  • Image unavailable: if Router returns no usable image, the error includes its request ID when available.

License

MIT. See LICENSE.