+ output raw upscale value in the upscale node

This commit is contained in:
Lex Darlog (DRL)
2025-07-19 09:56:41 +05:00
parent ec509ddc75
commit 23c8a7440c
3 changed files with 6 additions and 18 deletions
+4 -5
View File
@@ -228,10 +228,7 @@ def upscale_result_from_approx_wh(
float(up_width) / upscale, float(up_height) / upscale, step
)
needs_resize, real_upscale_avg, real_upscale_x, real_upscale_y = _need_post_resize(width, height, up_width, up_height)
out_upscale: float = upscale if needs_resize else real_upscale_avg
result = ResultUpscaled(out_upscale, width, height, up_width, up_height, needs_resize)
result = ResultUpscaled(upscale, width, height, up_width, up_height)
if not unique_id:
return result
@@ -250,12 +247,14 @@ def upscale_result_from_approx_wh(
f"{prefix}{x}" for x in cur_report.split('\n')
))
needs_resize, real_upscale_avg, real_upscale_x, real_upscale_y = _need_post_resize(width, height, up_width, up_height)
separator_line: str = (
# Real upscale factor in X and Y differ enough so we can't get the up-res from init-res with ANY uniform value:
f"\n--- ⚠️ x{real_upscale_x:.3f} / x{real_upscale_y:.3f} ---\n"
if needs_resize
# The upscale is uniform:
else f"\n--- x{real_upscale_x:.3f} ---\n"
else f"\n--- x{real_upscale_avg:.3f} ---\n"
)
text = separator_line.join(report_parts)
+2 -12
View File
@@ -30,23 +30,13 @@ from .slot_types import (
# ----------------------------------------------------------
_return_types_upscale = (_IO.FLOAT, _IO.INT, _IO.INT, _IO.INT, _IO.INT, _IO.BOOLEAN)
_return_types_upscale = (_IO.FLOAT, _IO.INT, _IO.INT, _IO.INT, _IO.INT)
_return_ttips_upscale = _frozendict({
'upscale': (
"If 'needs_resize' is FALSE, this would be the actual uniform value to scale your initial-res in order "
"to get the upscaled-res.\n"
"If 'needs_resize' is TRUE, this slot simply outputs the same upscale-value you've set on the node."
),
'upscale': "Simply outputs the same upscale-value you've set on the node.",
'orig_w': "Width for original/initial image",
'orig_h': "Height for original/initial image",
'up_w': "Width for the (main) upscaled image",
'up_h': "Height for the (main) upscaled image",
'needs_resize': (
"This will be FALSE if you can get the exact upscaled resolution by simply scaling the initial-res uniformly "
"(by the value output into 'upscale' slot).\n\n"
"Otherwise, it will be TRUE — indicating that you'll need to do some cropping/out-painting right AFTER "
"the actual upscale (increasing the resolution itself) but BEFORE post-upscale sampling (\"HD-fix\")."
),
})
__extra_inputs_for_upscale_only = {
-1
View File
@@ -19,7 +19,6 @@ class ResultUpscaled(_t.NamedTuple):
orig_height: int
up_width: int
up_height: int
needs_resize: bool
class ResultUpscaledCropPad(_t.NamedTuple):