From b0f98297da757772b53377b23a0633789999bbe3 Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Tue, 6 Jan 2026 15:49:28 +0200 Subject: [PATCH] use full names for "widgets", "inputs" and "groups" --- comfy_api_nodes/nodes_bfl.py | 8 ++-- comfy_api_nodes/nodes_bytedance.py | 8 ++-- comfy_api_nodes/nodes_gemini.py | 4 +- comfy_api_nodes/nodes_ideogram.py | 14 +++--- comfy_api_nodes/nodes_kling.py | 48 +++++++++---------- comfy_api_nodes/nodes_ltxv.py | 4 +- comfy_api_nodes/nodes_luma.py | 10 ++-- comfy_api_nodes/nodes_minimax.py | 4 +- comfy_api_nodes/nodes_moonvalley.py | 6 +-- comfy_api_nodes/nodes_openai.py | 14 +++--- comfy_api_nodes/nodes_pixverse.py | 6 +-- comfy_api_nodes/nodes_recraft.py | 10 ++-- comfy_api_nodes/nodes_runway.py | 6 +-- comfy_api_nodes/nodes_sora.py | 6 +-- comfy_api_nodes/nodes_stability.py | 2 +- comfy_api_nodes/nodes_tripo.py | 72 ++++++++++++++--------------- comfy_api_nodes/nodes_veo2.py | 12 ++--- comfy_api_nodes/nodes_wan.py | 8 ++-- 18 files changed, 121 insertions(+), 121 deletions(-) diff --git a/comfy_api_nodes/nodes_bfl.py b/comfy_api_nodes/nodes_bfl.py index 79c20d059..c67076dd6 100644 --- a/comfy_api_nodes/nodes_bfl.py +++ b/comfy_api_nodes/nodes_bfl.py @@ -523,9 +523,9 @@ class Flux2ProImageNode(IO.ComfyNode): PRICE_BADGE_EXPR = """ ( $MP := 1024 * 1024; - $outMP := $max([1, $floor(((w.width.n * w.height.n) + $MP - 1) / $MP)]); + $outMP := $max([1, $floor(((widgets.width.n * widgets.height.n) + $MP - 1) / $MP)]); $outputCost := 0.03 + 0.015 * ($outMP - 1); - i.images.connected + inputs.images.connected ? { "type":"range_usd", "min_usd": $outputCost + 0.015, @@ -654,10 +654,10 @@ class Flux2MaxImageNode(Flux2ProImageNode): PRICE_BADGE_EXPR = """ ( $MP := 1024 * 1024; - $outMP := $max([1, $floor(((w.width.n * w.height.n) + $MP - 1) / $MP)]); + $outMP := $max([1, $floor(((widgets.width.n * widgets.height.n) + $MP - 1) / $MP)]); $outputCost := 0.07 + 0.03 * ($outMP - 1); - i.images.connected + inputs.images.connected ? { "type":"range_usd", "min_usd": $outputCost + 0.03, diff --git a/comfy_api_nodes/nodes_bytedance.py b/comfy_api_nodes/nodes_bytedance.py index 471ca8e8b..05388f970 100644 --- a/comfy_api_nodes/nodes_bytedance.py +++ b/comfy_api_nodes/nodes_bytedance.py @@ -374,7 +374,7 @@ class ByteDanceSeedreamNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model"]), expr=""" ( - $price := $contains(w.model.s, "seedream-4-5-251128") ? 0.04 : 0.03; + $price := $contains(widgets.model.s, "seedream-4-5-251128") ? 0.04 : 0.03; { "type":"usd", "usd": $price, @@ -987,12 +987,12 @@ PRICE_BADGE_VIDEO = IO.PriceBadge( "1080p":[0.85,0.88] } }; - $model := w.model.s; + $model := widgets.model.s; $modelKey := $contains($model, "seedance-1-0-pro-fast") ? "seedance-1-0-pro-fast" : $contains($model, "seedance-1-0-pro") ? "seedance-1-0-pro" : "seedance-1-0-lite"; - $resolution := w.resolution.s; + $resolution := widgets.resolution.s; $resKey := $contains($resolution, "1080") ? "1080p" : $contains($resolution, "720") ? "720p" : @@ -1001,7 +1001,7 @@ PRICE_BADGE_VIDEO = IO.PriceBadge( $baseRange := $lookup($modelPrices, $resKey); $min10s := $baseRange[0]; $max10s := $baseRange[1]; - $scale := w.duration.n / 10; + $scale := widgets.duration.n / 10; $minCost := $min10s * $scale; $maxCost := $max10s * $scale; ($minCost = $maxCost) diff --git a/comfy_api_nodes/nodes_gemini.py b/comfy_api_nodes/nodes_gemini.py index ddc2e868a..6e6dc6f8d 100644 --- a/comfy_api_nodes/nodes_gemini.py +++ b/comfy_api_nodes/nodes_gemini.py @@ -313,7 +313,7 @@ class GeminiNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model"]), expr=""" ( - $m := w.model.s; + $m := widgets.model.s; $contains($m, "gemini-2.5-flash") ? {"type":"list_usd","usd":[0.0003,0.0025]} @@ -723,7 +723,7 @@ class GeminiImage2(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["resolution"]), expr=""" ( - $r := w.resolution.s; + $r := widgets.resolution.s; ($contains($r,"1k") or $contains($r,"2k")) ? {"type":"usd","usd":0.134,"format":{"suffix":"/Image","approximate":true}} : $contains($r,"4k") diff --git a/comfy_api_nodes/nodes_ideogram.py b/comfy_api_nodes/nodes_ideogram.py index b93a17755..d3985ddfd 100644 --- a/comfy_api_nodes/nodes_ideogram.py +++ b/comfy_api_nodes/nodes_ideogram.py @@ -302,8 +302,8 @@ class IdeogramV1(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["num_images", "turbo"]), expr=""" ( - $n := w.num_images.n; - $base := (w.turbo.b = true) ? 0.0286 : 0.0858; + $n := widgets.num_images.n; + $base := (widgets.turbo.b = true) ? 0.0286 : 0.0858; {"type":"usd","usd": $round($base * $n, 2)} ) """, @@ -450,8 +450,8 @@ class IdeogramV2(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["num_images", "turbo"]), expr=""" ( - $n := w.num_images.n; - $base := (w.turbo.b = true) ? 0.0715 : 0.1144; + $n := widgets.num_images.n; + $base := (widgets.turbo.b = true) ? 0.0715 : 0.1144; {"type":"usd","usd": $round($base * $n, 2)} ) """, @@ -615,9 +615,9 @@ class IdeogramV3(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["rendering_speed", "num_images"], inputs=["character_image"]), expr=""" ( - $n := w.num_images.n; - $speed := w.rendering_speed.s; - $hasChar := i.character_image.connected; + $n := widgets.num_images.n; + $speed := widgets.rendering_speed.s; + $hasChar := inputs.character_image.connected; $base := $contains($speed,"quality") ? ($hasChar ? 0.286 : 0.1287) : $contains($speed,"default") ? ($hasChar ? 0.2145 : 0.0858) : diff --git a/comfy_api_nodes/nodes_kling.py b/comfy_api_nodes/nodes_kling.py index fd724dc7f..3eac529fe 100644 --- a/comfy_api_nodes/nodes_kling.py +++ b/comfy_api_nodes/nodes_kling.py @@ -768,7 +768,7 @@ class KlingTextToVideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["mode"]), expr=""" ( - $m := w.mode.s; + $m := widgets.mode.s; $contains($m,"v2-5-turbo") ? ($contains($m,"10") ? {"type":"usd","usd":0.7} : {"type":"usd","usd":0.35}) : $contains($m,"v2-1-master") @@ -849,9 +849,9 @@ class OmniProTextToVideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["duration", "resolution"]), expr=""" ( - $mode := (w.resolution.s = "720p") ? "std" : "pro"; + $mode := (widgets.resolution.s = "720p") ? "std" : "pro"; $rates := {"std": 0.084, "pro": 0.112}; - {"type":"usd","usd": $lookup($rates, $mode) * w.duration.n} + {"type":"usd","usd": $lookup($rates, $mode) * widgets.duration.n} ) """, ), @@ -927,9 +927,9 @@ class OmniProFirstLastFrameNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["duration", "resolution"]), expr=""" ( - $mode := (w.resolution.s = "720p") ? "std" : "pro"; + $mode := (widgets.resolution.s = "720p") ? "std" : "pro"; $rates := {"std": 0.084, "pro": 0.112}; - {"type":"usd","usd": $lookup($rates, $mode) * w.duration.n} + {"type":"usd","usd": $lookup($rates, $mode) * widgets.duration.n} ) """, ), @@ -1032,9 +1032,9 @@ class OmniProImageToVideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["duration", "resolution"]), expr=""" ( - $mode := (w.resolution.s = "720p") ? "std" : "pro"; + $mode := (widgets.resolution.s = "720p") ? "std" : "pro"; $rates := {"std": 0.084, "pro": 0.112}; - {"type":"usd","usd": $lookup($rates, $mode) * w.duration.n} + {"type":"usd","usd": $lookup($rates, $mode) * widgets.duration.n} ) """, ), @@ -1117,9 +1117,9 @@ class OmniProVideoToVideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["duration", "resolution"]), expr=""" ( - $mode := (w.resolution.s = "720p") ? "std" : "pro"; + $mode := (widgets.resolution.s = "720p") ? "std" : "pro"; $rates := {"std": 0.126, "pro": 0.168}; - {"type":"usd","usd": $lookup($rates, $mode) * w.duration.n} + {"type":"usd","usd": $lookup($rates, $mode) * widgets.duration.n} ) """, ), @@ -1213,7 +1213,7 @@ class OmniProEditVideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["resolution"]), expr=""" ( - $mode := (w.resolution.s = "720p") ? "std" : "pro"; + $mode := (widgets.resolution.s = "720p") ? "std" : "pro"; $rates := {"std": 0.126, "pro": 0.168}; {"type":"usd","usd": $lookup($rates, $mode), "format":{"suffix":"/second"}} ) @@ -1462,9 +1462,9 @@ class KlingImage2VideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["mode", "model_name", "duration"]), expr=""" ( - $mode := w.mode.s; - $model := w.model_name.s; - $dur := w.duration.s; + $mode := widgets.mode.s; + $model := widgets.model_name.s; + $dur := widgets.duration.s; $contains($model,"v2-5-turbo") ? ($contains($dur,"10") ? {"type":"usd","usd":0.7} : {"type":"usd","usd":0.35}) : ($contains($model,"v2-1-master") or $contains($model,"v2-master")) @@ -1635,7 +1635,7 @@ class KlingStartEndFrameNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["mode"]), expr=""" ( - $m := w.mode.s; + $m := widgets.mode.s; $contains($m,"v2-5-turbo") ? ($contains($m,"10") ? {"type":"usd","usd":0.7} : {"type":"usd","usd":0.35}) : $contains($m,"v2-1") @@ -1811,9 +1811,9 @@ class KlingDualCharacterVideoEffectNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["mode", "model_name", "duration"]), expr=""" ( - $mode := w.mode.s; - $model := w.model_name.s; - $dur := w.duration.s; + $mode := widgets.mode.s; + $model := widgets.model_name.s; + $dur := widgets.duration.s; ($contains($model,"v1-6") or $contains($model,"v1-5")) ? ( $contains($mode,"pro") @@ -1898,7 +1898,7 @@ class KlingSingleImageVideoEffectNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["effect_scene"]), expr=""" ( - ($contains(w.effect_scene.s,"dizzydizzy") or $contains(w.effect_scene.s,"bloombloom")) + ($contains(widgets.effect_scene.s,"dizzydizzy") or $contains(widgets.effect_scene.s,"bloombloom")) ? {"type":"usd","usd":0.49} : {"type":"usd","usd":0.28} ) @@ -2180,12 +2180,12 @@ class KlingImageGenerationNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model_name", "n"], inputs=["image"]), expr=""" ( - $m := w.model_name.s; + $m := widgets.model_name.s; $base := $contains($m,"kling-v1-5") - ? (i.image.connected ? 0.028 : 0.014) + ? (inputs.image.connected ? 0.028 : 0.014) : ($contains($m,"kling-v1") ? 0.0035 : 0.014); - {"type":"usd","usd": $base * w.n.n} + {"type":"usd","usd": $base * widgets.n.n} ) """, ), @@ -2274,7 +2274,7 @@ class TextToVideoWithAudio(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["duration", "generate_audio"]), - expr="""{"type":"usd","usd": 0.07 * w.duration.n * (w.generate_audio.b ? 2 : 1)}""", + expr="""{"type":"usd","usd": 0.07 * widgets.duration.n * (widgets.generate_audio.b ? 2 : 1)}""", ), ) @@ -2342,7 +2342,7 @@ class ImageToVideoWithAudio(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["duration", "generate_audio"]), - expr="""{"type":"usd","usd": 0.07 * w.duration.n * (w.generate_audio.b ? 2 : 1)}""", + expr="""{"type":"usd","usd": 0.07 * widgets.duration.n * (widgets.generate_audio.b ? 2 : 1)}""", ), ) @@ -2429,7 +2429,7 @@ class MotionControl(IO.ComfyNode): expr=""" ( $prices := {"std": 0.07, "pro": 0.112}; - {"type":"usd","usd": $lookup($prices, w.mode.s), "format":{"suffix":"/second"}} + {"type":"usd","usd": $lookup($prices, widgets.mode.s), "format":{"suffix":"/second"}} ) """, ), diff --git a/comfy_api_nodes/nodes_ltxv.py b/comfy_api_nodes/nodes_ltxv.py index 397181bab..3df910380 100644 --- a/comfy_api_nodes/nodes_ltxv.py +++ b/comfy_api_nodes/nodes_ltxv.py @@ -35,9 +35,9 @@ PRICE_BADGE = IO.PriceBadge( $pps := { "ltx-2 (pro)": {"1920x1080":0.06,"2560x1440":0.12,"3840x2160":0.24}, "ltx-2 (fast)": {"1920x1080":0.04,"2560x1440":0.08,"3840x2160":0.16} - }[w.model.s][w.resolution.s]; + }[widgets.model.s][widgets.resolution.s]; - {"type":"usd","usd": $pps * w.duration.n} + {"type":"usd","usd": $pps * widgets.duration.n} ) """, ) diff --git a/comfy_api_nodes/nodes_luma.py b/comfy_api_nodes/nodes_luma.py index 95401bc66..915edcb3f 100644 --- a/comfy_api_nodes/nodes_luma.py +++ b/comfy_api_nodes/nodes_luma.py @@ -193,7 +193,7 @@ class LumaImageGenerationNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model"]), expr=""" ( - $m := w.model.s; + $m := widgets.model.s; $contains($m,"photon-flash-1") ? {"type":"usd","usd":0.0027} : $contains($m,"photon-1") @@ -320,7 +320,7 @@ class LumaImageModifyNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model"]), expr=""" ( - $m := w.model.s; + $m := widgets.model.s; $contains($m,"photon-flash-1") ? {"type":"usd","usd":0.0027} : $contains($m,"photon-1") @@ -612,9 +612,9 @@ PRICE_BADGE_VIDEO = IO.PriceBadge( } }; - $m := w.model.s; - $d := w.duration.s; - $r := w.resolution.s; + $m := widgets.model.s; + $d := widgets.duration.s; + $r := widgets.resolution.s; $modelKey := $contains($m,"ray-flash-2") ? "ray-flash-2" : diff --git a/comfy_api_nodes/nodes_minimax.py b/comfy_api_nodes/nodes_minimax.py index bb025112f..03436f3b9 100644 --- a/comfy_api_nodes/nodes_minimax.py +++ b/comfy_api_nodes/nodes_minimax.py @@ -350,8 +350,8 @@ class MinimaxHailuoVideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["resolution", "duration"]), expr=""" ( - $r := w.resolution.s; - $d := w.duration.s; + $r := widgets.resolution.s; + $d := widgets.duration.s; $price := $contains($r,"768p") diff --git a/comfy_api_nodes/nodes_moonvalley.py b/comfy_api_nodes/nodes_moonvalley.py index 23e64db29..6f12b10e2 100644 --- a/comfy_api_nodes/nodes_moonvalley.py +++ b/comfy_api_nodes/nodes_moonvalley.py @@ -237,7 +237,7 @@ class MoonvalleyImg2VideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["length"]), expr=""" ( - $len := w.length.s; + $len := widgets.length.s; {"type":"usd","usd": ($len = "10s" ? 3.0 : 1.5)} ) """, @@ -364,7 +364,7 @@ class MoonvalleyVideo2VideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["length"]), expr=""" ( - $len := w.length.s; + $len := widgets.length.s; {"type":"usd","usd": ($len = "10s" ? 4.0 : 2.25)} ) """, @@ -493,7 +493,7 @@ class MoonvalleyTxt2VideoNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["length"]), expr=""" ( - $len := w.length.s; + $len := widgets.length.s; {"type":"usd","usd": ($len = "10s" ? 3.0 : 1.5)} ) """, diff --git a/comfy_api_nodes/nodes_openai.py b/comfy_api_nodes/nodes_openai.py index d2e674f68..6d036c719 100644 --- a/comfy_api_nodes/nodes_openai.py +++ b/comfy_api_nodes/nodes_openai.py @@ -164,8 +164,8 @@ class OpenAIDalle2(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["size", "n"]), expr=""" ( - $size := w.size.s; - $nRaw := w.n.n; + $size := widgets.size.s; + $nRaw := widgets.n.n; $n := ($nRaw != null and $nRaw != 0) ? $nRaw : 1; $base := @@ -308,8 +308,8 @@ class OpenAIDalle3(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["size", "quality"]), expr=""" ( - $size := w.size.s; - $q := w.quality.s; + $size := widgets.size.s; + $q := widgets.quality.s; $hd := $contains($q, "hd"); $price := @@ -456,8 +456,8 @@ class OpenAIGPTImage1(IO.ComfyNode): "medium": [0.046, 0.07], "high": [0.167, 0.3] }; - $range := $lookup($ranges, w.quality.s); - $n := w.n.n; + $range := $lookup($ranges, widgets.quality.s); + $n := widgets.n.n; ($n = 1) ? {"type":"range_usd","min_usd": $range[0], "max_usd": $range[1]} : { @@ -628,7 +628,7 @@ class OpenAIChatNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model"]), expr=""" ( - $m := w.model.s; + $m := widgets.model.s; $contains($m,"o4-mini") ? {"type":"list_usd","usd":[0.0011,0.0044]} : $contains($m,"o1-pro") ? {"type":"list_usd","usd":[0.15,0.6]} : diff --git a/comfy_api_nodes/nodes_pixverse.py b/comfy_api_nodes/nodes_pixverse.py index ac95cf5c2..c6dd1f83f 100644 --- a/comfy_api_nodes/nodes_pixverse.py +++ b/comfy_api_nodes/nodes_pixverse.py @@ -423,9 +423,9 @@ PRICE_BADGE_VIDEO = IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["duration_seconds", "quality", "motion_mode"]), expr=""" ( - $d := w.duration_seconds.s; - $q := w.quality.s; - $m := w.motion_mode.s; + $d := widgets.duration_seconds.s; + $q := widgets.quality.s; + $m := widgets.motion_mode.s; $price := $contains($d,"5") diff --git a/comfy_api_nodes/nodes_recraft.py b/comfy_api_nodes/nodes_recraft.py index 977819d5e..49fa65b73 100644 --- a/comfy_api_nodes/nodes_recraft.py +++ b/comfy_api_nodes/nodes_recraft.py @@ -380,7 +380,7 @@ class RecraftTextToImageNode(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["n"]), - expr="""{"type":"usd","usd": $round(0.04 * w.n.n, 2)}""", + expr="""{"type":"usd","usd": $round(0.04 * widgets.n.n, 2)}""", ), ) @@ -496,7 +496,7 @@ class RecraftImageToImageNode(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["n"]), - expr="""{"type":"usd","usd": $round(0.04 * w.n.n, 2)}""", + expr="""{"type":"usd","usd": $round(0.04 * widgets.n.n, 2)}""", ), ) @@ -601,7 +601,7 @@ class RecraftImageInpaintingNode(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["n"]), - expr="""{"type":"usd","usd": $round(0.04 * w.n.n, 2)}""", + expr="""{"type":"usd","usd": $round(0.04 * widgets.n.n, 2)}""", ), ) @@ -706,7 +706,7 @@ class RecraftTextToVectorNode(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["n"]), - expr="""{"type":"usd","usd": $round(0.08 * w.n.n, 2)}""", + expr="""{"type":"usd","usd": $round(0.08 * widgets.n.n, 2)}""", ), ) @@ -777,7 +777,7 @@ class RecraftVectorizeImageNode(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["n"]), - expr="""{"type":"usd","usd": $round(0.01 * w.n.n, 2)}""", + expr="""{"type":"usd","usd": $round(0.01 * widgets.n.n, 2)}""", ), ) diff --git a/comfy_api_nodes/nodes_runway.py b/comfy_api_nodes/nodes_runway.py index f66901e80..deb7a8419 100644 --- a/comfy_api_nodes/nodes_runway.py +++ b/comfy_api_nodes/nodes_runway.py @@ -186,7 +186,7 @@ class RunwayImageToVideoNodeGen3a(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["duration"]), - expr="""{"type":"usd","usd": 0.0715 * w.duration.n}""", + expr="""{"type":"usd","usd": 0.0715 * widgets.duration.n}""", ), ) @@ -280,7 +280,7 @@ class RunwayImageToVideoNodeGen4(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["duration"]), - expr="""{"type":"usd","usd": 0.0715 * w.duration.n}""", + expr="""{"type":"usd","usd": 0.0715 * widgets.duration.n}""", ), ) @@ -382,7 +382,7 @@ class RunwayFirstLastFrameNode(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["duration"]), - expr="""{"type":"usd","usd": 0.0715 * w.duration.n}""", + expr="""{"type":"usd","usd": 0.0715 * widgets.duration.n}""", ), ) diff --git a/comfy_api_nodes/nodes_sora.py b/comfy_api_nodes/nodes_sora.py index d988b401b..7f23a9587 100644 --- a/comfy_api_nodes/nodes_sora.py +++ b/comfy_api_nodes/nodes_sora.py @@ -93,9 +93,9 @@ class OpenAIVideoSora2(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model", "size", "duration"]), expr=""" ( - $m := w.model.s; - $size := w.size.s; - $dur := w.duration.n; + $m := widgets.model.s; + $size := widgets.size.s; + $dur := widgets.duration.n; $isPro := $contains($m, "sora-2-pro"); $isSora2 := $contains($m, "sora-2"); $isProSize := ($size = "1024x1792" or $size = "1792x1024"); diff --git a/comfy_api_nodes/nodes_stability.py b/comfy_api_nodes/nodes_stability.py index fdcd27dd1..b390f34af 100644 --- a/comfy_api_nodes/nodes_stability.py +++ b/comfy_api_nodes/nodes_stability.py @@ -271,7 +271,7 @@ class StabilityStableImageSD_3_5Node(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["model"]), expr=""" ( - $contains(w.model.s,"large") + $contains(widgets.model.s,"large") ? {"type":"usd","usd":0.065} : {"type":"usd","usd":0.035} ) diff --git a/comfy_api_nodes/nodes_tripo.py b/comfy_api_nodes/nodes_tripo.py index 0bbb98fb3..54fbdf33c 100644 --- a/comfy_api_nodes/nodes_tripo.py +++ b/comfy_api_nodes/nodes_tripo.py @@ -78,7 +78,7 @@ async def poll_until_finished( raise RuntimeError(f"Failed to generate mesh: {response_poll}") -class TripoTextToModelNode(IO.ComfyNode): +class TripoTextToModelNode(IO.ComfyNode): """ Generates 3D models synchronously based on a text prompt using Tripo's API. """ @@ -131,18 +131,18 @@ class TripoTextToModelNode(IO.ComfyNode): ), expr=""" ( - $isV14 := $contains(w.model_version.s,"v1.4"); - $style := w.style.s; + $isV14 := $contains(widgets.model_version.s,"v1.4"); + $style := widgets.style.s; $hasStyle := ($style != "" and $style != "none"); - $withTexture := w.texture.b or w.pbr.b; - $isHdTexture := (w.texture_quality.s = "detailed"); - $isDetailedGeometry := (w.geometry_quality.s = "detailed"); + $withTexture := widgets.texture.b or widgets.pbr.b; + $isHdTexture := (widgets.texture_quality.s = "detailed"); + $isDetailedGeometry := (widgets.geometry_quality.s = "detailed"); $baseCredits := $isV14 ? 20 : ($withTexture ? 20 : 10); $credits := $baseCredits + ($hasStyle ? 5 : 0) - + (w.quad.b ? 5 : 0) + + (widgets.quad.b ? 5 : 0) + ($isHdTexture ? 10 : 0) + ($isDetailedGeometry ? 20 : 0); {"type":"usd","usd": $round($credits * 0.01, 2)} @@ -256,18 +256,18 @@ class TripoImageToModelNode(IO.ComfyNode): ), expr=""" ( - $isV14 := $contains(w.model_version.s,"v1.4"); - $style := w.style.s; + $isV14 := $contains(widgets.model_version.s,"v1.4"); + $style := widgets.style.s; $hasStyle := ($style != "" and $style != "none"); - $withTexture := w.texture.b or w.pbr.b; - $isHdTexture := (w.texture_quality.s = "detailed"); - $isDetailedGeometry := (w.geometry_quality.s = "detailed"); + $withTexture := widgets.texture.b or widgets.pbr.b; + $isHdTexture := (widgets.texture_quality.s = "detailed"); + $isDetailedGeometry := (widgets.geometry_quality.s = "detailed"); $baseCredits := $isV14 ? 30 : ($withTexture ? 30 : 20); $credits := $baseCredits + ($hasStyle ? 5 : 0) - + (w.quad.b ? 5 : 0) + + (widgets.quad.b ? 5 : 0) + ($isHdTexture ? 10 : 0) + ($isDetailedGeometry ? 20 : 0); {"type":"usd","usd": $round($credits * 0.01, 2)} @@ -391,15 +391,15 @@ class TripoMultiviewToModelNode(IO.ComfyNode): ), expr=""" ( - $isV14 := $contains(w.model_version.s,"v1.4"); - $withTexture := w.texture.b or w.pbr.b; - $isHdTexture := (w.texture_quality.s = "detailed"); - $isDetailedGeometry := (w.geometry_quality.s = "detailed"); + $isV14 := $contains(widgets.model_version.s,"v1.4"); + $withTexture := widgets.texture.b or widgets.pbr.b; + $isHdTexture := (widgets.texture_quality.s = "detailed"); + $isDetailedGeometry := (widgets.geometry_quality.s = "detailed"); $baseCredits := $isV14 ? 30 : ($withTexture ? 30 : 20); $credits := $baseCredits - + (w.quad.b ? 5 : 0) + + (widgets.quad.b ? 5 : 0) + ($isHdTexture ? 10 : 0) + ($isDetailedGeometry ? 20 : 0); {"type":"usd","usd": $round($credits * 0.01, 2)} @@ -501,7 +501,7 @@ class TripoTextureNode(IO.ComfyNode): depends_on=IO.PriceBadgeDepends(widgets=["texture_quality"]), expr=""" ( - $tq := w.texture_quality.s; + $tq := widgets.texture_quality.s; {"type":"usd","usd": ($contains($tq,"detailed") ? 0.2 : 0.1)} ) """, @@ -772,24 +772,24 @@ class TripoConversionNode(IO.ComfyNode): ), expr=""" ( - $face := (w.face_limit.n != null) ? w.face_limit.n : -1; - $texSize := (w.texture_size.n != null) ? w.texture_size.n : 4096; - $flatThresh := (w.flatten_bottom_threshold.n != null) ? w.flatten_bottom_threshold.n : 0; - $scale := (w.scale_factor.n != null) ? w.scale_factor.n : 1; - $texFmt := (w.texture_format.s != "" ? w.texture_format.s : "jpeg"); - $part := w.part_names.s; - $fbx := (w.fbx_preset.s != "" ? w.fbx_preset.s : "blender"); - $orient := (w.export_orientation.s != "" ? w.export_orientation.s : "default"); + $face := (widgets.face_limit.n != null) ? widgets.face_limit.n : -1; + $texSize := (widgets.texture_size.n != null) ? widgets.texture_size.n : 4096; + $flatThresh := (widgets.flatten_bottom_threshold.n != null) ? widgets.flatten_bottom_threshold.n : 0; + $scale := (widgets.scale_factor.n != null) ? widgets.scale_factor.n : 1; + $texFmt := (widgets.texture_format.s != "" ? widgets.texture_format.s : "jpeg"); + $part := widgets.part_names.s; + $fbx := (widgets.fbx_preset.s != "" ? widgets.fbx_preset.s : "blender"); + $orient := (widgets.export_orientation.s != "" ? widgets.export_orientation.s : "default"); $advanced := - w.quad.b or - w.force_symmetry.b or - w.flatten_bottom.b or - w.pivot_to_center_bottom.b or - w.with_animation.b or - w.pack_uv.b or - w.bake.b or - w.export_vertex_colors.b or - w.animate_in_place.b or + widgets.quad.b or + widgets.force_symmetry.b or + widgets.flatten_bottom.b or + widgets.pivot_to_center_bottom.b or + widgets.with_animation.b or + widgets.pack_uv.b or + widgets.bake.b or + widgets.export_vertex_colors.b or + widgets.animate_in_place.b or ($face != -1) or ($texSize != 4096) or ($flatThresh != 0) or diff --git a/comfy_api_nodes/nodes_veo2.py b/comfy_api_nodes/nodes_veo2.py index 6a726e6f2..2b4d61b81 100644 --- a/comfy_api_nodes/nodes_veo2.py +++ b/comfy_api_nodes/nodes_veo2.py @@ -124,7 +124,7 @@ class VeoVideoGenerationNode(IO.ComfyNode): is_api_node=True, price_badge=IO.PriceBadge( depends_on=IO.PriceBadgeDepends(widgets=["duration_seconds"]), - expr="""{"type":"usd","usd": 0.5 * w.duration_seconds.n}""", + expr="""{"type":"usd","usd": 0.5 * widgets.duration_seconds.n}""", ), ) @@ -355,8 +355,8 @@ class Veo3VideoGenerationNode(VeoVideoGenerationNode): depends_on=IO.PriceBadgeDepends(widgets=["model", "generate_audio"]), expr=""" ( - $m := w.model.s; - $a := w.generate_audio.b; + $m := widgets.model.s; + $a := widgets.generate_audio.b; ($contains($m,"veo-3.0-fast-generate-001") or $contains($m,"veo-3.1-fast-generate")) ? {"type":"usd","usd": ($a ? 1.2 : 0.8)} : ($contains($m,"veo-3.0-generate-001") or $contains($m,"veo-3.1-generate")) @@ -446,9 +446,9 @@ class Veo3FirstLastFrameNode(IO.ComfyNode): "veo-3.1-fast-generate": { "audio": 0.15, "no_audio": 0.10 }, "veo-3.1-generate": { "audio": 0.40, "no_audio": 0.20 } }; - $m := w.model.s; - $ga := (w.generate_audio.s = "true"); - $seconds := w.duration.n; + $m := widgets.model.s; + $ga := (widgets.generate_audio.s = "true"); + $seconds := widgets.duration.n; $modelKey := $contains($m, "veo-3.1-fast-generate") ? "veo-3.1-fast-generate" : $contains($m, "veo-3.1-generate") ? "veo-3.1-generate" : diff --git a/comfy_api_nodes/nodes_wan.py b/comfy_api_nodes/nodes_wan.py index f47da2ce1..47406818d 100644 --- a/comfy_api_nodes/nodes_wan.py +++ b/comfy_api_nodes/nodes_wan.py @@ -531,9 +531,9 @@ class WanTextToVideoApi(IO.ComfyNode): expr=""" ( $ppsTable := { "480p": 0.05, "720p": 0.1, "1080p": 0.15 }; - $resKey := $substringBefore(w.size.s, ":"); + $resKey := $substringBefore(widgets.size.s, ":"); $pps := $lookup($ppsTable, $resKey); - { "type": "usd", "usd": $round($pps * w.duration.n, 2) } + { "type": "usd", "usd": $round($pps * widgets.duration.n, 2) } ) """, ), @@ -703,8 +703,8 @@ class WanImageToVideoApi(IO.ComfyNode): expr=""" ( $ppsTable := { "480p": 0.05, "720p": 0.1, "1080p": 0.15 }; - $pps := $lookup($ppsTable, w.resolution.s); - { "type": "usd", "usd": $round($pps * w.duration.n, 2) } + $pps := $lookup($ppsTable, widgets.resolution.s); + { "type": "usd", "usd": $round($pps * widgets.duration.n, 2) } ) """, ),