ssitu / ComfyUI_UltimateSDUpscale

ComfyUI nodes for the Ultimate Stable Diffusion Upscale script by Coyote-A.
GNU General Public License v3.0
859 stars 58 forks source link

Feature enhancement request: Add a "None return" in “class UltimateSDUpscale” #77

Open mirabarukaso opened 6 months ago

mirabarukaso commented 6 months ago

Hi there,

I really like your work, it's brilliant. To improve my experience, I'm currently working on my "74HC1G86 Logic Nodes", which can use a boolean trigger to enable/disable "SD Upscale" instead of wiring nodes.

But unfortunately I found that UltimateSDUpscale could not handle a "None" image as a valid input. I tried to send a 2x2 image into it, but it still took about 8 seconds to process the upscale. After investigating your source code, I found a simple way to solve this.

I'll post it here, hope you could accept it.

In nodes.py. Line 103, add the following codes. It will check if there is a "None" type image came in, then "do nothing" but throw it back. That's all what I need.

if None is image: return (image, )

SN74HC1G86 Single 2-Input Exclusive-OR(XOR) Gate

A B Y
True True None
False False None
True False A
False True B

Thanks a lot