mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
add prices for Kling Motion Control node (#7756)
┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7756-add-prices-for-Kling-Motion-Control-node-2d36d73d3650814193f3c84f25624518) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -116,6 +116,31 @@ const makeOmniProDurationCalculator =
|
||||
return formatCreditsLabel(cost)
|
||||
}
|
||||
|
||||
const klingMotionControlPricingCalculator: PricingFunction = (
|
||||
node: LGraphNode
|
||||
): string => {
|
||||
const modeWidget = node.widgets?.find(
|
||||
(w) => w.name === 'mode'
|
||||
) as IComboWidget
|
||||
|
||||
if (!modeWidget) {
|
||||
return formatCreditsListLabel([0.07, 0.112], {
|
||||
suffix: '/second',
|
||||
note: '(std/pro)'
|
||||
})
|
||||
}
|
||||
|
||||
const mode = String(modeWidget.value).toLowerCase()
|
||||
|
||||
if (mode === 'pro') return formatCreditsLabel(0.112, { suffix: '/second' })
|
||||
if (mode === 'std') return formatCreditsLabel(0.07, { suffix: '/second' })
|
||||
|
||||
return formatCreditsListLabel([0.07, 0.112], {
|
||||
suffix: '/second',
|
||||
note: '(std/pro)'
|
||||
})
|
||||
}
|
||||
|
||||
const pixversePricingCalculator = (node: LGraphNode): string => {
|
||||
const durationWidget = node.widgets?.find(
|
||||
(w) => w.name === 'duration_seconds'
|
||||
@@ -1034,6 +1059,9 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
|
||||
KlingOmniProVideoToVideoNode: {
|
||||
displayPrice: makeOmniProDurationCalculator(0.168)
|
||||
},
|
||||
KlingMotionControl: {
|
||||
displayPrice: klingMotionControlPricingCalculator
|
||||
},
|
||||
KlingOmniProEditVideoNode: {
|
||||
displayPrice: formatCreditsLabel(0.168, { suffix: '/second' })
|
||||
},
|
||||
@@ -2117,6 +2145,7 @@ export const useNodePricing = () => {
|
||||
KlingOmniProFirstLastFrameNode: ['duration'],
|
||||
KlingOmniProImageToVideoNode: ['duration'],
|
||||
KlingOmniProVideoToVideoNode: ['duration'],
|
||||
KlingMotionControl: ['mode'],
|
||||
MinimaxHailuoVideoNode: ['resolution', 'duration'],
|
||||
OpenAIDalle3: ['size', 'quality'],
|
||||
OpenAIDalle2: ['size', 'n'],
|
||||
|
||||
Reference in New Issue
Block a user