feat(api-nodes-pricing): add prices for Flux2ProImageNode (#6921)

## Summary

Price badges for https://github.com/comfyanonymous/ComfyUI/pull/10880

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6921-feat-api-nodes-pricing-add-prices-for-Flux2ProImageNode-2b66d73d365081f2b269c77df7ef93d6)
by [Unito](https://www.unito.io)
This commit is contained in:
Alexander Piskun
2025-11-25 21:56:10 +02:00
committed by GitHub
parent 4597b7e600
commit 10222860eb
2 changed files with 77 additions and 0 deletions

View File

@@ -94,6 +94,42 @@ describe('useNodePricing', () => {
})
})
describe('dynamic pricing - Flux2ProImageNode', () => {
it('should return precise price for text-to-image 1024x1024 (no refs)', () => {
const { getNodeDisplayPrice } = useNodePricing()
const node = createMockNode('Flux2ProImageNode', [
{ name: 'width', value: 1024 },
{ name: 'height', value: 1024 }
])
// 1024x1024 => 1 MP => $0.03
expect(getNodeDisplayPrice(node)).toBe('$0.03/Run')
})
it('should return minimum estimate when refs are connected (1024x1024)', () => {
const { getNodeDisplayPrice } = useNodePricing()
const node = createMockNode(
'Flux2ProImageNode',
[
{ name: 'width', value: 1024 },
{ name: 'height', value: 1024 }
],
true,
// connect the 'images' input
[{ name: 'images', connected: true }]
)
// 1024x1024 => 1 MP output = $0.03, min input add = $0.015 => ~$0.045 min
expect(getNodeDisplayPrice(node)).toBe('~$0.045$0.15/Run')
})
it('should show fallback when width/height are missing', () => {
const { getNodeDisplayPrice } = useNodePricing()
const node = createMockNode('Flux2ProImageNode', [])
expect(getNodeDisplayPrice(node)).toBe('$0.03$0.15/Run')
})
})
describe('dynamic pricing - KlingTextToVideoNode', () => {
it('should return high price for kling-v2-1-master model', () => {
const { getNodeDisplayPrice } = useNodePricing()