fix(api-nodes): made Reve node price badges more precise (#13154)

Signed-off-by: bigcat88 <bigcat88@icloud.com>
pull/8380/head^2
Alexander Piskun 2026-03-25 20:05:49 +02:00 committed by GitHub
parent b53b10ea61
commit a55835f10c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 36 additions and 7 deletions

View File

@ -145,7 +145,20 @@ class ReveImageCreateNode(IO.ComfyNode):
], ],
is_api_node=True, is_api_node=True,
price_badge=IO.PriceBadge( price_badge=IO.PriceBadge(
expr="""{"type":"usd","usd":0.03432,"format":{"approximate":true,"note":"(base)"}}""", depends_on=IO.PriceBadgeDepends(
widgets=["upscale", "upscale.upscale_factor"],
),
expr="""
(
$factor := $lookup(widgets, "upscale.upscale_factor");
$fmt := {"approximate": true, "note": "(base)"};
widgets.upscale = "enabled" ? (
$factor = 4 ? {"type": "usd", "usd": 0.0762, "format": $fmt}
: $factor = 3 ? {"type": "usd", "usd": 0.0591, "format": $fmt}
: {"type": "usd", "usd": 0.0457, "format": $fmt}
) : {"type": "usd", "usd": 0.03432, "format": $fmt}
)
""",
), ),
) )
@ -225,13 +238,21 @@ class ReveImageEditNode(IO.ComfyNode):
is_api_node=True, is_api_node=True,
price_badge=IO.PriceBadge( price_badge=IO.PriceBadge(
depends_on=IO.PriceBadgeDepends( depends_on=IO.PriceBadgeDepends(
widgets=["model"], widgets=["model", "upscale", "upscale.upscale_factor"],
), ),
expr=""" expr="""
( (
$fmt := {"approximate": true, "note": "(base)"};
$isFast := $contains(widgets.model, "fast"); $isFast := $contains(widgets.model, "fast");
$base := $isFast ? 0.01001 : 0.0572; $enabled := widgets.upscale = "enabled";
{"type": "usd", "usd": $base, "format": {"approximate": true, "note": "(base)"}} $factor := $lookup(widgets, "upscale.upscale_factor");
$isFast
? {"type": "usd", "usd": 0.01001, "format": $fmt}
: $enabled ? (
$factor = 4 ? {"type": "usd", "usd": 0.0991, "format": $fmt}
: $factor = 3 ? {"type": "usd", "usd": 0.0819, "format": $fmt}
: {"type": "usd", "usd": 0.0686, "format": $fmt}
) : {"type": "usd", "usd": 0.0572, "format": $fmt}
) )
""", """,
), ),
@ -327,13 +348,21 @@ class ReveImageRemixNode(IO.ComfyNode):
is_api_node=True, is_api_node=True,
price_badge=IO.PriceBadge( price_badge=IO.PriceBadge(
depends_on=IO.PriceBadgeDepends( depends_on=IO.PriceBadgeDepends(
widgets=["model"], widgets=["model", "upscale", "upscale.upscale_factor"],
), ),
expr=""" expr="""
( (
$fmt := {"approximate": true, "note": "(base)"};
$isFast := $contains(widgets.model, "fast"); $isFast := $contains(widgets.model, "fast");
$base := $isFast ? 0.01001 : 0.0572; $enabled := widgets.upscale = "enabled";
{"type": "usd", "usd": $base, "format": {"approximate": true, "note": "(base)"}} $factor := $lookup(widgets, "upscale.upscale_factor");
$isFast
? {"type": "usd", "usd": 0.01001, "format": $fmt}
: $enabled ? (
$factor = 4 ? {"type": "usd", "usd": 0.0991, "format": $fmt}
: $factor = 3 ? {"type": "usd", "usd": 0.0819, "format": $fmt}
: {"type": "usd", "usd": 0.0686, "format": $fmt}
) : {"type": "usd", "usd": 0.0572, "format": $fmt}
) )
""", """,
), ),