From c180ecfec1859a60bb81cf03ae4de5c223a1ff90 Mon Sep 17 00:00:00 2001 From: xmarre Date: Tue, 12 May 2026 20:52:47 +0200 Subject: [PATCH] Guard Flux img_slice metadata checks --- tide_core/patches.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tide_core/patches.py b/tide_core/patches.py index d02bcf9..b9c5f86 100644 --- a/tide_core/patches.py +++ b/tide_core/patches.py @@ -93,7 +93,12 @@ class TIDEAttentionPatch: beta = adaptive_text_bias(self.config) if beta != 0.0: img_slice = extra_options.get("img_slice") - if img_slice and len(img_slice) == 2: + try: + has_img_slice = img_slice is not None and len(img_slice) == 2 + except TypeError: + has_img_slice = False + + if has_img_slice: try: text_tokens = int(img_slice[0]) total_tokens = int(k.shape[2])