fix(SplitImageToTileList): use tile_height for vertical stride minimum

In `get_grid_coords`, `stride_y` incorrectly uses `tile_width * 0.25`
as its minimum instead of `tile_height * 0.25`. This is a copy-paste
error from the `stride_x` line above.

When tile_width and tile_height differ (non-square tiles), this produces
an incorrect vertical stride. For example, with tile_width=512,
tile_height=256, overlap=128, the minimum stride_y would be clamped to
128 (512*0.25) instead of the correct 64 (256*0.25), potentially
producing gaps or incorrect tile placement in the vertical direction.

This also affects `ImageMergeTileList` which calls the same function to
reconstruct coordinates for merging.
This commit is contained in:
gambletan 2026-03-11 10:19:51 +08:00
parent 3ad36d6be6
commit 5057245264

View File

@ -707,7 +707,7 @@ class SplitImageToTileList(IO.ComfyNode):
def get_grid_coords(width, height, tile_width, tile_height, overlap):
coords = []
stride_x = round(max(tile_width * 0.25, tile_width - overlap))
stride_y = round(max(tile_width * 0.25, tile_height - overlap))
stride_y = round(max(tile_height * 0.25, tile_height - overlap))
y = 0
while y < height: