Skip to content

Commit c9da19b

Browse files
authored
feat(api-nodes-pricing): add prices for Veo3FirstLastFrameNode (#6920)
## Summary Price badges for this PR: comfyanonymous/ComfyUI#10878 If we can include this in an upcoming release, that would be absolutely great. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6920-feat-api-nodes-pricing-add-prices-for-Veo3FirstLastFrameNode-2b66d73d365081bdb49be98d953a7a0b) by [Unito](https://www.unito.io)
1 parent 1022286 commit c9da19b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/composables/node/useNodePricing.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,40 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
12371237
return '$0.80-3.20/Run'
12381238
}
12391239
},
1240+
Veo3FirstLastFrameNode: {
1241+
displayPrice: (node: LGraphNode): string => {
1242+
const modelWidget = node.widgets?.find(
1243+
(w) => w.name === 'model'
1244+
) as IComboWidget
1245+
const generateAudioWidget = node.widgets?.find(
1246+
(w) => w.name === 'generate_audio'
1247+
) as IComboWidget
1248+
const durationWidget = node.widgets?.find(
1249+
(w) => w.name === 'duration'
1250+
) as IComboWidget
1251+
1252+
if (!modelWidget || !generateAudioWidget || !durationWidget) {
1253+
return '$0.40-3.20/Run (varies with model & audio generation)'
1254+
}
1255+
1256+
const model = String(modelWidget.value)
1257+
const generateAudio =
1258+
String(generateAudioWidget.value).toLowerCase() === 'true'
1259+
const seconds = parseFloat(String(durationWidget.value))
1260+
1261+
let pricePerSecond: number | null = null
1262+
if (model.includes('veo-3.1-fast-generate')) {
1263+
pricePerSecond = generateAudio ? 0.15 : 0.1
1264+
} else if (model.includes('veo-3.1-generate')) {
1265+
pricePerSecond = generateAudio ? 0.4 : 0.2
1266+
}
1267+
if (pricePerSecond === null) {
1268+
return '$0.40-3.20/Run'
1269+
}
1270+
const cost = pricePerSecond * seconds
1271+
return `$${cost.toFixed(2)}/Run`
1272+
}
1273+
},
12401274
LumaImageNode: {
12411275
displayPrice: (node: LGraphNode): string => {
12421276
const modelWidget = node.widgets?.find(
@@ -1852,6 +1886,7 @@ export const useNodePricing = () => {
18521886
Flux2ProImageNode: ['width', 'height', 'images'],
18531887
VeoVideoGenerationNode: ['duration_seconds'],
18541888
Veo3VideoGenerationNode: ['model', 'generate_audio'],
1889+
Veo3FirstLastFrameNode: ['model', 'generate_audio', 'duration'],
18551890
LumaVideoNode: ['model', 'resolution', 'duration'],
18561891
LumaImageToVideoNode: ['model', 'resolution', 'duration'],
18571892
LumaImageNode: ['model', 'aspect_ratio'],

0 commit comments

Comments
 (0)