Skip to content

[feat] Add pricing for new API nodes #4391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 252 additions & 0 deletions comfyui_pricing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
{
"BFL": {
"flux-dev": "$0.025",
"flux-pro-1.1": "$0.04",
"flux-pro-1.1-ultra": "$0.06",
"flux-pro-1.1-pro": "$0.05",
"flux tools (edit, fill, expand, canny)": "$0.05",
"flux.1 Kontext Pro Image": "$0.04",
"flux.1 Kontext Max Image": "$0.08"
},
"Ideogram": {
"V2_edit": "$0.08",
"V2_TURBO_edit": "$0.05",
"V1_generate": "$0.06",
"V1_TURBO_generate": "$0.02",
"V2A_generate": "$0.04",
"V2A_TURBO_generate": "$0.025",
"V2_generate": "$0.08",
"V2_TURBO_generate": "$0.05",
"V2_reframe": "$0.08",
"V2_TURBO_reframe": "$0.05",
"V1_remix": "$0.02",
"V2A_remix": "$0.04",
"V2A_TURBO_remix": "$0.025",
"V2_remix": "$0.08",
"V2_TURBO_remix": "$0.05",
"V3_edit_BALANCED": "$0.06",
"V3_edit_QUALITY": "$0.09",
"V3_edit_TURBO": "$0.03",
"V3_generate_BALANCED": "$0.06",
"V3_generate_QUALITY": "$0.09",
"V3_generate_TURBO": "$0.03",
"V3_reframe_QUALITY": "$0.09",
"V3_reframe_BALANCED": "$0.06",
"V3_reframe_TURBO": "$0.03",
"V3_remix_BALANCED": "$0.06",
"V3_remix_QUALITY": "$0.09",
"V3_remix_TURBO": "$0.03",
"V3_replace-background_QUALITY": "$0.09",
"V3_replace-background_TURBO": "$0.03",
"V3_replace-background_BALANCED": "$0.06"
},
"Kling": {
"pro_kling-v5": "$0.49",
"pro_kling-v1-6": "$0.49",
"pro_kling-v1": "$0.49",
"pro_kling-v2-master": "$1.4",
"std_kling-v1-5": "$0.28",
"std_kling-v1-6": "$0.28",
"std_kling-v1": "$0.14",
"std_kling-v2-master": "$1.4",
"text to image (kling-v1)": "$0.0035",
"image to image (kling-v1)": "$0.0035",
"text to image (kling-v1-5)": "$0.014",
"text to image (kling-v2)": "$0.014",
"image to image (kling-v1-5)": "$0.028",
"Virtual Try On (kolors v1, v1-5)": "0.07",
"video extension": "$0.28",
"video effects (hug, kiss, heart_gesture)": "Priced the same as t2v based on mode, model, and duration.",
"video effects (fuzzyfuzzy/squish/expansion)": "$0.28",
"video effects (dizzydizzy/bloombloom)": "$0.49",
"lip sync (5s)": "$0.07",
"lip sync (10s)": "$0.14"
},
"Luma": {
"ray-1-6": "$0.0032 / 1M pixels",
"ray-2": "$0.0064 / 1M pixels",
"rayflash-2": "$0.0022 / 1M pixels",
"Text to Image": "$0.0019 / 1M pixels",
"Image to Image": "$0.0073 / 1M pixels"
},
"MiniMax": {
"I2V-01-Director": "$0.43",
"I2V-01-live": "$0.43",
"I2V-01": "$0.43",
"S2V-01 (not enabled yet)": "$0.65",
"T2V-01-Director": "$0.43",
"T2V-01": "$0.43"
},
"OpenAI": {
"dall-e-2, 1024\u00d71024": "$0.02",
"dall-e-2, 256\u00d7256": "$0.016",
"dall-e-2, 512\u00d7512": "$0.018",
"dall-e-3, 1024\u00d71024, hd": "$0.08",
"dall-e-3, 1024\u00d71792, hd": "$0.12",
"dall-e-3, 1024\u00d71024, standard": "$0.04",
"dall-e-3, 1024\u00d71792, standard": "$0.08",
"gpt-image-1, input image tokens": "$10 / 1M tokens",
"gpt-image-1, input text tokens": "$5 / 1M tokens",
"gpt-image-1, output tokens": "$40 / 1M tokens",
"Output Text Tokens,computer-use-preview": "$12 / 1M tokens",
"Output Text Tokens,gpt-4.1-mini": "$1.6 / 1M tokens",
"Output Text Tokens,gpt-4.1-nano": "$0.4 / 1M tokens",
"Output Text Tokens,gpt-4.1": "$8 / 1M tokens",
"Output Text Tokens,gpt-4.5-preview": "$150 / 1M tokens",
"Output Text Tokens,gpt-4o-audio-preview": "$10 / 1M tokens",
"Output Text Tokens,gpt-4o-mini-audio-preview": "$0.6 / 1M tokens",
"Output Text Tokens,gpt-4o-mini": "$0.6 / 1M tokens",
"Output Text Tokens,gpt-4o-mini-realtime-preview": "$2.4 / 1M tokens",
"Output Text Tokens,gpt-4o-mini-search-preview": "$0.6 / 1M tokens",
"Output Text Tokens,gpt-4o": "$10 / 1M tokens",
"Output Text Tokens,gpt-4o-realtime-preview": "$20 / 1M tokens",
"Output Text Tokens,gpt-4o-search-preview": "$10 / 1M tokens",
"Output Text Tokens,o1-mini": "$4.4 / 1M tokens",
"Output Text Tokens,o1": "$60 / 1M tokens",
"Output Text Tokens,o1-pro": "$600 / 1M tokens",
"Output Text Tokens,o3-mini": "$4.4 / 1M tokens",
"Output Text Tokens,o3": "$40 / 1M tokens",
"Output Text Tokens,o4-mini": "$4.4 / 1M tokens",
"Input Image Tokens,gpt-image-1": "$10 / 1M tokens",
"Input Text Tokens,computer-use-preview": "$3 / 1M tokens",
"Input Text Tokens,gpt-4.1-mini": "$0.4 / 1M tokens",
"Input Text Tokens,gpt-4.1-nano": "$0.1 / 1M tokens",
"Input Text Tokens,gpt-4.1": "$2 / 1M tokens",
"Input Text Tokens,gpt-4.5-preview": "$75 / 1M tokens",
"Input Text Tokens,gpt-4o-audio-preview": "$2.5 / 1M tokens",
"Input Text Tokens,gpt-4o-mini-audio-preview": "$0.15 / 1M tokens",
"Input Text Tokens,gpt-4o-mini": "$0.15 / 1M tokens",
"Input Text Tokens,gpt-4o-mini-realtime-preview": "$0.6 / 1M tokens",
"Input Text Tokens,gpt-4o-mini-search-preview": "$0.15 / 1M tokens",
"Input Text Tokens,gpt-4o": "$2.5 / 1M tokens",
"Input Text Tokens,gpt-4o-realtime-preview": "$5 / 1M tokens",
"Input Text Tokens,gpt-4o-search-preview": "$2.5 / 1M tokens",
"Input Text Tokens,gpt-image-1": "$5 / 1M tokens",
"Input Text Tokens,o1-mini": "$1.1 / 1M tokens",
"Input Text Tokens,o1": "$15 / 1M tokens",
"Input Text Tokens,o1-pro": "$150 / 1M tokens",
"Input Text Tokens,o3-mini": "$1.1 / 1M tokens",
"Input Text Tokens,o3": "$10 / 1M tokens",
"Input Text Tokens,o4-mini": "$1.1 / 1M tokens",
"Cached Input Text Tokens,gpt-4.1-mini": "$0.1 / 1M tokens",
"Cached Input Text Tokens,gpt-4.1-nano": "$0.025 / 1M tokens",
"Cached Input Text Tokens,gpt-4.1": "$0.5 / 1M tokens",
"Cached Input Text Tokens,gpt-4.5-preview": "$37.5 / 1M tokens",
"Cached Input Text Tokens,gpt-4o-mini": "$0.075 / 1M tokens",
"Cached Input Text Tokens,gpt-4o-mini-realtime-preview": "$0.3 / 1M tokens",
"Cached Input Text Tokens,gpt-4o": "$1.25 / 1M tokens",
"Cached Input Text Tokens,gpt-4o-realtime-preview": "$2.5 / 1M tokens",
"Cached Input Text Tokens,o1-mini": "$0.55 / 1M tokens",
"Cached Input Text Tokens,o1": "$7.5 / 1M tokens",
"Cached Input Text Tokens,o3-mini": "$0.55 / 1M tokens",
"Cached Input Text Tokens,o4-mini": "$0.275 / 1M tokens",
"Output Image Tokens,gpt-image-1": "$40 / 1M tokens"
},
"PixVerse": {
"8s, v4_360p_normal i2v/i2v/template": "$0.9",
"8s, v4_540p_normal": "$0.9",
"8s, v4_720p_normal": "$1.2",
"5s, v4_360p_fast": "$0.9",
"5s, v4_540p_fast": "$0.9",
"5s, v4_720p_fast": "$1.2",
"5s, v4_1080p_fast": "$1.2",
"5s, v4_360p_normal": "$0.45",
"5s, v4_540p_normal": "$0.45",
"5s, v4_720p_normal": "$0.6"
},
"Pika": {
"5s_generate/v2.2/i2v_1080p": "$0.45",
"5s_generate/v2.2/i2v_720p": "$0.2",
"5s_generate/v2.2/pikaframes_1080p": "$0.3",
"5s_generate/v2.2/pikaframes_720p": "$0.2",
"5s_generate/v2.2/pikascenes_1080p": "$0.5",
"5s_generate/v2.2/pikascenes_720p": "$0.3",
"5s_generate/v2.2/t2v_1080p": "$0.45",
"5s_generate/v2.2/t2v_720p": "$0.2",
"10s_generate/v2.2/i2v_1080p": "$1",
"10s_generate/v2.2/i2v_720p": "$0.6",
"10s_generate/v2.2/pikaframes_1080p": "$1",
"10s_generate/v2.2/pikaframes_720p": "$0.25",
"10s_generate/v2.2/pikascenes_1080p": "$1.5",
"10s_generate/v2.2/pikascenes_720p": "$0.4",
"10s_generate/v2.2/t2v_1080p": "$1",
"10s_generate/v2.2/t2v_720p": "$0.6",
"5s_pikaffects_720p": "$0.45",
"5s_pikadditions_720p": "$0.30",
"5s_pikaswaps_720p": "$0.30"
},
"RunwayML": {
"gen4_image": "$0.08",
"gen3a_turbo": "$0.05 / second",
"gen4_turbo": "$0.05 / second"
},
"Recraft": {
"recraftv2_digital_illustration": "$0.022",
"recraftv2_icon": "$0.044",
"recraftv2_logo_raster": "$0.022",
"recraftv2_realistic_image": "$0.022",
"recraftv2_vector_illustration": "$0.044",
"recraftv3_digital_illustration": "$0.04",
"recraftv3_logo_raster": "$0.04",
"recraftv3_realistic_image": "$0.04",
"recraftv3_vector_illustration": "$0.08",
"v1/images/removeBackground": "$0.01",
"v1/images/imageToImage": "0.04\u22120.04 - 0.04\u22120.08",
"v1/images/inpaint": "0.04\u22120.04 - 0.04\u22120.08",
"v1/images/replaceBackground": "0.04\u22120.04 - 0.04\u22120.08",
"v1/images/vectorize": "$0.01",
"v1/images/creativeUpscale": "$0.25",
"v1/images/crispUpscale": "$0.004"
},
"Stability AI": {
"v2beta/stable-image/generate/ultra": "$0.08",
"v2beta/stable-image/generate/core": "$0.03",
"v2beta/stable-image/generate/sd3.5": "0.035\u22120.035 - 0.035\u22120.065",
"v2beta/stable-image/upscale": "0.01\u22120.01 - 0.01\u22120.25"
},
"Tripo": {
"image_to_model": "$0.3",
"refine_model": "$0.3",
"text_to_model": "$0.2",
"animate_retarget": "$0.1",
"animate_rig": "$0.25",
"stylize_model": "$0.2",
"convert_format:advanced": "$0.1",
"convert_format:basic": "$0.05",
"image_to_model, model:v2.0-20240919": "$0.2",
"multiview_to_model, model:v2.0-20240919": "$0.2",
"text_to_model, model:v2.0-20240919": "$0.1",
"image_to_model, model:v2.5-20250123": "$0.2",
"multiview_to_model, model:v2.5-20250123": "$0.2",
"text_to_model, model:v2.5-20250123": "$0.1",
"image_to_model, model:v2.0-20240919, texture_quality:detailed": "$0.4",
"multiview_to_model, model:v2.0-20240919, texture_quality:detailed": "$0.4",
"text_to_model, model:v2.0-20240919, texture_quality:detailed": "$0.3",
"image_to_model, model:v2.0-20240919, texture_quality:standard": "$0.3",
"multiview_to_model, model:v2.0-20240919, texture_quality:standard": "$0.3",
"text_to_model, model:v2.0-20240919, texture_quality:standard": "$0.2",
"image_to_model, model:v2.5-20250123, texture_quality:detailed": "$0.4",
"multiview_to_model, model:v2.5-20250123, texture_quality:detailed": "$0.4",
"text_to_model, model:v2.5-20250123, texture_quality:detailed": "$0.3",
"image_to_model, model:v2.5-20250123, texture_quality:standard": "$0.3",
"multiview_to_model, model:v2.5-20250123, texture_quality:standard": "$0.3",
"text_to_model, model:v2.5-20250123, texture_quality:standard": "$0.2",
"Tripo Add Texture Product,texture_quality:detailed": "$0.2",
"Tripo Add Texture Product,texture_quality:standard": "$0.1",
"Tripo Style Product": "$0.05",
"Tripo Quadrangular Product": "$0.05",
"Tripo V1-4 Generation Product,image_to_model": "$0.3",
"Tripo V1-4 Generation Product,refine_model": "$0.3",
"Tripo V1-4 Generation Product,text_to_model": "$0.2",
"Tripo Post-Processing Product,animate_retarget": "$0.1",
"Tripo Post-Processing Product,animate_rig": "$0.25",
"Tripo Post-Processing Product,stylize_model": "$0.2"
},
"Rodin": {
"Rodin 3D Generation (no addons)": "$0.4",
"Rodin 3D Generation (with AddOns)": "$1.2"
},
"Google": {
"veo-2.0-generate-001": "$0.5 / second"
}
}
121 changes: 121 additions & 0 deletions compare_pricing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#!/usr/bin/env python3
import json
import re

# Load the HTML pricing data
with open('comfyui_pricing.json', 'r') as f:
html_pricing = json.load(f)

# Current pricing in our codebase (extracted manually from useNodePricing.ts)
current_pricing = {
'FluxProCannyNode': '$0.05/Run',
'FluxProDepthNode': '$0.05/Run',
'FluxProExpandNode': '$0.05/Run',
'FluxProFillNode': '$0.05/Run',
'FluxProUltraImageNode': '$0.06/Run',
'IdeogramV1': '$0.06', # base price per image
'IdeogramV2': '$0.08', # base price per image
'IdeogramV3': {'turbo': '$0.03', 'balanced': '$0.06', 'quality': '$0.08'},
'KlingCameraControlI2VNode': '$0.49/Run',
'KlingCameraControlT2VNode': '$0.14/Run',
'KlingTextToVideoNode': {'std': {'5s': '$0.14', '10s': '$0.28'}, 'pro': {'5s': '$0.49', '10s': '$0.98'}},
'LumaVideoNode': {
'ray-2': {'540p_5s': '$0.14', '540p_10s': '$0.28', '720p_5s': '$0.28', '720p_10s': '$0.56'},
'ray-1-6': {'540p_5s': '$0.07', '540p_10s': '$0.14', '720p_5s': '$0.14', '720p_10s': '$0.28'},
'rayflash-2': {'540p_5s': '$0.05', '540p_10s': '$0.10', '720p_5s': '$0.10', '720p_10s': '$0.20'}
},
'MinimaxVideoNode': '$0.43/Run',
'MoonvalleyTxt2VideoNode': {'5s': '$1.50/Run', '10s': '$3.00/Run'},
'MoonvalleyImg2VideoNode': {'5s': '$1.50/Run', '10s': '$3.00/Run'},
'MoonvalleyVideo2VideoNode': {'5s': '$2.25/Run', '10s': '$4.00/Run'},
'OpenAIDalle2': {'256x256': '$0.016', '512x512': '$0.018', '1024x1024': '$0.02'},
'OpenAIDalle3': {
'standard_1024x1024': '$0.04',
'standard_1024x1792': '$0.08',
'hd_1024x1024': '$0.08',
'hd_1024x1792': '$0.12'
},
'OpenAIGPTImage1': {'input_image': '$10/1M', 'input_text': '$5/1M', 'output': '$40/1M'},
'PixverseTextToVideoNode': 'varies', # Complex pricing
'PikaLabsVideoNode': 'varies', # Complex pricing
'RecraftTextToImageNode': '$0.022', # base price
'RecraftImageInpaintingNode': '$0.022', # base price
'RecraftRemoveBackgroundNode': '$0.01',
'RecraftClarity': '$0.004',
'RecraftGenerativeUpscale': '$0.25',
'RecraftVectorizeImage': '$0.01',
'RecraftV3TextToImageNode': '$0.04', # base price
'StabilityAICoreTextToImageNode': '$0.03/Run',
'StabilityAIUltraTextToImageNode': '$0.08/Run',
'StabilityAISd35TextToImageNode': 'varies', # $0.035-$0.065
'VeoVideoGenerationNode': '$0.5/second'
}

