mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +00:00
[backport core/1.36] fix(price-badges): add missing badge for WanReferenceVideoApi node (#8000)
Backport of #7901 to `core/1.36` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8000-backport-core-1-36-fix-price-badges-add-missing-badge-for-WanReferenceVideoApi-node-2e76d73d365081968692f37c5dff83fd) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
This commit is contained in:
@@ -2132,6 +2132,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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2285,6 +2314,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