From 903c718181c08406aec551a18f3c8189c45c79b9 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 2 Oct 2026 21:08:00 +1000 Subject: [PATCH] fix race condition on mask --- image_filter_nodes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/image_filter_nodes.py b/image_filter_nodes.py index 36aaa35..503c429 100644 --- a/image_filter_nodes.py +++ b/image_filter_nodes.py @@ -332,7 +332,11 @@ class MaskImageFilter(FilterNodeBase, io.ComfyNode): (time.monotonic()-started_waiting_at < 5)): time.sleep(1) if (mask_file==last_mask_file): - mask = mask if mask is not None else cls.load_mask(urls[0]['filename']+" [temp]") + try: + mask = mask if mask is not None else cls.load_mask(urls[0]['filename']+" [temp]") + except Exception as e: + print(f"{e} - setting mask to None") + mask = None elif (mask_file is not None): mask = cls.load_mask(mask_file)