Loop the output of one generation into the next generation.
To use create a start node, an end node, and a loop node. The loop node should connect to exactly one start and one end node of the same type. The first_loop input is only used on the first run. Whatever was sent to the end node will be what the start node emits on the next run.
More loop types can be added by modifying loopback.py
Description
FAQ
Comments (25)
Works great! But how do you restart the loop?
The only way I found out is to restart comfyUi :(
I was unable to successfully cycle. Can you share your workspace :)
@86646112498 Just have a look at the example picture. I just built it that way
it works by reloading the loop node, or remove/add it
@Jay00 wow that sucks...
@mrlunk846 @Jay00 @Jay00 @Jay00 @Jay00 @Jay00 @Jay00 thanks! this works
Is the source hosted on GitHub?
I haven't hosted it anywhere but here
Looks neat! Unfortunately I'm getting an "max() arg is an empty sequence" error when attempting to use the IMAGE loop nodes
Update: I did get this working, but I had to edit the code. I renamed the .py file to __init__.py and placed it in custom_nodes\loopback\__init__.py, and then edited INPUT_TYPES to:
Seems like ComfyUI wanted there to be at least one input for some reason? There's likely a better fix.
there are 3 "INPUT_TYPES(s)" , which one?
Error occurred when executing Loop: Loop.run()
got an unexpected keyword argument 'text'
@kuma660224 @Chumpy You ever figure this out? I'd like loopback functionality for animation in comfyui but I'm getting the same error you two got and haven't been able to figure out chumpys fix. Loop node gives an error.
Whoops, sorry I missed this! Here's a pastebin of the whole file https://pastebin.com/DG9R5PDh
I haven't had a chance to try this recently but it did work for me at the time.
@Chumpy Thank you!
<3
I's funny, but I don't know why we need this node?
Can anyone provide some examples , to show the benefits of this?
hires fix is "just" a second pass, this can be useful...
apply img2img with a realy small denoise several times: the small denoise make the alteration quasi not perceptible, and the output do not diverge from input, but applying that 10 or more times finnaly transforms the image but keeping really close the initial composition (not like a high denoise that can make the image completely different).
There is a custom script in automatic1111 to do this...
Try out taking a raw drawing and apply the LoRA <add_details> with no prompt and a denoise: 0.1 like 10 or more times you'll see ;)
how I can install this node?
I placed that in custom nodes but it was not loaded.
would you please help me?
Download the zip file, extract the loopback.py file and copy it to the "custom_nodes" directory, which is available in the root of the ComfyUI installation
@dumx
It needs an __init__.py file. It's super easy to make just create one in the folder and type
from .loopback import *
Once you have that ComfyUI should allow it to load. Hope this helps!
THis could be a VERY popular CustomNode...
Unfortunately it fails on install.
It failed for me, too until I added an __init__.py file with the following line in it:
from .loopback import *
Once I added that, it worked.
Thanks for the useful nodes!
Trying to use those nodes as Image Loopback for some TemporalNet workflow, and while the nodes install flawlessly and seem super easy to use, there is no effect, the image output by the LoopStart_Image is always the current image, never the previous one...
Are those loop content supposed to be cached somewhere on the disk? Could there be some permission issue I don't see?
Tried the various fixes commented here and from https://github.com/Extraltodeus/CustomComfyUINodes, however with the same result...
Upd:
Debugging1: When looping on itself, the loopback returns itself (staying stuck) which means the image data is there and called properly.
Debugging2: The first_loop image is never output, even on first pass (after deleting/creating loop node), which either means the loop.next stays in memory somewhere, or that the loopEnd is somehow process before the loopStart and overwrite loop.next with current image before it can output the previous one. Checked the node order in the json file, it looks correct, with loopEnd being processed after loopStart, but I'm not 100% sure, not knowing the internal works of Comfy...
Suggesting a 'flush cache' button on loop node to clear loop.next on demand...
Until the node can be reset it is too much work to close comfyui or delete and resetup the node. Loop functionality can be achieved through saving and loading files, it's just probably slower and more annoying to set up. This node is so important for animation I don't understand how there isn't a proper implementation for comfyui.
Thanks for the nodes, but they aren't very usable without an update.
It would be so helpful to have some sort of explanation on how this is supposed to work.
It seems like this just doesn't loop? Where are the conditions for exiting the loop? Where is the actual loop? For the models loop it seems to want the ksampler to output model information which obviously doesn't happen. How is this supposed to work?
