Skip to content

Commit fec04f3

Browse files
committed
api_nodes: added prices for Ideogram V3 node (character reference)
1 parent 23b3914 commit fec04f3

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/composables/node/useNodePricing.ts

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
179179
const numImagesWidget = node.widgets?.find(
180180
(w) => w.name === 'num_images'
181181
) as IComboWidget
182+
const characterInput = node.inputs?.find(
183+
(i) => i.name === 'character_image'
184+
) as any
185+
const hasCharacter =
186+
(typeof characterInput?.link !== 'undefined' &&
187+
characterInput.link != null) ||
188+
(Array.isArray(characterInput?.links) &&
189+
characterInput.links.length > 0)
182190

183191
if (!renderingSpeedWidget)
184192
return '$0.03-0.08 x num_images/Run (varies with rendering speed & num_images)'
@@ -188,11 +196,23 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
188196

189197
const renderingSpeed = String(renderingSpeedWidget.value)
190198
if (renderingSpeed.toLowerCase().includes('quality')) {
191-
basePrice = 0.09
199+
if (hasCharacter) {
200+
basePrice = 0.2
201+
} else {
202+
basePrice = 0.09
203+
}
192204
} else if (renderingSpeed.toLowerCase().includes('balanced')) {
193-
basePrice = 0.06
205+
if (hasCharacter) {
206+
basePrice = 0.15
207+
} else {
208+
basePrice = 0.06
209+
}
194210
} else if (renderingSpeed.toLowerCase().includes('turbo')) {
195-
basePrice = 0.03
211+
if (hasCharacter) {
212+
basePrice = 0.1
213+
} else {
214+
basePrice = 0.03
215+
}
196216
}
197217

198218
const totalCost = (basePrice * numImages).toFixed(2)
@@ -1427,7 +1447,7 @@ export const useNodePricing = () => {
14271447
OpenAIGPTImage1: ['quality', 'n'],
14281448
IdeogramV1: ['num_images', 'turbo'],
14291449
IdeogramV2: ['num_images', 'turbo'],
1430-
IdeogramV3: ['rendering_speed', 'num_images'],
1450+
IdeogramV3: ['rendering_speed', 'num_images', 'character_image'],
14311451
FluxProKontextProNode: [],
14321452
FluxProKontextMaxNode: [],
14331453
VeoVideoGenerationNode: ['duration_seconds'],

0 commit comments

Comments
 (0)