From 969463a4e9b9de42b1db75f6d22b591b2dfe150d Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 21 Jun 2026 22:52:45 +0200 Subject: [PATCH] fix: drop deprecated Pillow mode= arg in fit_mask uint8 2D arrays infer "L" automatically; silences Pillow 13 deprecation. Co-Authored-By: Claude Opus 4.8 --- gates/bucket_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gates/bucket_node.py b/gates/bucket_node.py index 9e62962..5d57f21 100644 --- a/gates/bucket_node.py +++ b/gates/bucket_node.py @@ -33,7 +33,7 @@ def fit_mask(mask, W, H): out = [] for i in range(b): arr = (mask[i].cpu().numpy() * 255.0).clip(0, 255).astype("uint8") - pil = _resize_crop_pil(Image.fromarray(arr, mode="L"), new_w, new_h, left, top, W, H) + pil = _resize_crop_pil(Image.fromarray(arr), new_w, new_h, left, top, W, H) out.append(torch.from_numpy(np.array(pil, dtype=np.float32) / 255.0)) return torch.stack(out, 0)