# Map our node names to HTML pricing entries
node_mapping = {
'FluxProCannyNode': ('BFL', 'flux tools (edit, fill, expand, canny)'),
'FluxProDepthNode': ('BFL', 'flux tools (edit, fill, expand, canny)'),
'FluxProExpandNode': ('BFL', 'flux tools (edit, fill, expand, canny)'),
'FluxProFillNode': ('BFL', 'flux tools (edit, fill, expand, canny)'),
'FluxProUltraImageNode': ('BFL', 'flux-pro-1.1-ultra'),
'IdeogramV1': ('Ideogram', 'V1_generate'),
'IdeogramV2': ('Ideogram', 'V2_generate'),
'IdeogramV3': ('Ideogram', ['V3_generate_TURBO', 'V3_generate_BALANCED', 'V3_generate_QUALITY']),
'OpenAIDalle2': ('OpenAI', ['dall-e-2, 256×256', 'dall-e-2, 512×512', 'dall-e-2, 1024×1024']),
'OpenAIDalle3': ('OpenAI', ['dall-e-3, 1024×1024, standard', 'dall-e-3, 1024×1792, standard',
'dall-e-3, 1024×1024, hd', 'dall-e-3, 1024×1792, hd']),
'VeoVideoGenerationNode': ('Google', 'veo-2.0-generate-001'),
'StabilityAICoreTextToImageNode': ('Stability AI', 'v2beta/stable-image/generate/core'),
'StabilityAIUltraTextToImageNode': ('Stability AI', 'v2beta/stable-image/generate/ultra')
}

