Repository navigation
feat(website): Cinematic Studio credit estimates and credit gating - #18928
Conversation
…r is missing An insufficient_credits refusal whose bucket arrives only in the JSON body (no X-Comfy-Error-Type header, not a 402) was classified by status alone and surfaced as a provider or validation failure instead of noCredits.
…s for The node-pricing helper only evaluated a rule with the node's default widgets. It now accepts the run's width, height and reference-image count, and exposes the same price as a credit range so a caller can compare it with a balance.
…ate on them The studio priced nothing before a run and only stopped an empty balance, so a four-take batch over the balance partly failed. - Price each studio model at build time for every aspect, resolution and reference count, from the frame size the Router mapping sends. - Show ~N credits (takes x per take) beside Generate, or Cost varies for a model without a verified price. - Block a shot the balance does not cover with the need and the balance, offer the number of takes it does cover, and keep the zero-balance gate for unpriced models. The unused runGate is retired into studioGate. - Give members the switch-to-personal action instead of checkout, sharing the switch with the model page.
…akes - A take refused for credits now tells a workspace member what the model page tells them (the team is out; ask the owner or run on your personal workspace) and offers the switch to personal instead of checkout. - Takes refused for credits get a yellow warning state in the sequence, the take picker and the frame, and a shot with several takes shows how many were not run with the same top-up or switch action. - Once a top-up lands (the header's top-up watch), that action becomes a retry of the unpaid takes.
…d run pricing into smaller pieces
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
🌐 Website E2ETip All tests passed.
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. Fallow gates on new findings in changed files only, so everything below was introduced or moved by this PR (44 changed files).
Pre-existing findings are baselined in Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since ca35810a393789af3389b4e4681ea98bba677e49
Full docs: ADR-DEVEX-LINT-0015 🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-18928.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-kmu75x85a-comfyui.vercel.app Last updated: 2026-09-26T00:36:28Z for |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughCinematic Studio now estimates credit costs for supported models and uses the estimate and current balance in generation controls. The changes also add localized unpaid-take status, workspace-aware credit actions, and retries for multiple eligible takes. Shared workshop pricing and workspace-switch helpers support these flows. ChangesCinematic Studio credits
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CinematicStudio
participant useCinematicShot
participant shotEstimate
participant useCinematicStudioRun
participant studioGate
participant CinematicGenerateAction
CinematicStudio->>useCinematicShot: Read shot settings and model prices
useCinematicShot->>shotEstimate: Calculate per-take and total credit ranges
useCinematicShot->>useCinematicStudioRun: Supply minimum total as shotCost
useCinematicStudioRun->>studioGate: Check credits against shot cost
CinematicStudio->>CinematicGenerateAction: Pass estimate and current credits
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No new merge-blocking risk is established by this review; the previously reported skipped-take retry concern remains a separate follow-up. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new controls limit retries to failed takes tracked by the studio, and rendering requests use a session-bound credential. No introduced security bypass was established. The server’s independent credit and workspace checks could not be verified, so the risk is not rated minimal. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (6 passed)
Full details: Website End-To-End Regression CoverageExplanation The PR changes observable website runtime behavior, including Cinematic Studio generation gating, credit actions, retry flows, and router error handling under
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
The pre-merge review is superseded: all current checks pass and there are no actionable review threads.
benjcooley
left a comment
There was a problem hiding this comment.
🧐 TED — review of 335e318
Verdict: the estimates and the gate are correct. One should-fix in the retry path for skipped takes.
| Severity | Count |
|---|---|
| BLOCKER | 0 |
| SHOULD FIX | 1 |
| TRIVIAL | 0 |
Estimates: I dumped the build-time table and the frame each Router mapping produces, for every aspect × resolution × reference count.
- Flux 2 Pro: priced on the width × height the mapping actually sends (
1:1 1K= 1024², 6.33;1:1 2K= 2048², 15.825;21:9clamps to 2048×878 at both resolutions, so 9.495 for both). References widen the range to the node rule's+$0.015…$0.12. That matchesFlux2ImageNode's own expression. - Seedream 4.5: a flat 8.44 in all 30 cells, which is correct for a per-image price.
- Gemini 3 Pro, Krea 2 and Qwen 3 Pro: no price, so they fall back to the zero-balance gate as intended.
- Rules stay off the client: only
pricing.ts(build time, from the.astrofrontmatter) andmodel-page.tsimportworkshop-node-pricing.estimate.tsimports a type only, so the browser gets the price table and never the rules.
Gate: it blocks when credits < total.min; offers "Use N takes" with min(floor(credits / perTake.min), takes − 1) and hides it when N would be 0; keeps credits > 0 for unpriced models and for retries. Members get the member copy and "Switch to personal", never "Add credits". The body-only error_type fallback in workshop-router-errors.ts is only used when the header is missing, and a truncated body parses to null. All correct.
Outside this PR (pre-existing Router mappings, worth a ticket):
- Seedream 4.5 sends 2560×1440 (16:9) for
21:9 1Kand4:3 1K, and 2304×1728 (4:3) for1:1 1K, so the user doesn't get the aspect they picked. - Krea 2 sends
resolution: 1Kfor 2K. - The price is flat, so the estimates aren't affected.
Merge order: removing outOfCredits from StudioGateInput breaks #18917's useReshoot.ts (TS2353; I verified this by merging the two locally).
Tests (local): 227 pass across cinematic-studio, node pricing, router and run. pnpm typecheck is clean.
…ot only after a watched top-up
benjcooley
left a comment
There was a problem hiding this comment.
🧐 TED — re-review of 8e7111d
Verdict: my should-fix is fixed. I have nothing blocking, and this is ready from my side (see the note below on who can approve).
| Severity | Count |
|---|---|
| BLOCKER | 0 |
| SHOULD FIX | 0 |
| TRIVIAL | 1 |
Fixed: CinematicCreditAction now offers the skipped takes again when the balance goes above its earlier value, and also when a watched top-up lands. That covers switching to the personal workspace and credits added in another tab. I restored the old component and ran the new test ("offers the skipped takes again once the balance rises another way"): it fails without the fix and passes with it.
Checked: only CinematicCreditAction.vue and one test changed since 335e318, so the earlier estimate and gate review still stands.
Tests (local): 133 cinematic-studio tests pass and pnpm typecheck is clean. CI on 8e7111d is 53 passed, 37 skipped, none failed.
Merge order: land this before #18917. Its useReshoot.ts still passes outOfCredits and will need the rebase its author has planned.
About "review of record": these TED reviews are posted from the author's own account (@benjcooley). GitHub can't count them as an approval, and they don't satisfy the requirement for a second reviewer. Merging on them alone is what got #18763 flagged in Comfy-Org/unreviewed-merges#343. Someone from comfy_website_devs still needs to approve.
| const credits = computed(() => | ||
| balance.value.status === 'ok' ? balance.value.credits : undefined | ||
| ) | ||
| const creditsWhenSkipped = ref(credits.value) |
There was a problem hiding this comment.
TRIVIAL — the baseline is the balance when this component mounts, not when the takes were skipped. The take notice mounts only while its take is selected. So if the balance rises while another take is on screen (for example, after switching to personal from the Generate button), coming back to the skipped take sets the baseline to the new balance, and the notice offers "Add credits" instead of a retry. The summary usually stays mounted, so this is minor. Recording the balance on the take when the Router refuses it would make the comparison exact.
## Summary Gates Cinematic Studio and its Re-shoot app on the `workshop-apps-enabled` PostHog flag instead of `workshop-workflows-enabled`, so apps and Cloud workflows roll out independently. Follow-up to #18695. ## Changes - **What**: - `useWorkshopAppsEnabled()` in `scripts/posthog.ts`, resolved alongside the other Workshop flags and cleared on identity change; `PUBLIC_WORKSHOP_APPS_ENABLED=1` forces it on in local dev. - The `/cinematic-studio` page gate, the Cinematic Studio featured slide on `/models`, and a model page's Open in Studio link read the apps flag. Cloud workflow pages keep `workshop-workflows-enabled`. - README documents the flag. - New e2e `workshop-apps.spec.ts`: `/cinematic-studio` opens on the apps flag alone and stays closed when only the workflows flag is on. - Rebased onto #18928, whose Cinematic Studio tests now mock the apps flag. ## Review Focus - `workshop-apps-enabled` exists in PostHog: 100% for `comfy_staff = true`, 0% otherwise. `identifyInPostHog` sets `comfy_staff: true`, which that condition matches. - New `posthog.test.ts` case: the apps flag resolves independently of the workflows flag and resets on a caller change. Validation: website unit tests for posthog, ModelDetail, WorkshopModelsGrid, CinematicStudio, ModelsPage and WorkflowPlayground pass; the new e2e spec passes against a production build; `typecheck:website`, eslint, oxlint, oxfmt and fallow clean.
Summary
Cinematic Studio now shows the estimated credits for a shot before Generate, blocks a shot the balance can't cover, gives workspace members their own out-of-credits copy, and summarises takes that weren't run for lack of credits.
Changes
estimateWorkshopNodePricetakes width, height and reference count;estimateWorkshopRunCreditsreturns a credit range. Studio prices are precomputed at build time per aspect × resolution × 0–2 references, using the frame size the Router mapping actually sends. Pricing rules don't ship to the browser.pricing.creditsPerRunis not used.studioGateblocks when the balance is below the estimate's low end ("4 takes need ~38 credits; you have 20"), offers "Use N takes", and keeps the zero-balance gate for unpriced models. The unusedrunGateis removed.usePersonalWorkspaceSwitch, extracted fromModelDetail.vue).error_typewhenX-Comfy-Error-Typeis missing.Review Focus
lib/workshop/cinematic-studio/copy.ts(en + zh-CN) to keep it out of other pages' scripts; member copy reusestranslations.tskeys.Validation: eslint,
typecheck:website,format:astro:check, knip and the full website unit suite pass;astro buildsucceeds.Part of FE-2737.