From 6ddbd8abbcc9acf5336f1a0c6d06c8a26c323ba9 Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Thu, 2 Oct 2025 10:54:05 +0300 Subject: [PATCH] add pricing for new Kling 2.5 Turbo model --- src/composables/node/useNodePricing.ts | 14 ++++++-- .../composables/node/useNodePricing.test.ts | 32 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/composables/node/useNodePricing.ts b/src/composables/node/useNodePricing.ts index 82a66abc7c..194e3c0a0b 100644 --- a/src/composables/node/useNodePricing.ts +++ b/src/composables/node/useNodePricing.ts @@ -355,7 +355,12 @@ const apiNodeCosts: Record = const modelValue = String(modelWidget.value) // Same pricing matrix as KlingTextToVideoNode - if ( + if (modelValue.includes('v2-5-turbo')) { + if (durationValue.includes('10')) { + return '$0.70/Run' + } + return '$0.35/Run' // 5s default + } else if ( modelValue.includes('v2-1-master') || modelValue.includes('v2-master') ) { @@ -505,7 +510,12 @@ const apiNodeCosts: Record = const modeValue = String(modeWidget.value) // Pricing matrix from CSV data based on mode string content - if (modeValue.includes('v2-1-master')) { + if (modeValue.includes('v2-5-turbo')) { + if (modeValue.includes('10')) { + return '$0.70/Run' + } + return '$0.35/Run' // 5s default + } else if (modeValue.includes('v2-1-master')) { if (modeValue.includes('10s')) { return '$2.80/Run' // price is the same as for v2-master model } diff --git a/tests-ui/tests/composables/node/useNodePricing.test.ts b/tests-ui/tests/composables/node/useNodePricing.test.ts index 32b18ed680..976c5638cc 100644 --- a/tests-ui/tests/composables/node/useNodePricing.test.ts +++ b/tests-ui/tests/composables/node/useNodePricing.test.ts @@ -115,6 +115,26 @@ describe('useNodePricing', () => { expect(price).toBe('$1.40/Run') }) + it('should return low price for kling-v2-turbo model', () => { + const { getNodeDisplayPrice } = useNodePricing() + const node = createMockNode('KlingTextToVideoNode', [ + { name: 'mode', value: 'pro / 5s / v2-5-turbo' } + ]) + + const price = getNodeDisplayPrice(node) + expect(price).toBe('$0.35/Run') + }) + + it('should return high price for kling-v2-turbo model', () => { + const { getNodeDisplayPrice } = useNodePricing() + const node = createMockNode('KlingTextToVideoNode', [ + { name: 'mode', value: 'pro / 10s / v2-5-turbo' } + ]) + + const price = getNodeDisplayPrice(node) + expect(price).toBe('$0.70/Run') + }) + it('should return standard price for kling-v1-6 model', () => { const { getNodeDisplayPrice } = useNodePricing() const node = createMockNode('KlingTextToVideoNode', [ @@ -155,6 +175,18 @@ describe('useNodePricing', () => { expect(price).toBe('$1.40/Run') }) + it('should return high price for kling-v2-5-turbo model', () => { + const { getNodeDisplayPrice } = useNodePricing() + const node = createMockNode('KlingImage2VideoNode', [ + { name: 'model_name', value: 'v2-5-turbo' }, + { name: 'mode', value: 'pro mode / 10s duration / kling-v2-5-turbo' }, + { name: 'duration', value: '10' } + ]) + + const price = getNodeDisplayPrice(node) + expect(price).toBe('$0.70/Run') + }) + it('should return standard price for kling-v1-6 model', () => { const { getNodeDisplayPrice } = useNodePricing() const node = createMockNode('KlingImage2VideoNode', [