Jump latent upscale fallback to spatial split
This commit is contained in:
+12
-10
@@ -521,21 +521,23 @@ def _shrink_model_tile_param(param):
|
||||
|
||||
tile_w = int(next_param.get("tile_width", 0) or 0)
|
||||
tile_h = int(next_param.get("tile_height", 0) or 0)
|
||||
new_w = _halve_32(tile_w)
|
||||
new_h = _halve_32(tile_h)
|
||||
if new_w < 32 or new_h < 32:
|
||||
if tile_w <= 0 or tile_h <= 0:
|
||||
return None
|
||||
if new_w >= tile_w and new_h >= tile_h:
|
||||
return None
|
||||
next_param["tile_width"] = new_w
|
||||
next_param["tile_height"] = new_h
|
||||
next_param["overlap"] = _halve_32(next_param.get("overlap", 0))
|
||||
|
||||
# Jump straight from a coarse specific-size tile to a conservative 2x2
|
||||
# equal-grid split. That usually cuts peak VRAM much harder than halving
|
||||
# the tile size through several retries.
|
||||
next_param["tile_size_mode"] = "rows_cols"
|
||||
next_param["grid_rows"] = 2
|
||||
next_param["grid_cols"] = 2
|
||||
next_param["spatial_w_overlap"] = _halve_32(next_param.get("overlap", 0))
|
||||
next_param["spatial_h_overlap"] = _halve_32(next_param.get("overlap", 0))
|
||||
next_param["fade_width"] = _halve_32(next_param.get("fade_width", 0))
|
||||
next_param["fade_height"] = _halve_32(next_param.get("fade_height", 0))
|
||||
next_param["min_tile_size"] = min(
|
||||
_halve_32(next_param.get("min_tile_size", 0)),
|
||||
new_w,
|
||||
new_h,
|
||||
max(32, _halve_32(tile_w)),
|
||||
max(32, _halve_32(tile_h)),
|
||||
)
|
||||
return next_param
|
||||
|
||||
|
||||
Reference in New Issue
Block a user