Compare commits

..

No commits in common. "a46f3a3afd1201a6c8b52c08eb1b0edf5071d5cd" and "9a939009ae03bc99dd5bf6573aeeb3fcd962dea4" have entirely different histories.

4 changed files with 52 additions and 30 deletions

View File

@ -32,12 +32,11 @@ PRICE_BADGE = IO.PriceBadge(
depends_on=IO.PriceBadgeDepends(widgets=["model", "duration", "resolution"]),
expr="""
(
$prices := {
$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}
};
$modelPrices := $lookup($prices, $lowercase(widgets.model));
$pps := $lookup($modelPrices, widgets.resolution);
}[widgets.model][widgets.resolution];
{"type":"usd","usd": $pps * widgets.duration}
)
""",

View File

@ -350,13 +350,23 @@ class MinimaxHailuoVideoNode(IO.ComfyNode):
depends_on=IO.PriceBadgeDepends(widgets=["resolution", "duration"]),
expr="""
(
$prices := {
"768p": {"6": 0.28, "10": 0.56},
"1080p": {"6": 0.49}
};
$resPrices := $lookup($prices, $lowercase(widgets.resolution));
$price := $lookup($resPrices, $string(widgets.duration));
{"type":"usd","usd": $price ? $price : 0.43}
$r := widgets.resolution;
$d := widgets.duration;
$price :=
$contains($r,"768p")
? (
$contains($d,"6") ? 0.28 :
$contains($d,"10") ? 0.56 :
0.43
)
: $contains($r,"1080p")
? (
$contains($d,"6") ? 0.49 : 0.43
)
: 0.43;
{"type":"usd","usd": $price}
)
""",
),

View File

@ -423,24 +423,37 @@ PRICE_BADGE_VIDEO = IO.PriceBadge(
depends_on=IO.PriceBadgeDepends(widgets=["duration_seconds", "quality", "motion_mode"]),
expr="""
(
$prices := {
"5": {
"1080p": {"normal": 1.2, "fast": 1.2},
"720p": {"normal": 0.6, "fast": 1.2},
"540p": {"normal": 0.45, "fast": 0.9},
"360p": {"normal": 0.45, "fast": 0.9}
},
"8": {
"1080p": {"normal": 1.2, "fast": 1.2},
"720p": {"normal": 1.2, "fast": 1.2},
"540p": {"normal": 0.9, "fast": 1.2},
"360p": {"normal": 0.9, "fast": 1.2}
}
};
$durPrices := $lookup($prices, $string(widgets.duration_seconds));
$qualityPrices := $lookup($durPrices, widgets.quality);
$price := $lookup($qualityPrices, widgets.motion_mode);
{"type":"usd","usd": $price ? $price : 0.9}
$d := widgets.duration_seconds;
$q := widgets.quality;
$m := widgets.motion_mode;
$price :=
$contains($d,"5")
? (
$contains($q,"1080p") ? 1.2 :
($contains($q,"720p") and $contains($m,"fast")) ? 1.2 :
($contains($q,"720p") and $contains($m,"normal")) ? 0.6 :
($contains($q,"540p") and $contains($m,"fast")) ? 0.9 :
($contains($q,"540p") and $contains($m,"normal")) ? 0.45 :
($contains($q,"360p") and $contains($m,"fast")) ? 0.9 :
($contains($q,"360p") and $contains($m,"normal")) ? 0.45 :
0.9
)
: $contains($d,"8")
? (
($contains($q,"540p") and $contains($m,"normal")) ? 0.9 :
($contains($q,"540p") and $contains($m,"fast")) ? 1.2 :
($contains($q,"360p") and $contains($m,"normal")) ? 0.9 :
($contains($q,"360p") and $contains($m,"fast")) ? 1.2 :
($contains($q,"1080p") and $contains($m,"normal")) ? 1.2 :
($contains($q,"1080p") and $contains($m,"fast")) ? 1.2 :
($contains($q,"720p") and $contains($m,"normal")) ? 1.2 :
($contains($q,"720p") and $contains($m,"fast")) ? 1.2 :
0.9
)
: 0.9;
{"type":"usd","usd": $price}
)
""",
)

View File

@ -956,7 +956,7 @@ class RecraftCrispUpscaleNode(IO.ComfyNode):
],
is_api_node=True,
price_badge=IO.PriceBadge(
expr="""{"type":"usd","usd":0.004}""",
expr="""{"type":"usd","usd":0.04}""",
),
)