Skip to content

close image file after loading? #3477

Open
@liusida

Description

@liusida

The "Load Image" node opens an image file here:

ComfyUI/nodes.py

Line 1460 in 2de3b69

img = node_helpers.pillow(Image.open, image_path)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is confirmed to not be working properly.FeatureA new feature to add to ComfyUI.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions