Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/composables/node/useNodePricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,21 +1053,21 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
) as IComboWidget

if (!modelWidget || !generateAudioWidget) {
return '$2.00-6.00/Run (varies with model & audio generation)'
return '$0.80-3.20/Run (varies with model & audio generation)'
}

const model = String(modelWidget.value)
const generateAudio =
String(generateAudioWidget.value).toLowerCase() === 'true'

if (model.includes('veo-3.0-fast-generate-001')) {
return generateAudio ? '$3.20/Run' : '$2.00/Run'
return generateAudio ? '$1.20/Run' : '$0.80/Run'
} else if (model.includes('veo-3.0-generate-001')) {
return generateAudio ? '$6.00/Run' : '$4.00/Run'
return generateAudio ? '$3.20/Run' : '$1.60/Run'
}

// Default fallback
return '$2.00-6.00/Run'
return '$0.80-3.20/Run'
}
},
LumaImageNode: {
Expand Down
22 changes: 11 additions & 11 deletions tests-ui/tests/composables/node/useNodePricing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,48 +505,48 @@ describe('useNodePricing', () => {
})

describe('dynamic pricing - Veo3VideoGenerationNode', () => {
it('should return $2.00 for veo-3.0-fast-generate-001 without audio', () => {
it('should return $0.80 for veo-3.0-fast-generate-001 without audio', () => {
const { getNodeDisplayPrice } = useNodePricing()
const node = createMockNode('Veo3VideoGenerationNode', [
{ name: 'model', value: 'veo-3.0-fast-generate-001' },
{ name: 'generate_audio', value: false }
])

const price = getNodeDisplayPrice(node)
expect(price).toBe('$2.00/Run')
expect(price).toBe('$0.80/Run')
})

it('should return $3.20 for veo-3.0-fast-generate-001 with audio', () => {
it('should return $1.20 for veo-3.0-fast-generate-001 with audio', () => {
const { getNodeDisplayPrice } = useNodePricing()
const node = createMockNode('Veo3VideoGenerationNode', [
{ name: 'model', value: 'veo-3.0-fast-generate-001' },
{ name: 'generate_audio', value: true }
])

const price = getNodeDisplayPrice(node)
expect(price).toBe('$3.20/Run')
expect(price).toBe('$1.20/Run')
})

it('should return $4.00 for veo-3.0-generate-001 without audio', () => {
it('should return $1.60 for veo-3.0-generate-001 without audio', () => {
const { getNodeDisplayPrice } = useNodePricing()
const node = createMockNode('Veo3VideoGenerationNode', [
{ name: 'model', value: 'veo-3.0-generate-001' },
{ name: 'generate_audio', value: false }
])

const price = getNodeDisplayPrice(node)
expect(price).toBe('$4.00/Run')
expect(price).toBe('$1.60/Run')
})

it('should return $6.00 for veo-3.0-generate-001 with audio', () => {
it('should return $3.20 for veo-3.0-generate-001 with audio', () => {
const { getNodeDisplayPrice } = useNodePricing()
const node = createMockNode('Veo3VideoGenerationNode', [
{ name: 'model', value: 'veo-3.0-generate-001' },
{ name: 'generate_audio', value: true }
])

const price = getNodeDisplayPrice(node)
expect(price).toBe('$6.00/Run')
expect(price).toBe('$3.20/Run')
})

it('should return range when widgets are missing', () => {
Expand All @@ -555,7 +555,7 @@ describe('useNodePricing', () => {

const price = getNodeDisplayPrice(node)
expect(price).toBe(
'$2.00-6.00/Run (varies with model & audio generation)'
'$0.80-3.20/Run (varies with model & audio generation)'
)
})

Expand All @@ -567,7 +567,7 @@ describe('useNodePricing', () => {

const price = getNodeDisplayPrice(node)
expect(price).toBe(
'$2.00-6.00/Run (varies with model & audio generation)'
'$0.80-3.20/Run (varies with model & audio generation)'
)
})

Expand All @@ -579,7 +579,7 @@ describe('useNodePricing', () => {

const price = getNodeDisplayPrice(node)
expect(price).toBe(
'$2.00-6.00/Run (varies with model & audio generation)'
'$0.80-3.20/Run (varies with model & audio generation)'
)
})
})
Expand Down
Loading