mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 17:52:16 +00:00
[backport cloud/1.33] feat(api-nodes-pricing): add prices for Kling O1 video model (#7079)
Backport of #7077 to `cloud/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7079-backport-cloud-1-33-feat-api-nodes-pricing-add-prices-for-Kling-O1-video-model-2bc6d73d365081c4ad83d1c5317a9135) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
This commit is contained in:
@@ -49,6 +49,21 @@ const calculateRunwayDurationPrice = (node: LGraphNode): string => {
|
|||||||
return `$${cost}/Run`
|
return `$${cost}/Run`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const makeOmniProDurationCalculator =
|
||||||
|
(pricePerSecond: number): PricingFunction =>
|
||||||
|
(node: LGraphNode): string => {
|
||||||
|
const durationWidget = node.widgets?.find(
|
||||||
|
(w) => w.name === 'duration'
|
||||||
|
) as IComboWidget
|
||||||
|
if (!durationWidget) return `$${pricePerSecond.toFixed(3)}/second`
|
||||||
|
|
||||||
|
const seconds = parseFloat(String(durationWidget.value))
|
||||||
|
if (!Number.isFinite(seconds)) return `$${pricePerSecond.toFixed(3)}/second`
|
||||||
|
|
||||||
|
const cost = pricePerSecond * seconds
|
||||||
|
return `$${cost.toFixed(2)}/Run`
|
||||||
|
}
|
||||||
|
|
||||||
const pixversePricingCalculator = (node: LGraphNode): string => {
|
const pixversePricingCalculator = (node: LGraphNode): string => {
|
||||||
const durationWidget = node.widgets?.find(
|
const durationWidget = node.widgets?.find(
|
||||||
(w) => w.name === 'duration_seconds'
|
(w) => w.name === 'duration_seconds'
|
||||||
@@ -706,6 +721,21 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
|
|||||||
KlingVirtualTryOnNode: {
|
KlingVirtualTryOnNode: {
|
||||||
displayPrice: '$0.07/Run'
|
displayPrice: '$0.07/Run'
|
||||||
},
|
},
|
||||||
|
KlingOmniProTextToVideoNode: {
|
||||||
|
displayPrice: makeOmniProDurationCalculator(0.112)
|
||||||
|
},
|
||||||
|
KlingOmniProFirstLastFrameNode: {
|
||||||
|
displayPrice: makeOmniProDurationCalculator(0.112)
|
||||||
|
},
|
||||||
|
KlingOmniProImageToVideoNode: {
|
||||||
|
displayPrice: makeOmniProDurationCalculator(0.112)
|
||||||
|
},
|
||||||
|
KlingOmniProVideoToVideoNode: {
|
||||||
|
displayPrice: makeOmniProDurationCalculator(0.168)
|
||||||
|
},
|
||||||
|
KlingOmniProEditVideoNode: {
|
||||||
|
displayPrice: '$0.168/second'
|
||||||
|
},
|
||||||
LumaImageToVideoNode: {
|
LumaImageToVideoNode: {
|
||||||
displayPrice: (node: LGraphNode): string => {
|
displayPrice: (node: LGraphNode): string => {
|
||||||
// Same pricing as LumaVideoNode per CSV
|
// Same pricing as LumaVideoNode per CSV
|
||||||
@@ -1880,6 +1910,10 @@ export const useNodePricing = () => {
|
|||||||
KlingDualCharacterVideoEffectNode: ['mode', 'model_name', 'duration'],
|
KlingDualCharacterVideoEffectNode: ['mode', 'model_name', 'duration'],
|
||||||
KlingSingleImageVideoEffectNode: ['effect_scene'],
|
KlingSingleImageVideoEffectNode: ['effect_scene'],
|
||||||
KlingStartEndFrameNode: ['mode', 'model_name', 'duration'],
|
KlingStartEndFrameNode: ['mode', 'model_name', 'duration'],
|
||||||
|
KlingOmniProTextToVideoNode: ['duration'],
|
||||||
|
KlingOmniProFirstLastFrameNode: ['duration'],
|
||||||
|
KlingOmniProImageToVideoNode: ['duration'],
|
||||||
|
KlingOmniProVideoToVideoNode: ['duration'],
|
||||||
MinimaxHailuoVideoNode: ['resolution', 'duration'],
|
MinimaxHailuoVideoNode: ['resolution', 'duration'],
|
||||||
OpenAIDalle3: ['size', 'quality'],
|
OpenAIDalle3: ['size', 'quality'],
|
||||||
OpenAIDalle2: ['size', 'n'],
|
OpenAIDalle2: ['size', 'n'],
|
||||||
|
|||||||
Reference in New Issue
Block a user