Visit ComfyUI Online for ready-to-use ComfyUI environment
Store and update values with controlled memory retention for AI art projects.
The LogicUtil_MemoryNode is designed to store a value in memory, exhibiting flip-flop behavior. This means it can retain a value until a specific condition prompts it to update. This node is particularly useful in scenarios where you need to maintain a state or value across different stages of your workflow. By leveraging this node, you can ensure that a value is preserved and only updated when necessary, providing a controlled and predictable way to manage data flow within your AI art projects.
input1
is the primary value that you want to store in memory. This parameter can be of any type, allowing for flexibility in the kind of data you wish to retain. The default value for input1
is an empty string (""
). When the node is first executed or when the flag
parameter is set, input1
will be stored in memory. This stored value can then be used in subsequent operations until it is updated again.
flag
is a control parameter that determines whether the stored value should be updated. This parameter can also be of any type, with a default value of 0
. When the flag
is set to a truthy value (e.g., 1
or True
), the node will update the stored value with the current input1
. If the flag
is falsy (e.g., 0
or False
), the node will retain the previously stored value. This mechanism allows for conditional updates, providing a way to control when the memory value should change.
The output parameter memory_value
represents the value currently stored in memory. This value is of the same type as input1
and reflects the most recent value stored based on the flag
condition. The memory_value
is crucial for maintaining state across different parts of your workflow, ensuring that the necessary data is available when needed without being inadvertently overwritten.
flag
parameter to control when the memory value should be updated. This can be particularly useful in scenarios where you need to preserve a value until a specific condition is met.input1
with a meaningful default value to ensure that the node behaves predictably on its first execution.input1
"input1
is not compatible with the expected type.input1
is of a type that the node can handle. If necessary, convert the input to a compatible type before passing it to the node.flag
"flag
is not compatible with the expected type.flag
is of a type that the node can handle. If necessary, convert the input to a compatible type before passing it to the node.input1
is provided and the node is executed at least once to initialize the memory value before attempting to access it.© Copyright 2024 RunComfy. All Rights Reserved.