proper calculate the total run cost when "n > 1"

Signed-off-by: bigcat88 <bigcat88@icloud.com>
This commit is contained in:
bigcat88 2026-04-22 20:48:46 +03:00
parent c69cca870a
commit e530824767
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721

View File

@ -477,14 +477,15 @@ class OpenAIGPTImage1(IO.ComfyNode):
} }
}; };
$range := $lookup($lookup($ranges, widgets.model), widgets.quality); $range := $lookup($lookup($ranges, widgets.model), widgets.quality);
$n := widgets.n; $nRaw := widgets.n;
$n := ($nRaw != null and $nRaw != 0) ? $nRaw : 1;
($n = 1) ($n = 1)
? {"type":"range_usd","min_usd": $range[0], "max_usd": $range[1], "format": {"approximate": true}} ? {"type":"range_usd","min_usd": $range[0], "max_usd": $range[1], "format": {"approximate": true}}
: { : {
"type":"range_usd", "type":"range_usd",
"min_usd": $range[0], "min_usd": $range[0] * $n,
"max_usd": $range[1], "max_usd": $range[1] * $n,
"format": { "suffix": " x " & $string($n) & "/Run", "approximate": true } "format": { "suffix": "/Run", "approximate": true }
} }
) )
""", """,