You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does the smae node in a loop get different ids? in the first time it get a normal id: '123', while the second time get a different id: '456.0.0.3.0.0.123'?
Since most custom_nodes will use the id as a unique key to save data, if the id cannot be kept consistent, it may cause bugs. As we can see there are a lot of issues all caused by this reason.
Demo
Here is a demo using image chooser in a for loop. This loop will run twice. In the first time the image chooser works fine, while in the second time, the image chooser cannot get the new generated image, and click the button, nothing happed, it just stucked there.
Drag the image into comfyui to test.
The text was updated successfully, but these errors were encountered:
QtumOne
changed the title
Why done the same node in a loop get different id?
Why does the same node in a loop get different id?
Dec 12, 2024
QtumOne
changed the title
Why does the same node in a loop get different id?
Why does the same node in a loop get different ids?
Dec 12, 2024
In short, this is derived from the subgraph logic in the comfy core, which gives nodes different IDs in each loop thus enabling looping.
So, it becomes cumbersome to solve the problem of inconsistent IDs, including an artful way to implement the output of leaf nodes in loops previously.
Problem
Why does the smae node in a loop get different ids? in the first time it get a normal id: '123', while the second time get a different id: '456.0.0.3.0.0.123'?
Since most custom_nodes will use the id as a unique key to save data, if the id cannot be kept consistent, it may cause bugs. As we can see there are a lot of issues all caused by this reason.
Demo
Here is a demo using image chooser in a for loop. This loop will run twice. In the first time the image chooser works fine, while in the second time, the image chooser cannot get the new generated image, and click the button, nothing happed, it just stucked there.
Drag the image into comfyui to test.
The text was updated successfully, but these errors were encountered: