mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
[backport cloud/1.37] feat(price-badges): add ByteDance SeeDance 1.5 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>
This commit is contained in:
@@ -220,13 +220,24 @@ const byteDanceVideoPricingCalculator = (node: LGraphNode): string => {
|
||||
const resolutionWidget = node.widgets?.find(
|
||||
(w) => w.name === 'resolution'
|
||||
) as IComboWidget
|
||||
const generateAudioWidget = node.widgets?.find(
|
||||
(w) => w.name === 'generate_audio'
|
||||
) as IComboWidget | undefined
|
||||
|
||||
if (!modelWidget || !durationWidget || !resolutionWidget) return 'Token-based'
|
||||
|
||||
const model = String(modelWidget.value).toLowerCase()
|
||||
const resolution = String(resolutionWidget.value).toLowerCase()
|
||||
const seconds = parseFloat(String(durationWidget.value))
|
||||
const generateAudio =
|
||||
generateAudioWidget &&
|
||||
String(generateAudioWidget.value).toLowerCase() === 'true'
|
||||
const priceByModel: Record<string, Record<string, [number, number]>> = {
|
||||
'seedance-1-5-pro': {
|
||||
'480p': [0.12, 0.12],
|
||||
'720p': [0.26, 0.26],
|
||||
'1080p': [0.58, 0.59]
|
||||
},
|
||||
'seedance-1-0-pro': {
|
||||
'480p': [0.23, 0.24],
|
||||
'720p': [0.51, 0.56],
|
||||
@@ -244,13 +255,15 @@ const byteDanceVideoPricingCalculator = (node: LGraphNode): string => {
|
||||
}
|
||||
}
|
||||
|
||||
const modelKey = 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 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 resKey = resolution.includes('1080')
|
||||
? '1080p'
|
||||
@@ -266,8 +279,10 @@ const byteDanceVideoPricingCalculator = (node: LGraphNode): string => {
|
||||
|
||||
const [min10s, max10s] = baseRange
|
||||
const scale = seconds / 10
|
||||
const minCost = min10s * scale
|
||||
const maxCost = max10s * scale
|
||||
const audioMultiplier =
|
||||
modelKey === 'seedance-1-5-pro' && generateAudio ? 2 : 1
|
||||
const minCost = min10s * scale * audioMultiplier
|
||||
const maxCost = max10s * scale * audioMultiplier
|
||||
|
||||
if (minCost === maxCost) return formatCreditsLabel(minCost)
|
||||
return formatCreditsRangeLabel(minCost, maxCost)
|
||||
@@ -2623,9 +2638,24 @@ export const useNodePricing = () => {
|
||||
'sequential_image_generation',
|
||||
'max_images'
|
||||
],
|
||||
ByteDanceTextToVideoNode: ['model', 'duration', 'resolution'],
|
||||
ByteDanceImageToVideoNode: ['model', 'duration', 'resolution'],
|
||||
ByteDanceFirstLastFrameNode: ['model', 'duration', 'resolution'],
|
||||
ByteDanceTextToVideoNode: [
|
||||
'model',
|
||||
'duration',
|
||||
'resolution',
|
||||
'generate_audio'
|
||||
],
|
||||
ByteDanceImageToVideoNode: [
|
||||
'model',
|
||||
'duration',
|
||||
'resolution',
|
||||
'generate_audio'
|
||||
],
|
||||
ByteDanceFirstLastFrameNode: [
|
||||
'model',
|
||||
'duration',
|
||||
'resolution',
|
||||
'generate_audio'
|
||||
],
|
||||
ByteDanceImageReferenceNode: ['model', 'duration', 'resolution'],
|
||||
WanTextToVideoApi: ['duration', 'size'],
|
||||
WanImageToVideoApi: ['duration', 'resolution'],
|
||||
|
||||
Reference in New Issue
Block a user