From 05683b86393ad45b8e33685d5b1bb8ad78cdd297 Mon Sep 17 00:00:00 2001 From: Vijay2359 Date: Wed, 10 Dec 2025 18:24:42 +0530 Subject: [PATCH] Fix:Apply Icc profile -> sRGB conversion in LoadImage --- nodes.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nodes.py b/nodes.py index 8d28a725d..a23faed26 100644 --- a/nodes.py +++ b/nodes.py @@ -1658,6 +1658,25 @@ class LoadImage: image_path = folder_paths.get_annotated_filepath(image) img = node_helpers.pillow(Image.open, image_path) + import io + from PIL import ImageCms + + try: + if "icc_profile" in img.info: + icc_bytes = img.info["icc_profile"] + + src_profile = ImageCms.ImageCmsProfile(io.BytesIO(icc_bytes)) + dst_profile = ImageCms.createProfile("sRGB") + + img = ImageCms.profileToProfile( + img, + src_profile, + dst_profile, + outputMode="RGB" + ) + except Exception as e: + print("Icc color profile conversion failed:",e) + output_images = [] output_masks = []