mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
fix(price-badges): add missing badge for WanReferenceVideoApi node (#7901)
## Screenshots <img width="1179" height="593" alt="Screenshot From 2026-01-08 10-11-05" src="https://github.com/user-attachments/assets/368fe0ba-86f9-479f-a78e-61498d16eed0" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7901-fix-price-badges-add-missing-badge-for-WanReferenceVideoApi-node-2e26d73d365081c2b043d265343e90c0) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -2101,6 +2101,35 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
|
|||||||
},
|
},
|
||||||
LtxvApiImageToVideo: {
|
LtxvApiImageToVideo: {
|
||||||
displayPrice: ltxvPricingCalculator
|
displayPrice: ltxvPricingCalculator
|
||||||
|
},
|
||||||
|
WanReferenceVideoApi: {
|
||||||
|
displayPrice: (node: LGraphNode): string => {
|
||||||
|
const durationWidget = node.widgets?.find(
|
||||||
|
(w) => w.name === 'duration'
|
||||||
|
) as IComboWidget
|
||||||
|
const sizeWidget = node.widgets?.find(
|
||||||
|
(w) => w.name === 'size'
|
||||||
|
) as IComboWidget
|
||||||
|
|
||||||
|
if (!durationWidget || !sizeWidget) {
|
||||||
|
return formatCreditsRangeLabel(0.7, 1.5, {
|
||||||
|
note: '(varies with size & duration)'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const seconds = parseFloat(String(durationWidget.value))
|
||||||
|
const sizeStr = String(sizeWidget.value).toLowerCase()
|
||||||
|
|
||||||
|
const rate = sizeStr.includes('1080p') ? 0.15 : 0.1
|
||||||
|
const inputMin = 2 * rate
|
||||||
|
const inputMax = 5 * rate
|
||||||
|
const outputPrice = seconds * rate
|
||||||
|
|
||||||
|
const minTotal = inputMin + outputPrice
|
||||||
|
const maxTotal = inputMax + outputPrice
|
||||||
|
|
||||||
|
return formatCreditsRangeLabel(minTotal, maxTotal)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2254,6 +2283,7 @@ export const useNodePricing = () => {
|
|||||||
ByteDanceImageReferenceNode: ['model', 'duration', 'resolution'],
|
ByteDanceImageReferenceNode: ['model', 'duration', 'resolution'],
|
||||||
WanTextToVideoApi: ['duration', 'size'],
|
WanTextToVideoApi: ['duration', 'size'],
|
||||||
WanImageToVideoApi: ['duration', 'resolution'],
|
WanImageToVideoApi: ['duration', 'resolution'],
|
||||||
|
WanReferenceVideoApi: ['duration', 'size'],
|
||||||
LtxvApiTextToVideo: ['model', 'duration', 'resolution'],
|
LtxvApiTextToVideo: ['model', 'duration', 'resolution'],
|
||||||
LtxvApiImageToVideo: ['model', 'duration', 'resolution']
|
LtxvApiImageToVideo: ['model', 'duration', 'resolution']
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user