+ change upscale-output value
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
- This `CHANGELOG.md` file.
|
||||
- Prim-node rename (class and internal name, too): `Upscale Strategy (Best-Res)` -> `Crop-Pad Strategy (Best-Res)`
|
||||
- Inputs/outputs for upscale-related nodes are renamed to be more intuitive.
|
||||
- `Best-Res (area+scale)`: change (restore) the value returned by `upscale` output.
|
||||
|
||||
# V1.1.0
|
||||
|
||||
|
||||
@@ -228,7 +228,9 @@ def upscale_result_from_approx_wh(
|
||||
float(hd_width) / upscale, float(hd_height) / upscale, step
|
||||
)
|
||||
|
||||
result = ResultUpscaled(upscale, width, height, hd_width, hd_height)
|
||||
needs_resize, real_upscale_avg, real_upscale_x, real_upscale_y = _need_post_resize(width, height, hd_width, hd_height)
|
||||
|
||||
result = ResultUpscaled(upscale if needs_resize else real_upscale_avg, width, height, hd_width, hd_height)
|
||||
|
||||
if not unique_id:
|
||||
return result
|
||||
@@ -247,14 +249,12 @@ 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, hd_width, hd_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_avg:.3f} ---\n"
|
||||
else f"\n--- x{real_upscale_avg:.3f}✅ ---\n"
|
||||
)
|
||||
text = separator_line.join(report_parts)
|
||||
|
||||
|
||||
+10
-1
@@ -32,7 +32,16 @@ from .slot_types import (
|
||||
|
||||
_return_types_upscale = (_IO.FLOAT, _IO.INT, _IO.INT, _IO.INT, _IO.INT)
|
||||
_return_ttips_upscale = _frozendict({
|
||||
'upscale': "Simply outputs the same upscale-value you've set on the node.",
|
||||
'upscale': (
|
||||
"If the HD resolution can be achieved by uniformly scaling the initial one "
|
||||
"(there is \"✅\" and not \"⚠️\" in the upscale-line of the status message), "
|
||||
"outputs this precise upscale-value (might be different from the one originally set on the node itself).\n\n"
|
||||
"Otherwise, outputs the original upscale-value intact.\n"
|
||||
"In this case, you shouldn't use it directly and instead should pass it "
|
||||
"to the \"Upscaled Crop/Pad (Best-Res)\" node and use the upscale-output from it.\n\n"
|
||||
"In both cases, it won't hurt to use the \"Upscaled Crop/Pad (Best-Res)\" node and just rely "
|
||||
"on it's `do_crop` and `do_padding` toggle-outputs."
|
||||
),
|
||||
'init_width': "Width for original/initial image",
|
||||
'init_height': "Height for original/initial image",
|
||||
'HD_width': "Width for the (main/upscaled) HD-image",
|
||||
|
||||
Reference in New Issue
Block a user