Mie Loop State Set Image ๐
Stashing the current frame for the next ComfyUI loop pass
- loop_ctx
- image
- loop_ctx
This is the write half of the single-image pair in MieNodes' Loop State family, paired with Get Image. The classic use case is chaining generations: take this pass's output, stash it here, and the next lap's Get Image node pulls it right back out as the starting point - an init image, a conditioning frame, whatever your loop is threading forward.
Mechanism. Loop state travels as a custom object, MIE_LOOP_CTX, updated pass by pass as your loop runs. Set Image takes the current context, a key, and an image, stores that image under the key (replacing whatever was there before - this is the single-value sibling to Set Image Batch, which accumulates instead), and returns the updated loop_ctx for the rest of the graph to carry forward.
Default key is feedback_image, matching the family's naming convention: write the result of this pass here, and the matching Get Image node on the next lap reads it back with a found flag telling it whether anything was actually stored (useful for handling the first lap, where there's naturally nothing yet).
What's on the node.
loop_ctx(required) - must come from another Loop-category node in this pack.key(defaultfeedback_image) - has to match what your Get Image node reads; free text, case-sensitive.image(required, IMAGE) - the image to store. Overwrites whatever was previously under this key.
Output: the updated loop_ctx, carrying the stored image forward along with everything else already in the context.
Installing. Manager: search ComfyUI_MieNodes, install. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/MieMieeeee/ComfyUI-MieNodes, then restart ComfyUI. No models, no heavy dependencies.
Same caveat as the rest of this family: the Loop category has zero coverage in the README - no node list, no example workflow to check the intended wiring against. What's here comes from the schema and from how a frame-chaining loop mechanically has to work, which is a reasonable starting point but not confirmed author documentation.
Troubleshooting.
- Next lap's Get Image comes back empty (
found= false) even though you wrote an image. Almost always akeymismatch between this node and the Get Image node reading it - double-check spelling and capitalization on both ends. - The stored image doesn't seem to update - every lap reads the same frame. Make sure this node's output
loop_ctxis actually the one flowing into the next iteration, not a copy of the loop's original starting state. If your loop's continuation wire skips over this node's output, the write never lands anywhere that matters. - You wanted multiple frames accumulated, not just the latest one overwriting the last. Wrong node for that - this one replaces on every write. Use Set Image Batch instead, which accumulates and reports a running
count. loop_ctxtype error. Something other than another Loop node's context output from this same pack is wired into that socket.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ | |
| key | STRING | feedback_image | โ |
| image | IMAGE | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ |