-
Notifications
You must be signed in to change notification settings - Fork 477
feat(price-badges): add ByteDance SeeDance 1.5 prices #8046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🎭 Playwright Tests:
|
📝 WalkthroughWalkthroughThis change adds audio toggle support to ByteDance video pricing by introducing Changes
Possibly related PRs
Suggested reviewers
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/14/2026, 04:12:00 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.34 MB (baseline 3.34 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 1.15 MB (baseline 1.15 MB) • 🔴 +670 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.66 kB (baseline 6.66 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 372 kB (baseline 372 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 209 kB (baseline 209 kB) • ⚪ 0 BReusable component library chunks
Status: 8 added / 8 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 9.34 MB (baseline 9.34 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 5.25 MB (baseline 5.25 MB) • ⚪ 0 BBundles that do not match a named category
Status: 16 added / 16 removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/composables/node/useNodePricing.ts`:
- Around line 247-255: The nested ternary that computes modelKey using repeated
model.includes checks is hard to read; replace it with an ordered array of keys
(e.g.,
['seedance-1-5-pro','seedance-1-0-pro-fast','seedance-1-0-pro','seedance-1-0-lite'])
and use Array.prototype.find to pick the first key where model.includes(key)
(falling back to ''), updating the variable initialized as modelKey; keep the
current ordering to preserve matching precedence and use descriptive variable
names to improve readability.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
src/composables/node/useNodePricing.ts
🧰 Additional context used
📓 Path-based instructions (10)
src/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
Files:
src/composables/node/useNodePricing.ts
src/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety
src/**/*.ts: Derive component types usingvue-component-type-helpers(ComponentProps,ComponentSlots) instead of separate type files
Use es-toolkit for utility functions
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones
Files:
src/composables/node/useNodePricing.ts
src/**/{services,composables}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/{services,composables}/**/*.{ts,tsx}: Useapi.apiURL()for backend endpoints instead of constructing URLs directly
Useapi.fileURL()for static file access instead of constructing URLs directly
Files:
src/composables/node/useNodePricing.ts
src/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using@ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase
src/**/*.{ts,tsx,vue}: Use separateimport typestatements instead of inlinetypein mixed imports
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, 80-character width
Sort and group imports by plugin, runpnpm formatbefore committing
Never useanytype - use proper TypeScript types
Never useas anytype assertions - fix the underlying type issue
Write code that is expressive and self-documenting - avoid unnecessary comments
Do not add or retain redundant comments - clean as you go
Avoid mutable state - prefer immutability and assignment at point of declaration
Watch out for Code Smells and refactor to avoid them
Files:
src/composables/node/useNodePricing.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/composables/node/useNodePricing.ts
src/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/composables/node/useNodePricing.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Use vue-i18n for ALL user-facing strings by adding them to
src/locales/en/main.json
Files:
src/composables/node/useNodePricing.ts
src/composables/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Name composables as
useXyz.ts(e.g.,useForm.ts)
Files:
src/composables/node/useNodePricing.ts
src/**/*.{ts,vue}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,vue}: Usereffor reactive state,computed()for derived values, andwatch/watchEffectfor side effects in Composition API
Avoid usingrefwithwatchif acomputedwould suffice - minimize refs and derived state
Useprovide/injectfor dependency injection only when simpler alternatives (Store or shared composable) won't work
Leverage VueUse functions for performance-enhancing composables
Use VueUse function for useI18n in composition API for string literals
Files:
src/composables/node/useNodePricing.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx}: Keep functions short and functional
Minimize nesting (if statements, for loops, etc.)
Use function declarations instead of function expressions when possible
Files:
src/composables/node/useNodePricing.ts
🧠 Learnings (6)
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.
Applied to files:
src/composables/node/useNodePricing.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.
Applied to files:
src/composables/node/useNodePricing.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).
Applied to files:
src/composables/node/useNodePricing.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().
Applied to files:
src/composables/node/useNodePricing.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.
Applied to files:
src/composables/node/useNodePricing.ts
📚 Learning: 2026-01-12T17:39:27.738Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7906
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:545-552
Timestamp: 2026-01-12T17:39:27.738Z
Learning: In Vue/TypeScript files (src/**/*.{ts,tsx,vue}), prefer if/else statements over ternary operators when performing side effects or actions (e.g., mutating state, calling methods with side effects). Ternaries should be reserved for computing and returning values.
Applied to files:
src/composables/node/useNodePricing.ts
🧬 Code graph analysis (1)
src/composables/node/useNodePricing.ts (1)
src/lib/litegraph/src/types/widgets.ts (1)
IComboWidget(135-142)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: deploy-and-comment
- GitHub Check: lint-and-format
- GitHub Check: setup
- GitHub Check: test
- GitHub Check: collect
🔇 Additional comments (4)
src/composables/node/useNodePricing.ts (4)
212-223: LGTM - Widget lookup and audio flag parsing are correct.The defensive typing with
IComboWidget | undefinedand the short-circuit evaluation correctly handle the case when the widget doesn't exist. This pattern is consistent with similar audio toggle handling elsewhere in the file (e.g.,klingVideoWithAudioPricingCalculator).
271-274: LGTM - Audio multiplier logic is correctly scoped.The 2x multiplier is correctly applied only to
seedance-1-5-prowhen audio generation is enabled. The conditional handles falsy values (includingundefinedwhen widget is absent) correctly by defaulting to multiplier of 1.
2558-2575: LGTM - Widget mappings updated consistently for nodes that support audio generation.The
generate_audiowidget is added toByteDanceTextToVideoNode,ByteDanceImageToVideoNode, andByteDanceFirstLastFrameNode. Note thatByteDanceImageReferenceNode(line 2576) is not updated, which appears intentional if that node type doesn't support audio generation.Please confirm that
ByteDanceImageReferenceNodedoes not support thegenerate_audiooption, as it's excluded from this update while other ByteDance video nodes include it.
225-229: Verify pricing values align with ByteDance's official token-based pricing model.Official ByteDance documentation for SeeDance 1.5 Pro uses token-based pricing ($1.20–$2.40 per 1M tokens depending on audio generation), but the code implements per-second pricing. Confirm that these per-second values are correctly derived from ByteDance's token calculation formula: (Width × Height × Frame Rate × Duration) / 1024.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| const modelKey = model.includes('seedance-1-5-pro') | ||
| ? 'seedance-1-5-pro' | ||
| : model.includes('seedance-1-0-pro-fast') | ||
| ? 'seedance-1-0-pro-fast' | ||
| : model.includes('seedance-1-0-pro') | ||
| ? 'seedance-1-0-pro' | ||
| : model.includes('seedance-1-0-lite') | ||
| ? 'seedance-1-0-lite' | ||
| : '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider refactoring deeply nested ternary to improve readability.
The logic is correct and the ordering properly handles substring matching (checking seedance-1-0-pro-fast before seedance-1-0-pro). However, the 5-level nested ternary reduces readability. An array-based lookup would be cleaner:
♻️ Optional refactor using array find
- const modelKey = model.includes('seedance-1-5-pro')
- ? 'seedance-1-5-pro'
- : model.includes('seedance-1-0-pro-fast')
- ? 'seedance-1-0-pro-fast'
- : model.includes('seedance-1-0-pro')
- ? 'seedance-1-0-pro'
- : model.includes('seedance-1-0-lite')
- ? 'seedance-1-0-lite'
- : ''
+ const modelKeys = [
+ 'seedance-1-5-pro',
+ 'seedance-1-0-pro-fast',
+ 'seedance-1-0-pro',
+ 'seedance-1-0-lite'
+ ] as const
+ const modelKey = modelKeys.find((key) => model.includes(key)) ?? ''📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const modelKey = model.includes('seedance-1-5-pro') | |
| ? 'seedance-1-5-pro' | |
| : model.includes('seedance-1-0-pro-fast') | |
| ? 'seedance-1-0-pro-fast' | |
| : model.includes('seedance-1-0-pro') | |
| ? 'seedance-1-0-pro' | |
| : model.includes('seedance-1-0-lite') | |
| ? 'seedance-1-0-lite' | |
| : '' | |
| const modelKeys = [ | |
| 'seedance-1-5-pro', | |
| 'seedance-1-0-pro-fast', | |
| 'seedance-1-0-pro', | |
| 'seedance-1-0-lite' | |
| ] as const | |
| const modelKey = modelKeys.find((key) => model.includes(key)) ?? '' |
🤖 Prompt for AI Agents
In `@src/composables/node/useNodePricing.ts` around lines 247 - 255, The nested
ternary that computes modelKey using repeated model.includes checks is hard to
read; replace it with an ordered array of keys (e.g.,
['seedance-1-5-pro','seedance-1-0-pro-fast','seedance-1-0-pro','seedance-1-0-lite'])
and use Array.prototype.find to pick the first key where model.includes(key)
(falling back to ''), updating the variable initialized as modelKey; keep the
current ordering to preserve matching precedence and use descriptive variable
names to improve readability.
## Summary Added prices for `seedance-1-5-pro` model ## Screenshots (if applicable) <img width="1540" height="891" alt="Screenshot From 2026-01-14 18-09-18" src="https://github.com/user-attachments/assets/fefc6ec8-c5d0-40a4-bede-55076376128f" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8046-feat-price-badges-add-ByteDance-SeeDance-1-5-prices-2e86d73d3650814cb988dc94cfb48993) by [Unito](https://www.unito.io)
## Summary Added prices for `seedance-1-5-pro` model ## Screenshots (if applicable) <img width="1540" height="891" alt="Screenshot From 2026-01-14 18-09-18" src="https://github.com/user-attachments/assets/fefc6ec8-c5d0-40a4-bede-55076376128f" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8046-feat-price-badges-add-ByteDance-SeeDance-1-5-prices-2e86d73d3650814cb988dc94cfb48993) by [Unito](https://www.unito.io)
…rices (#8058) Backport of #8046 to `core/1.37` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8058-backport-core-1-37-feat-price-badges-add-ByteDance-SeeDance-1-5-prices-2e96d73d36508162aac4c2f410f04284) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
…prices (#8059) Backport of #8046 to `cloud/1.37` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8059-backport-cloud-1-37-feat-price-badges-add-ByteDance-SeeDance-1-5-prices-2e96d73d3650817894e2e7350ccfb8c5) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
Summary
Added prices for
seedance-1-5-promodelScreenshots (if applicable)
┆Issue is synchronized with this Notion page by Unito