Skip to content

Squeeze input for SaveImage #152

@WASasquatch

Description

@WASasquatch

I have a issue where if PIL RGB images are converted to numpy, and then tensor, that SaveImage cannot handle them. The reason is because it's not squeezing the input so it gets an extra shape, it seems.

https://github.com/comfyanonymous/ComfyUI/blob/master/nodes.py#L760

A fix, which still works for all other instances of Save Image that I've been using it for is

            i = 255. * image.cpu().numpy().squeeze()

Additionally, as a suggestion, it probably would be prudent to make "IMAGE" nodes actually be "TENSOR" nodes, and then have a Tensor to Numpy and Numpy to Tensor node where you then do any image operations on, to cut out all the back and forth conversion constantly. Maybe different colors to differentiate Tensor based nodes and Image based nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions