mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-03-16 11:47:04 +08:00
Merge 184fc6adcb128fc641184e756ab8828102fc0961 into 650e716dda0a966a083f0efe299f3e83336f920e
This commit is contained in:
commit
c8a7ec7118
19
nodes.py
19
nodes.py
@ -1658,6 +1658,25 @@ class LoadImage:
|
|||||||
image_path = folder_paths.get_annotated_filepath(image)
|
image_path = folder_paths.get_annotated_filepath(image)
|
||||||
|
|
||||||
img = node_helpers.pillow(Image.open, image_path)
|
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_images = []
|
||||||
output_masks = []
|
output_masks = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user