From 7e45c81589d84fd143564dbe5824ca06d762c0f0 Mon Sep 17 00:00:00 2001 From: Chris Dumas Date: Fri, 4 Sep 2026 08:48:20 +0000 Subject: [PATCH] Reset overlap in H3 spatial retries --- dumas_h3_latent_upscale.py | 10 +++++----- tests/test_dumas_h3_longvideos.py | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/dumas_h3_latent_upscale.py b/dumas_h3_latent_upscale.py index 62ce047..89f1b04 100644 --- a/dumas_h3_latent_upscale.py +++ b/dumas_h3_latent_upscale.py @@ -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) diff --git a/tests/test_dumas_h3_longvideos.py b/tests/test_dumas_h3_longvideos.py index 6ac5541..8e429ed 100644 --- a/tests/test_dumas_h3_longvideos.py +++ b/tests/test_dumas_h3_longvideos.py @@ -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)