flowtyone / ComfyUI-Flowty-LDSR

LDSR custom node for ComfyUI
GNU General Public License v3.0
190 stars 14 forks source link

fix: output images as tensor instead of list #5

Closed TheHexagonCodes closed 8 months ago

TheHexagonCodes commented 8 months ago

Context

Piping the output of the LDSR scaler to another node usually returns the error 'list' object has no attribute 'shape'. This limits what nodes can take an upscaled image as an input.

The Fix

The error is due to the upscaler returning a list of tensor images instead of a higher dimensional tensor as most nodes expect. It's possible to stack the resulting list into such a higher dimentional tensor, solving the issue if the input images can be assumed to have the same dimensions (but I'm not sure if this is a valid assumption!).

Testing

Constructed a pipeline that used to fail due to the error and uses both upscaler nodes, then checked that it now succeeds:

Before After
image image
TheHexagonCodes commented 8 months ago

As an aside thank you so much for this project! I've just been getting into this whole area over the last few days and after discovering LDSR but wondering how I can tweak it, I discovered ComfyUI through your Reddit post. Now I have a pipeline that is giving me better results than I dreamed of. The timing couldn't have been better.

Not sure if this fix is exactly what you're looking for but it points in the right direction if you don't want to accept it as is.

flowtyone commented 8 months ago

Thanks!