From 3c99e75fe05cfb455f951d31b6dd57d16b957cc1 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Thu, 15 Jan 2026 05:33:21 +0900 Subject: [PATCH] [backport cloud/1.37] [API Nodes] add price badges for Meshy 3D nodes (#8049) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #7966 to `cloud/1.37` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8049-backport-cloud-1-37-API-Nodes-add-price-badges-for-Meshy-3D-nodes-2e86d73d3650815b8df4c0f4c2957f65) by [Unito](https://www.unito.io) Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> --- src/composables/node/useNodePricing.ts | 83 ++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/src/composables/node/useNodePricing.ts b/src/composables/node/useNodePricing.ts index 643dd676b..6f1184b6a 100644 --- a/src/composables/node/useNodePricing.ts +++ b/src/composables/node/useNodePricing.ts @@ -2,6 +2,17 @@ import { formatCreditsFromUsd } from '@/base/credits/comfyCredits' import type { INodeInputSlot, LGraphNode } from '@/lib/litegraph/src/litegraph' import type { IComboWidget } from '@/lib/litegraph/src/types/widgets' +/** + * Meshy credit pricing constant. + * 1 Meshy credit = $0.04 USD + * Change this value to update all Meshy node prices. + */ +const MESHY_CREDIT_PRICE_USD = 0.04 + +/** Convert Meshy credits to USD */ +const meshyCreditsToUsd = (credits: number): number => + credits * MESHY_CREDIT_PRICE_USD + const DEFAULT_NUMBER_OPTIONS: Intl.NumberFormatOptions = { minimumFractionDigits: 0, maximumFractionDigits: 0 @@ -525,6 +536,54 @@ const calculateTripo3DGenerationPrice = ( return formatCreditsLabel(dollars) } +/** + * Meshy Image to 3D pricing calculator. + * Pricing based on should_texture widget: + * - Without texture: 20 credits + * - With texture: 30 credits + */ +const calculateMeshyImageToModelPrice = (node: LGraphNode): string => { + const shouldTextureWidget = node.widgets?.find( + (w) => w.name === 'should_texture' + ) as IComboWidget + + if (!shouldTextureWidget) { + return formatCreditsRangeLabel( + meshyCreditsToUsd(20), + meshyCreditsToUsd(30), + { note: '(varies with texture)' } + ) + } + + const shouldTexture = String(shouldTextureWidget.value).toLowerCase() + const credits = shouldTexture === 'true' ? 30 : 20 + return formatCreditsLabel(meshyCreditsToUsd(credits)) +} + +/** + * Meshy Multi-Image to 3D pricing calculator. + * Pricing based on should_texture widget: + * - Without texture: 5 credits + * - With texture: 15 credits + */ +const calculateMeshyMultiImageToModelPrice = (node: LGraphNode): string => { + const shouldTextureWidget = node.widgets?.find( + (w) => w.name === 'should_texture' + ) as IComboWidget + + if (!shouldTextureWidget) { + return formatCreditsRangeLabel( + meshyCreditsToUsd(5), + meshyCreditsToUsd(15), + { note: '(varies with texture)' } + ) + } + + const shouldTexture = String(shouldTextureWidget.value).toLowerCase() + const credits = shouldTexture === 'true' ? 15 : 5 + return formatCreditsLabel(meshyCreditsToUsd(credits)) +} + /** * Static pricing data for API nodes, now supporting both strings and functions */ @@ -1812,6 +1871,27 @@ const apiNodeCosts: Record = TripoRefineNode: { displayPrice: formatCreditsLabel(0.3) }, + MeshyTextToModelNode: { + displayPrice: formatCreditsLabel(meshyCreditsToUsd(20)) + }, + MeshyRefineNode: { + displayPrice: formatCreditsLabel(meshyCreditsToUsd(10)) + }, + MeshyImageToModelNode: { + displayPrice: calculateMeshyImageToModelPrice + }, + MeshyMultiImageToModelNode: { + displayPrice: calculateMeshyMultiImageToModelPrice + }, + MeshyRigModelNode: { + displayPrice: formatCreditsLabel(meshyCreditsToUsd(5)) + }, + MeshyAnimateModelNode: { + displayPrice: formatCreditsLabel(meshyCreditsToUsd(3)) + }, + MeshyTextureNode: { + displayPrice: formatCreditsLabel(meshyCreditsToUsd(10)) + }, // Google/Gemini nodes GeminiNode: { displayPrice: (node: LGraphNode): string => { @@ -2527,6 +2607,9 @@ export const useNodePricing = () => { 'animate_in_place' ], TripoTextureNode: ['texture_quality'], + // Meshy nodes + MeshyImageToModelNode: ['should_texture'], + MeshyMultiImageToModelNode: ['should_texture'], // Google/Gemini nodes GeminiNode: ['model'], GeminiImage2Node: ['resolution'],