ComfyUI > Nodes > ComfyUI-LogicUtils > Memory String

ComfyUI Node: Memory String

Class Name

MemoryNode

Category
Logic Gates
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

Install this extension via the ComfyUI Manager by searching for ComfyUI-LogicUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-LogicUtils in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Memory String Description

MemoryNode stores and updates values conditionally, enabling dynamic stateful operations.

Memory String:

The MemoryNode is designed to store a value in memory, exhibiting a flip-flop behavior. This means it can hold onto a value and update it based on certain conditions, specifically when a flag is set. This node is particularly useful in scenarios where you need to retain a piece of information across different stages of a workflow or when you want to toggle between states based on input conditions. By storing values in memory, it allows for more dynamic and stateful operations within your logic gates, enabling more complex decision-making processes without the need for external storage or repeated calculations.

Memory String Input Parameters:

input1

This parameter represents the value you wish to store in memory. It can be of any type, allowing for flexibility in the kind of data you want to retain. The impact of this parameter is significant as it determines what information is held by the node. The default value is an empty string, but it can be set to any value you need to store.

flag

The flag parameter acts as a trigger to update the stored memory value. When set to a truthy value, it causes the node to update its memory with the current input1 value. This parameter is crucial for controlling when the memory should be updated, allowing for conditional storage based on your workflow's logic. The default value is 0, which means the memory will not update unless explicitly triggered.

Memory String Output Parameters:

anytype

The output of the MemoryNode is the current value stored in memory. This output reflects the last value that was either initially set or updated based on the flag condition. It is important as it provides the retained value that can be used in subsequent operations or logic gates, enabling continuity and state management within your workflow.

Memory String Usage Tips:

  • Use the flag parameter to control when the memory should update, allowing for dynamic changes based on specific conditions in your workflow.
  • Initialize input1 with a meaningful default value if you expect the memory to be used before any updates occur, ensuring that the node outputs a useful initial state.

Memory String Common Errors and Solutions:

Memory not updating

  • Explanation: This error occurs when the memory value does not change despite expecting an update.
  • Solution: Ensure that the flag parameter is set to a truthy value when you want the memory to update. Without this, the node will retain its previous value.

Unexpected output type

  • Explanation: The output type does not match the expected type for subsequent nodes.
  • Solution: Verify that the input1 parameter is set to the correct type that matches the expected input type of downstream nodes. Adjust the input or use type conversion if necessary.

Memory String Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-LogicUtils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Memory String