From 7363c4b909acfdb073c7384f6b77cbb44a867690 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Fri, 21 Nov 2025 02:34:28 +0900 Subject: [PATCH] [backport core/1.30] feat(api-nodes-pricing): add Nano-Banana-2 prices (#6783) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #6781 to `core/1.30` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6783-backport-core-1-30-feat-api-nodes-pricing-add-Nano-Banana-2-prices-2b16d73d3650818498cffda6a19ce62e) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> --- src/composables/node/useNodePricing.ts | 22 ++++++++++++++++++- .../composables/node/useNodePricing.test.ts | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/composables/node/useNodePricing.ts b/src/composables/node/useNodePricing.ts index d1ae22169..d9870b1de 100644 --- a/src/composables/node/useNodePricing.ts +++ b/src/composables/node/useNodePricing.ts @@ -1543,7 +1543,26 @@ const apiNodeCosts: Record = } }, GeminiImageNode: { - displayPrice: '$0.03 per 1K tokens' + displayPrice: '~$0.039/Image (1K)' + }, + GeminiImage2Node: { + displayPrice: (node: LGraphNode): string => { + const resolutionWidget = node.widgets?.find( + (w) => w.name === 'resolution' + ) as IComboWidget + + if (!resolutionWidget) return 'Token-based' + + const resolution = String(resolutionWidget.value) + if (resolution.includes('1K')) { + return '~$0.134/Image' + } else if (resolution.includes('2K')) { + return '~$0.134/Image' + } else if (resolution.includes('4K')) { + return '~$0.24/Image' + } + return 'Token-based' + } }, // OpenAI nodes OpenAIChatNode: { @@ -1827,6 +1846,7 @@ export const useNodePricing = () => { TripoTextureNode: ['texture_quality'], // Google/Gemini nodes GeminiNode: ['model'], + GeminiImage2Node: ['resolution'], // OpenAI nodes OpenAIChatNode: ['model'], // ByteDance diff --git a/tests-ui/tests/composables/node/useNodePricing.test.ts b/tests-ui/tests/composables/node/useNodePricing.test.ts index 34ff90f83..d08e356c5 100644 --- a/tests-ui/tests/composables/node/useNodePricing.test.ts +++ b/tests-ui/tests/composables/node/useNodePricing.test.ts @@ -1759,7 +1759,7 @@ describe('useNodePricing', () => { const node = createMockNode('GeminiImageNode') const price = getNodeDisplayPrice(node) - expect(price).toBe('$0.03 per 1K tokens') + expect(price).toBe('~$0.039/Image (1K)') }) })