mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
[backport core/1.31] feat(api-nodes-pricing): add Nano-Banana-2 prices (#6784)
Backport of #6781 to `core/1.31` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6784-backport-core-1-31-feat-api-nodes-pricing-add-Nano-Banana-2-prices-2b16d73d365081e4b885e130db369d06) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
This commit is contained in:
@@ -1543,7 +1543,26 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
GeminiImageNode: {
|
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
|
// OpenAI nodes
|
||||||
OpenAIChatNode: {
|
OpenAIChatNode: {
|
||||||
@@ -1827,6 +1846,7 @@ export const useNodePricing = () => {
|
|||||||
TripoTextureNode: ['texture_quality'],
|
TripoTextureNode: ['texture_quality'],
|
||||||
// Google/Gemini nodes
|
// Google/Gemini nodes
|
||||||
GeminiNode: ['model'],
|
GeminiNode: ['model'],
|
||||||
|
GeminiImage2Node: ['resolution'],
|
||||||
// OpenAI nodes
|
// OpenAI nodes
|
||||||
OpenAIChatNode: ['model'],
|
OpenAIChatNode: ['model'],
|
||||||
// ByteDance
|
// ByteDance
|
||||||
|
|||||||
@@ -1759,7 +1759,7 @@ describe('useNodePricing', () => {
|
|||||||
const node = createMockNode('GeminiImageNode')
|
const node = createMockNode('GeminiImageNode')
|
||||||
|
|
||||||
const price = getNodeDisplayPrice(node)
|
const price = getNodeDisplayPrice(node)
|
||||||
expect(price).toBe('$0.03 per 1K tokens')
|
expect(price).toBe('~$0.039/Image (1K)')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user