Trung0246 / ComfyUI-0246

Random nodes for ComfyUI
MIT License
108 stars 11 forks source link

[FEATURE REQUEST] Output automatically mirroring the input in Junction node #4

Closed alessandroperilli closed 11 months ago

alessandroperilli commented 11 months ago

The current implementation, which allows the user to specify a subset output of the input, gives a massive amount of flexibility. It's great and I'm sure I'll use it in certain circumstances (for example to change the vertical arrangement of the outputs)

But, in most cases, it would be faster and easier to maintain if the Junction node would simply and automatically create an output for every input it receives. Mirroring the list of inputs.

Not sure if this is something that should be done in a separate node (Junction+ ?), or if it could be enabled or disabled via a menu option.

Trung0246 commented 11 months ago

Hm this sounds almost impossible to implement for Junction due to the bookkeeping of array and dict object behind the scene. I guess a separate node for this makes more sense. Maybe Mirror that can detect if a Highway or Junction being connected then it will mirror accordingly.

I guess the basic implementation is something like this:

4 static pins: _data_in, _data_out, _layout_in, _layout_out.

All will accept junction or highway, but behave differently. Data pins will act like expected for transfer the data, while layout pin when connected with junction or highway node it will mirror the layout of the connected node. Maybe I could extend this by allowing multiple layout pins and therefore multiple different nodes and not just layout or junction are accepted.

alessandroperilli commented 11 months ago

It's possible I didn't explain myself properly. I'll try again.

What I am asking is that the Junction node behaves as follows:

Moment 0 - No inputs is connected and Junction only has a _junc_in and _junc_out pins + the ... pin. Moment 1 - The user connects the first input. Let's say an image input. Moment 2 - Junction automatically shifts the ... pin down (that's already happening) and creates an image output pin, just below the _junc_out pin, without the user having to specify anything. Moment 3 - The user connects a second input. Let's say it's a latent input. Moment 4 - Junction automatically shifts the ... pin down (that's already happening) and creates a latent output pin, just below the image output pin, without the user having to specify anything. Moment 5 - etc.

This is what I meant by "mirroring". I simply would hope to avoid the manual definition of the outputs within the same node.

Trung0246 commented 11 months ago

Hm I see. Yeah this will be a separate node.

Trung0246 commented 11 months ago

Closing since [EPIC] has been created.