Mie Loop State Set Bool ๐
Writing a flag into a ComfyUI loop's memory
- loop_ctx
- loop_ctx
This is the write half of the boolean pair in MieNodes' Loop State family - the counterpart to Get Bool. If your ComfyUI for-loop needs to remember a yes/no decision from this pass into the next one (or into whatever reads the loop's final state after it exits), Set Bool is how that value actually gets stored, because nothing in a loop's subgraph survives between laps on its own.
How it works. Loop state here is a custom object type, MIE_LOOP_CTX, that flows through your loop and gets updated pass by pass. Set Bool takes the current context, a key, and a value, writes that boolean into the context under that key, and hands back an updated loop_ctx for you to pass onward - either into the next thing inside this same iteration, or out to whatever closes the loop and starts the next lap.
The default key, feedback_bool, matches the pattern across the whole family: this is built for a feedback or self-critique loop. Run a check on this pass's output - did it pass a threshold, did an LLM judge approve it - and write the verdict here so the next pass (or the code that decides whether to keep looping) can read it back with the matching Get Bool node.
Inputs and output.
loop_ctx(required) - the context coming into this point in the loop; has to originate from another Loop-category node in this pack.key(defaultfeedback_bool) - the label the value gets stored under. Has to match exactly what the corresponding Get Bool node reads, since this is free text.value(defaultfalse) - the boolean you're writing. Usually the output of a comparison, a threshold check, or an LLM's yes/no verdict.
The single output is the updated loop_ctx - this node doesn't hand you the boolean back, it hands you the whole state object with your boolean now folded into it, ready to keep flowing through the graph.
Installing. ComfyUI Manager: search ComfyUI_MieNodes and install. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/MieMieeeee/ComfyUI-MieNodes, restart ComfyUI. No models or heavy dependencies for this one.
A note on documentation: the Loop category is entirely absent from the pack's README - no node table, no example workflow, nothing to check this against. Everything above comes from the node's schema and from how a loop-state pattern has to work mechanically in ComfyUI, not confirmed author docs.
Troubleshooting.
- The value doesn't seem to persist to the next lap. Make sure you're actually feeding this node's
loop_ctxoutput forward into the loop's continuation - if you write here but then wire the next iteration from a different (older)loop_ctx, your write gets discarded. This is the single most common mistake with the whole Set family. - Get Bool downstream still shows
default_value. Compare thekeystring here against what the Get node uses - a mismatched case or stray whitespace breaks the link silently, no error thrown. - Multiple Set Bool nodes in the same loop overwrite each other unexpectedly. If two branches of your graph both write to the same key in the same pass, whichever one executes last (or last in ComfyUI's execution order) wins - use distinct keys if you need to track more than one flag.
- Type error on
loop_ctx. You're feeding it something other than aMIE_LOOP_CTXfrom this pack's own Loop nodes.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ | |
| key | STRING | feedback_bool | โ |
| value | BOOLEAN | false | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ |