Skip to content

Commit 2528a76

Browse files
author
doctorpangloss
committed
Fix pylint issues
1 parent 51bb02e commit 2528a76

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

comfy_extras/nodes/nodes_open_api.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ def execute(self,
637637
image_as_numpy_array: np.ndarray = image.float().cpu().numpy()
638638

639639
cv_save_options = []
640+
image_as_pil: PIL.Image = None
641+
additional_args = {}
640642
if bits == 8:
641643
image_scaled = np.ascontiguousarray(np.clip(image_as_numpy_array * 255, 0, 255).astype(np.uint8))
642644

@@ -672,7 +674,7 @@ def execute(self,
672674
mut_srgb_to_linear(image_as_numpy_array[:, :, :3])
673675
image_scaled = image_as_numpy_array.astype(np.float32)
674676
if bits == 16:
675-
cv_save_options = [cv2.IMWRITE_EXR_TYPE, cv2.IMWRITE_EXR_TYPE_HALF]
677+
cv_save_options = [cv2.IMWRITE_EXR_TYPE, cv2.IMWRITE_EXR_TYPE_HALF] # pylint: disable=no-member
676678
else:
677679
image_scaled = np.clip(image_as_numpy_array * 65535, 0, 65535).astype(np.uint16)
678680

@@ -724,7 +726,7 @@ def execute(self,
724726
with fsspec.open(uri, mode="wb", **fsspec_kwargs) as f:
725727
image_as_pil.save(f, format=save_format, **additional_args)
726728
else:
727-
_, img_encode = cv2.imencode(f'.{save_format}', image_scaled, cv_save_options)
729+
_, img_encode = cv2.imencode(f'.{save_format}', image_scaled, cv_save_options) # pylint: disable=no-member
728730

729731
with fsspec.open(uri, mode="wb", **fsspec_kwargs) as f:
730732
f.write(img_encode.tobytes())
@@ -753,7 +755,7 @@ def execute(self,
753755
if save_method == 'pil':
754756
image_as_pil.save(local_path, format=save_format, **additional_args)
755757
else:
756-
cv2.imwrite(local_path, image_scaled)
758+
cv2.imwrite(local_path, image_scaled) # pylint: disable=no-member
757759

758760
img_item: SaveNodeResultWithName = {
759761
"abs_path": str(abs_path),

0 commit comments

Comments
 (0)