Nodes/comfyui-cyclist/Memorize Float
ComfyUI Node

Memorize Float

Remember a score or ratio across Cyclist loop iterations

By Pos13·Created 2 years ago·Updated 2 years ago· 33
Memorize Float
      loop_idForLoop_1
      to_memory

      Memorize Float stores one floating-point number in memory so the next run of your workflow can read it back. It's the decimal cousin of Memorize Int, and it's the node that makes "keep going until the result is good enough" loops possible in Cyclist - because "good enough" is almost always a float: a quality score, a denoise value, a megapixel count, a target CFG.

      The workflow it unlocks

      Cyclist turns ComfyUI's queue into a loop - every Queue Prompt is one iteration - but each run forgets everything. Memorize Float is how a number survives the gap. The canonical example from the pack's own docs: generate an image, run it through a scorer like ComfyUI-ImageReward, Memorize Float the score. Next run, Recall Float pulls yesterday's score back, you compare it against a target with Compare Anything, and an Interrupt node stops the loop once you clear the bar. That's a "generate until it's actually good" loop in five nodes, and the float memory is the pivot the whole thing turns on.

      There's a slicker variant too: instead of memorizing the score, memorize the best image so far on disk and use the float only to track which attempt won. Either way, a persisted float is doing the comparison.

      The inputs that matter

      • loop_id (STRING, default ForLoop_1) - the slot name. The matching Recall Float must use the same id to read this value.
      • to_memory (FLOAT) - the number you're saving.

      No outputs - it's a terminal node that lives at the end of a branch and commits the value. One float per loop_id; memorizing again under the same id overwrites it. (Each id also holds its own separate Int, String and Conditioning - the types don't clobber each other, only same-type writes do.)

      Install

      • ComfyUI Manager: search comfyui-cyclist, install, restart.
      • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/Pos13/comfyui-cyclist, restart.

      Nothing to download - pure Python.

      Gotchas

      It's memory, not disk - a ComfyUI restart wipes it. Fine for an in-session loop, useless if you need the value to survive a shutdown; use the Override/Reload disk nodes for that.

      One subtlety that bites people building the "generate until good" loop: some downstream nodes only accept a number representation of a boolean, and Cyclist's own Convert to node exists partly to bridge that. If you're chaining a comparison result into a math or scoring node from another pack (WAS Node Suite is the usual suspect), you may need a cast in between - that's a quirk of those nodes, not of Memorize Float, but it's where the float pipeline tends to snag.

      And the standing caveat for the whole pack: Cyclist is archived and the author has said they won't maintain it. It still runs fine today; just don't expect a patch if a future release moves something under it.

      Categorycyclist/Write

      Inputs (2)

      NameTypeDefaultDescription
      loop_idSTRINGForLoop_1
      to_memoryFLOAT

      Outputs (0)

      No outputs