ComfyUI_InstantID
ComfyUI_InstantID copied to clipboard
Bypassing ApplyInstantID Node Can Ruin Conditioning
Issue screenshot:
Using a slightly modified default workflow, we can show that bypassing ApplyInstantID node does not maintain the original behaviour but rather degrades the quality of conditioning.
Expected behaviour: bypassing a node should have zero effect on the original workflow.
InstantID version: 5149a21
this seems to be a bug with comfyui, I'll check better
had the same issue, and updated InstantID, and now all my workflows with InstantID in them don't work. I hope the developer brings back the old node. Also not only this problem with bypassing, but I found if we have multiple IPAdapters, and put the InstantID weight at 0, it is different than disconnecting the model node from InstantID and running it after it, basically manual bypassing it!
can confirm the new update with the old (legacy) node is fixed, but still a problem with the new one!
image png files have workflow included.
~~This can happen if a node mutates something from input in python instead of copying the input first before mutating.~~
While the above is true, the bug mentioned here happens even if you start with the node bypassed, so it's not that. I'm thinking it's because the node has multiple outputs.
However it doesn't seem very straight forward to solve which inputs correspond to which outputs when bypassed apart from getting a hint at with return names.
From my testing, what happens when you disable applyinstantid in this case is that the positive prompt also becomes the negative prompt. (You can test this by copy pasting the positive prompt in the negative prompt)
This is an issue in comfyui's frontend graphToPrompt function that turns the graph into json that the backend can understand.
This was indeed the bug, in this specific case, for each ksampler input it finds the node which it's connected to, in this case the disabled instantid and walks through its inputs.
for model it walks through the inputs and finds the first model type for positive it walks through the inputs and finds the first conditioning type for negative it walks through the inputs and finds the first conditioning type
so given this logic, the negative input of ksampler will always be the positive of instantid because it matches the first type
The proposed solution that follows the same logic would be to track consumed inputs and skip connecting to the same input more than once. This solution sort of assumes the order of input is the same.
Matching by name may be a another option, but not all nodes have matching names either.
for now, we can use a switch node to manually bypass it, until it gets fixed.
From my testing, what happens when you disable applying istantid, in this case, is that the positive prompt also becomes the negative prompt. (You can test this by copy-pasting the positive prompt in the negative prompt)
This is an issue in comfyui's frontend graphToPrompt function that turns the graph into json that the backend can understand.
does this have to do anything with SDXL using 2 clip models CLIP_g & CLIP_l ? I know this might be a noob assumption but isn't it how sdxl merges the 2 prompts? and InstantID works with sdxl and this might be that when bypassing the node, it merges them(both positive and negating) into a single positive.
image from : https://youtu.be/Wk88rK9Zh1Y?t=174