Nodes/ComfyUI_MieNodes/Mie Loop Param Get Bool ๐Ÿ‘
ComfyUI Node

Mie Loop Param Get Bool ๐Ÿ‘

Read a boolean flag out of the loop state

By MieMieeeeeยทCreated 2 years agoยทUpdated 28 days agoยท 225
Mie Loop Param Get Bool ๐Ÿ‘
  • loop_ctx
  • BOOLEAN
โ—„keyvalueโ–บ
โ—„default_valuefalseโ–บ

The boolean member of the loop getter family. Inside a MieNodes loop, this node reads a true/false flag out of the loop_ctx state bag by name and hands it back as a BOOLEAN.

Part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, under the ๐Ÿ‘ Loop submenu.

How it differs from the others

Worth being precise here, because it's easy to misread. MieLoopStart's param_type only offers int, float, string, and json - there's no bool iteration mode. So unlike ParamGetInt or ParamGetString, which usually read the primary iterated value, MieLoopParamGetBool is really a state-bag flag reader. It pulls a boolean you put into the loop's shared state - via MieLoopStart's initial_state_json, or written back each pass through MieLoopEnd's state_json.

That makes it the natural node for carrying a condition across iterations. Think "have we hit a good-enough result yet," "should this pass skip the upscale," "is this the warm-up run." You set the flag somewhere in the loop, read it here, and branch on it downstream.

The inputs and outputs that matter

  • loop_ctx (MIE_LOOP_CTX) - the loop context.
  • key (STRING, default value) - the name of the flag to read. You'll almost always set this to something meaningful like converged or skip_step, since the default value key normally holds the iterated payload, not a bool.
  • default_value (BOOLEAN, default false) - what you get if the key isn't set yet. Sensible: on the first pass, before anything has written the flag, you fall back to false.
  • Output BOOLEAN - the flag's current value.

Installing it

ComfyUI Manager โ†’ search ComfyUI-MieNodes โ†’ install โ†’ restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes

then restart. No model downloads or heavy dependencies. Under ๐Ÿ‘ MieNodes โ†’ ๐Ÿ‘ Loop.

Common issues

It's always false. Two usual causes: the key doesn't match the name you wrote the flag under, or nothing ever wrote it and you're seeing the default_value. Booleans have to be put into the state first - via initial_state_json on Start or state_json on End - before this node can read anything but the fallback.

I wanted first/last-iteration logic. Don't hand-roll that with a bool. Use MieLoopIfIsFirst / MieLoopIfIsLast, which know the loop's position directly.

Leaving the key at value. That default collides with where the iterated payload usually lives. Give your flag its own key so you're not reading the loop's current item and trying to coerce it to a bool.

Category๐Ÿ‘ MieNodes/๐Ÿ‘ Loop

Inputs (3)

NameTypeDefaultDescription
loop_ctxMIE_LOOP_CTXโ€”
keySTRINGvalueโ€”
default_valueBOOLEANfalseโ€”

Outputs (1)

NameTypeDescription
BOOLEANBOOLEANโ€”