Fix: image.shape accessed before image is null-checked (#134)

This commit is contained in:
Christian Byrne 2025-05-05 02:18:24 -07:00 committed by GitHub
parent c0a348d778
commit 0b0eead4ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -427,10 +427,10 @@ class OpenAIGPTImage1(ComfyNodeABC):
files.append(("image[]", img_binary))
if mask is not None:
if image.shape[0] != 1:
raise Exception("Cannot use a mask with multiple image")
if image is None:
raise Exception("Cannot use a mask without an input image")
if image.shape[0] != 1:
raise Exception("Cannot use a mask with multiple image")
if mask.shape[1:] != image.shape[1:-1]:
raise Exception("Mask and Image must be the same size")
batch, height, width = mask.shape