From 97d95e5574223538b813e82d7367c795d125e1ff Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Fri, 15 Aug 2025 03:11:12 +0800 Subject: [PATCH] [backport 1.25] fix pricing for KlingImage2VideoNode (#4976) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #4957 to `core/1.25` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-4976-backport-1-25-fix-pricing-for-KlingImage2VideoNode-24f6d73d365081ac9481dfbd87aa96e3) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> --- src/composables/node/useNodePricing.ts | 16 +++++++++++++--- .../composables/node/useNodePricing.test.ts | 10 ++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/composables/node/useNodePricing.ts b/src/composables/node/useNodePricing.ts index c8e43a61a..b819312da 100644 --- a/src/composables/node/useNodePricing.ts +++ b/src/composables/node/useNodePricing.ts @@ -261,7 +261,10 @@ const apiNodeCosts: Record = return '$0.14-2.80/Run (varies with model, mode & duration)' const modelValue = String(modelWidget.value) - if (modelValue.includes('v2-master')) { + if ( + modelValue.includes('v2-1-master') || + modelValue.includes('v2-master') + ) { return '$1.40/Run' } else if ( modelValue.includes('v1-6') || @@ -280,12 +283,19 @@ const apiNodeCosts: Record = console.log('durationValue', durationValue) // Same pricing matrix as KlingTextToVideoNode - if (modelValue.includes('v2-master')) { + if ( + modelValue.includes('v2-1-master') || + modelValue.includes('v2-master') + ) { if (durationValue.includes('10')) { return '$2.80/Run' } return '$1.40/Run' // 5s default - } else if (modelValue.includes('v1-6') || modelValue.includes('v1-5')) { + } else if ( + modelValue.includes('v2-1') || + modelValue.includes('v1-6') || + modelValue.includes('v1-5') + ) { if (modeValue.includes('pro')) { return durationValue.includes('10') ? '$0.98/Run' : '$0.49/Run' } else { diff --git a/tests-ui/tests/composables/node/useNodePricing.test.ts b/tests-ui/tests/composables/node/useNodePricing.test.ts index 072180793..d5978110a 100644 --- a/tests-ui/tests/composables/node/useNodePricing.test.ts +++ b/tests-ui/tests/composables/node/useNodePricing.test.ts @@ -114,6 +114,16 @@ describe('useNodePricing', () => { expect(price).toBe('$1.40/Run') }) + it('should return high price for kling-v2-1-master model', () => { + const { getNodeDisplayPrice } = useNodePricing() + const node = createMockNode('KlingImage2VideoNode', [ + { name: 'model_name', value: 'v2-1-master' } + ]) + + const price = getNodeDisplayPrice(node) + expect(price).toBe('$1.40/Run') + }) + it('should return standard price for kling-v1-6 model', () => { const { getNodeDisplayPrice } = useNodePricing() const node = createMockNode('KlingImage2VideoNode', [