ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Resize should be a no-op if scale is 1.0 (input == output size)

Open Arcitec opened this issue 1 year ago • 1 comments

I noticed that the resize node performs operations even when the input is already the target size.

Instead of resampling the image with a scaling algorithm, I propose that if width == width and height == height, just return the input as-is, since there's nothing to do.

This would enable a workflow where an image is imported, passed into a scaler, which does nothing at 1.00. To preserve quality when no scaling is necessary. But which makes it super convenient to change the scale if needed.

Arcitec avatar Dec 13 '23 22:12 Arcitec

Good catch, as even resampling at scale, will effect the image, which would make the resize lossy (from source), even when it shouldn't do anything.

WASasquatch avatar Dec 24 '23 18:12 WASasquatch