print("=== PRICING COMPARISON ===\n")
print("Node Name | Current Price | HTML Price | Status")
print("-" * 70)

issues_found = []

for node_name, mapping in node_mapping.items():
provider, model_keys = mapping

if provider in html_pricing:
if isinstance(model_keys, list):
# Multiple models for this node
for model_key in model_keys:
if model_key in html_pricing[provider]:
html_price = html_pricing[provider][model_key]
print(f"{node_name} ({model_key}): {current_pricing.get(node_name, 'N/A')} | {html_price}")

# Simple comparison - check if prices differ
if node_name in current_pricing:
current = current_pricing[node_name]
if isinstance(current, dict):
# Skip complex comparisons for now
pass
elif current.replace('/Run', '') != html_price:
issues_found.append(f"{node_name}: Current={current}, Should be={html_price}")
else:
# Single model
if model_keys in html_pricing[provider]:
html_price = html_pricing[provider][model_keys]
current = current_pricing.get(node_name, 'N/A')
status = "✓" if str(current).replace('/Run', '') == html_price else "✗"
print(f"{node_name}: {current} | {html_price} | {status}")

if status == "✗" and node_name in current_pricing:
issues_found.append(f"{node_name}: Current={current}, Should be={html_price}")

print("\n\n=== ISSUES FOUND ===")
for issue in issues_found:
print(f"- {issue}")

# Check for new nodes in HTML that aren't in our codebase
print("\n\n=== NEW NODES IN HTML (for PR 2) ===")
new_nodes = []
# Check specific providers for video/image generation nodes
for provider in ['RunwayML', 'Tripo', 'Rodin']:
if provider in html_pricing:
print(f"\n{provider}:")
for model, price in html_pricing[provider].items():
print(f" {model}: {price}")
new_nodes.append((provider, model, price))
Loading