fix for Batch Upload (gallery)

now needs to check for None
This commit is contained in:
DenOfEquity
2024-08-31 21:52:10 +01:00
committed by GitHub
parent a8a81d3d77
commit 2c907b24c9

View File

@@ -161,7 +161,7 @@ class ControlNetForForgeOfficial(scripts.Script):
logger.info(f'Try to read image: {img_path}')
img = np.ascontiguousarray(cv2.imread(img_path)[:, :, ::-1]).copy()
mask = None
if len(unit.batch_mask_gallery) > 0:
if unit.batch_mask_gallery is not None and len(unit.batch_mask_gallery) > 0:
if len(unit.batch_mask_gallery) >= len(unit.batch_input_gallery):
mask_path = unit.batch_mask_gallery[idx]['name']
else: