close image file after loading?
Open
Bug
Feature
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
The "Load Image" node opens an image file here:
https://github.com/comfyanonymous/ComfyUI/blob/2de3b69b3074028fd0f850f801f4ca023489c692/nodes.py#L1460
and I think we should close it using `img.close()` before leaving the function.
This will release the handle of the file and allow other processes to access the image file. It's not critical but it feels better to do it, right?
P.S. I noticed this while trying to delete the image file in a later node. But this is not related to the issue since I have created special ImageLoader as well.
Contributor guide
Assessment
This issue has not been assessed yet.