Reset overlap in H3 spatial retries

This commit is contained in:
2026-09-04 08:48:20 +00:00
parent 027865b9ca
commit 7e45c81589
2 changed files with 26 additions and 5 deletions
+5 -5
View File
@@ -512,11 +512,11 @@ def _shrink_model_tile_param(param):
return None
next_param["grid_rows"] = rows
next_param["grid_cols"] = cols
next_param["spatial_w_overlap"] = _halve_32(next_param.get("spatial_w_overlap", 0))
next_param["spatial_h_overlap"] = _halve_32(next_param.get("spatial_h_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"] = _halve_32(next_param.get("min_tile_size", 0))
next_param["spatial_w_overlap"] = 0
next_param["spatial_h_overlap"] = 0
next_param["fade_width"] = 0
next_param["fade_height"] = 0
next_param["min_tile_size"] = 32
return next_param
tile_w = int(next_param.get("tile_width", 0) or 0)
+21
View File
@@ -1181,6 +1181,27 @@ class DumasH3LongVideosHelperTests(unittest.TestCase):
self.assertEqual(smaller["fade_height"], 0)
self.assertEqual(smaller["min_tile_size"], 32)
def test_shrink_model_tile_param_rows_cols_resets_overlap(self):
latent = importlib.import_module("dumas_h3_latent_upscale")
smaller = latent._shrink_model_tile_param({
"tile_size_mode": "rows_cols",
"grid_rows": 4,
"grid_cols": 4,
"spatial_w_overlap": 128,
"spatial_h_overlap": 128,
"fade_width": 64,
"fade_height": 64,
"min_tile_size": 256,
})
self.assertIsNotNone(smaller)
self.assertEqual(smaller["grid_rows"], 8)
self.assertEqual(smaller["grid_cols"], 8)
self.assertEqual(smaller["spatial_w_overlap"], 0)
self.assertEqual(smaller["spatial_h_overlap"], 0)
self.assertEqual(smaller["fade_width"], 0)
self.assertEqual(smaller["fade_height"], 0)
self.assertEqual(smaller["min_tile_size"], 32)
def test_temporal_segments_split_long_sequences(self):
latent = importlib.import_module("dumas_h3_latent_upscale")
bounds = latent._temporal_segments(36, 85, 17)