Skip to content

Commit 89c78b0

Browse files
authored
fix pricing for KlingImage2VideoNode (#4957)
## Summary Following up #4938 where I forgot to add pricing for new model in the `KlingImage2VideoNode`. ## Screenshots (if applicable) <img width="1461" height="1228" alt="Screenshot from 2025-08-13 09-15-21" src="https://github.com/user-attachments/assets/01be8ab9-820b-4112-9a54-1ce4f23de4eb" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-4957-fix-pricing-for-KlingImage2VideoNode-24e6d73d36508122b40ede36fdd50115) by [Unito](https://www.unito.io)
1 parent 4a3bd39 commit 89c78b0

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

src/composables/node/useNodePricing.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
261261
return '$0.14-2.80/Run (varies with model, mode & duration)'
262262

263263
const modelValue = String(modelWidget.value)
264-
if (modelValue.includes('v2-master')) {
264+
if (
265+
modelValue.includes('v2-1-master') ||
266+
modelValue.includes('v2-master')
267+
) {
265268
return '$1.40/Run'
266269
} else if (
267270
modelValue.includes('v1-6') ||
@@ -280,12 +283,19 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
280283
console.log('durationValue', durationValue)
281284

282285
// Same pricing matrix as KlingTextToVideoNode
283-
if (modelValue.includes('v2-master')) {
286+
if (
287+
modelValue.includes('v2-1-master') ||
288+
modelValue.includes('v2-master')
289+
) {
284290
if (durationValue.includes('10')) {
285291
return '$2.80/Run'
286292
}
287293
return '$1.40/Run' // 5s default
288-
} else if (modelValue.includes('v1-6') || modelValue.includes('v1-5')) {
294+
} else if (
295+
modelValue.includes('v2-1') ||
296+
modelValue.includes('v1-6') ||
297+
modelValue.includes('v1-5')
298+
) {
289299
if (modeValue.includes('pro')) {
290300
return durationValue.includes('10') ? '$0.98/Run' : '$0.49/Run'
291301
} else {

tests-ui/tests/composables/node/useNodePricing.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ describe('useNodePricing', () => {
114114
expect(price).toBe('$1.40/Run')
115115
})
116116

117+
it('should return high price for kling-v2-1-master model', () => {
118+
const { getNodeDisplayPrice } = useNodePricing()
119+
const node = createMockNode('KlingImage2VideoNode', [
120+
{ name: 'model_name', value: 'v2-1-master' }
121+
])
122+
123+
const price = getNodeDisplayPrice(node)
124+
expect(price).toBe('$1.40/Run')
125+
})
126+
117127
it('should return standard price for kling-v1-6 model', () => {
118128
const { getNodeDisplayPrice } = useNodePricing()
119129
const node = createMockNode('KlingImage2VideoNode', [

0 commit comments

Comments
 (0)