comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
48.44k stars 5.09k forks source link

Cannot Connect Integer Primitive to Multiple Input Types. #1480

Open Yo1up opened 11 months ago

Yo1up commented 11 months ago

I am running ComfyUI on an Ubuntu headless server. my client is running Win10 22H2. when I attempt to connect an integer primitive to several inputs on an advanced ksampler, it refuses to connect to both inputs simultaneously. I would like the step count and the end steps to be the same value, but the UI is not letting me connect the node to both simultaneously. The attached image shows what I would like to do, if I release my left mouse button to connect the nodes, it doesn't let me. this also happens with several other types of connections that I would like to make, such as the step count of one ksampler and the starting step of a second ksampler. image

rklaffehn commented 11 months ago

I stumbled on this shortcoming when adding a new custom node lately.

Technically, it's the Primitive node's #isValidConnection that checks if we connect to an input with the same configuration as the previous ones. This stringent check allows you to connect to (e.g.) multiple steps inputs but forbids connecting to other integer inputs. The node must verify the configurations to ensure it generates values within the valid range for all its inputs.

@comfyanonymous: I could look and see if I could make up a more relaxed check that considers configuration content instead of objects.

rklaffehn commented 11 months ago

Digging deeper reveals that the steps input has a minimum value of 1, and the end_at_step has a minimum value of 0 (zero).

So, they disagree on their minimum value (and probably the maximum). Thus, the Primitive node rightfully forbids both connections simultaneously.

Fixing this requires more than a relaxed comparison of configurations.

geoff-m commented 6 months ago

steps input has a minimum value of 1, and the end_at_step has a minimum value of 0 (zero). So, they disagree on their minimum value (and probably the maximum). Thus, the Primitive node rightfully forbids both connections simultaneously.

That doesn't seem like a reason to forbid the connection. Connecting nodes in ComfyUI has never been a guarantee that a node will be happy with the particular values its input takes on at runtime.