CivArchive
    ComfyUI - Loopback nodes - v0.1
    Preview 365641

    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)

    moonmoonApr 3, 2023· 1 reaction
    CivitAI

    Works great! But how do you restart the loop?
    The only way I found out is to restart comfyUi :(

    86646112498Apr 4, 2023

    I was unable to successfully cycle. Can you share your workspace :)

    moonmoonApr 15, 2023

    @86646112498 Just have a look at the example picture. I just built it that way

    Jay00Aug 17, 2023· 1 reaction

    it works by reloading the loop node, or remove/add it

    NeuraLunkAug 20, 2023

    @Jay00 wow that sucks...

    badddoDec 3, 2023

    @mrlunk846 @Jay00 @Jay00 @Jay00 @Jay00 @Jay00 @Jay00 thanks! this works

    drjklApr 25, 2023
    CivitAI

    Is the source hosted on GitHub?

    m99
    Author
    Apr 27, 2023

    I haven't hosted it anywhere but here

    ChumpyJun 17, 2023· 2 reactions
    CivitAI

    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:

    @classmethod def INPUT_TYPES(s): return {"required": {"text": ("STRING", {"multiline": False})}}

    Seems like ComfyUI wanted there to be at least one input for some reason? There's likely a better fix.

    kuma660224Jul 25, 2023· 2 reactions

    there are 3 "INPUT_TYPES(s)" , which one?

    Error occurred when executing Loop: Loop.run()
    got an unexpected keyword argument 'text'

    CFSStudiosAug 12, 2023· 1 reaction

    @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.

    ChumpyAug 13, 2023· 3 reactions

    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.

    Inner_Reflections_AISep 3, 2023· 1 reaction

    @Chumpy Thank you!

    AnimediffFeb 23, 2024

    <3

    kuma660224Jun 21, 2023· 1 reaction
    CivitAI

    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...

    digregartJun 2, 2024

    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 ;)

    amir84ferdos483Jun 27, 2023
    CivitAI

    how I can install this node?

    I placed that in custom nodes but it was not loaded.

    would you please help me?

    dumxJul 30, 2023· 2 reactions

    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

    traugdor90Oct 30, 2024

    @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!

    NeuraLunkAug 19, 2023· 2 reactions
    CivitAI

    THis could be a VERY popular CustomNode...
    Unfortunately it fails on install.

    traugdor90Oct 30, 2024

    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.

    JuvanoSep 14, 2023
    CivitAI

    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...

    CFSStudiosSep 19, 2023
    CivitAI

    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.

    IsActuallyAPengu7065Dec 2, 2023· 5 reactions
    CivitAI

    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?

    Other
    Other
    by m99

    Details

    Downloads
    1,545
    Platform
    CivitAI
    Platform Status
    Available
    Created
    3/30/2023
    Updated
    5/11/2026
    Deleted
    -

    Available On (1 platform)

    Same model published on other platforms. May have additional downloads or version variants.