HDR Images Error: Image file is truncated
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
Error message below when doing image to image:
Reproduce:
1. Use attached image in "Load Image" node. Sample workflow attached.

2. Run
3. Error shows
Error occurred when executing LoadImage:
image file is truncated (0 bytes not processed)
File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 155, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 85, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 78, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\ComfyUI\nodes.py", line 1473, in load_image
i = ImageOps.exif_transpose(i)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\PIL\ImageOps.py", line 602, in exif_transpose
transposed_image = image.transpose(method)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\PIL\Image.py", line 2810, in transpose
self.load()
File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\PIL\ImageFile.py", line 266, in load
raise OSError(msg)
[sdxlimage2imageworkflow.json](https://github.com/comfyanonymous/ComfyUI/files/14108276/sdxlimage2imageworkflow.json)
Contributor guide
Research direction
Start at nodes.py line 1473 in load_image and follow the failing call to PIL ImageOps.exif_transpose shown in the traceback. Reproduce with the attached IMG_0666 image and sdxlimage2imageworkflow.json. Done means the Load Image node processes this HDR image without the image-file-truncated error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100