trying throw error

This commit is contained in:
VILLARD Florian
2025-01-16 12:11:33 +01:00
parent 37b29fd236
commit 993dbe4e62
2 changed files with 20 additions and 9 deletions
+19 -8
View File
@@ -222,14 +222,23 @@ def split_image_to_grid(input_image, grid_size=(5, 5)):
return grid_images
def upload_image_to_s3(index, image, bucket_name, object_name, s3_client):
# Convert image to a bytes buffer
buffer = BytesIO()
image.save(buffer, format="PNG")
buffer.seek(0)
try:
# Convert image to a bytes buffer
buffer = BytesIO()
image.save(buffer, format="PNG")
buffer.seek(0)
# Upload the image to S3
s3_client.upload_fileobj(buffer, bucket_name, object_name)
return index, True
# Upload the image to S3
s3_client.upload_fileobj(buffer, bucket_name, object_name)
return index, True
except ClientError as e:
# Log the error and raise it for further handling
print(f"Error uploading image {index} to S3: {e}")
return index, False
except Exception as e:
# Handle any other unexpected exceptions
print(f"Unexpected error for image {index}: {e}")
return index, False
class SaveGridToS3:
@@ -285,9 +294,11 @@ class SaveGridToS3:
index, success = future.result()
bools[index] = success
except Exception as e:
print(f"Error posting : {e}")
raise RuntimeError("Error posting : {e}")
if any(img is None for img in bools):
raise RuntimeError("Some images failed to upload.")
if any(img is False for img in bools):
raise RuntimeError("Some images failed to upload.")
except Exception as e:
raise ValueError(f"Invalid input: {e}")
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "ColorMatrixGPU",
"description": "A ComfyUI node to apply a 4x4 color matrix to an image using GPU acceleration.",
"author": "Argo",
"version": "1.1.2",
"version": "1.2.0",
"repository": "https://github.com/bear2b/comfyui-argo-nodes",
"dependencies": [
"torch>=1.13.0",