Skip to content

Commit c8a1df3

Browse files
[backport cloud/1.33] feat(api-nodes-pricing): add prices for Kling O1 video model (#7079)
Backport of #7077 to `cloud/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7079-backport-cloud-1-33-feat-api-nodes-pricing-add-prices-for-Kling-O1-video-model-2bc6d73d365081c4ad83d1c5317a9135) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <[email protected]>
1 parent 3920413 commit c8a1df3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/composables/node/useNodePricing.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ const calculateRunwayDurationPrice = (node: LGraphNode): string => {
4949
return `$${cost}/Run`
5050
}
5151

52+
const makeOmniProDurationCalculator =
53+
(pricePerSecond: number): PricingFunction =>
54+
(node: LGraphNode): string => {
55+
const durationWidget = node.widgets?.find(
56+
(w) => w.name === 'duration'
57+
) as IComboWidget
58+
if (!durationWidget) return `$${pricePerSecond.toFixed(3)}/second`
59+
60+
const seconds = parseFloat(String(durationWidget.value))
61+
if (!Number.isFinite(seconds)) return `$${pricePerSecond.toFixed(3)}/second`
62+
63+
const cost = pricePerSecond * seconds
64+
return `$${cost.toFixed(2)}/Run`
65+
}
66+
5267
const pixversePricingCalculator = (node: LGraphNode): string => {
5368
const durationWidget = node.widgets?.find(
5469
(w) => w.name === 'duration_seconds'
@@ -706,6 +721,21 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
706721
KlingVirtualTryOnNode: {
707722
displayPrice: '$0.07/Run'
708723
},
724+
KlingOmniProTextToVideoNode: {
725+
displayPrice: makeOmniProDurationCalculator(0.112)
726+
},
727+
KlingOmniProFirstLastFrameNode: {
728+
displayPrice: makeOmniProDurationCalculator(0.112)
729+
},
730+
KlingOmniProImageToVideoNode: {
731+
displayPrice: makeOmniProDurationCalculator(0.112)
732+
},
733+
KlingOmniProVideoToVideoNode: {
734+
displayPrice: makeOmniProDurationCalculator(0.168)
735+
},
736+
KlingOmniProEditVideoNode: {
737+
displayPrice: '$0.168/second'
738+
},
709739
LumaImageToVideoNode: {
710740
displayPrice: (node: LGraphNode): string => {
711741
// Same pricing as LumaVideoNode per CSV
@@ -1880,6 +1910,10 @@ export const useNodePricing = () => {
18801910
KlingDualCharacterVideoEffectNode: ['mode', 'model_name', 'duration'],
18811911
KlingSingleImageVideoEffectNode: ['effect_scene'],
18821912
KlingStartEndFrameNode: ['mode', 'model_name', 'duration'],
1913+
KlingOmniProTextToVideoNode: ['duration'],
1914+
KlingOmniProFirstLastFrameNode: ['duration'],
1915+
KlingOmniProImageToVideoNode: ['duration'],
1916+
KlingOmniProVideoToVideoNode: ['duration'],
18831917
MinimaxHailuoVideoNode: ['resolution', 'duration'],
18841918
OpenAIDalle3: ['size', 'quality'],
18851919
OpenAIDalle2: ['size', 'n'],

0 commit comments

Comments
 (0)