Visit ComfyUI Online for ready-to-use ComfyUI environment
Enhances sampler performance by enabling garbage collection after each step, managing memory effectively.
The SamplerOptions_GarbageCollection
node is designed to enhance the performance of samplers, particularly when working with large models that may encounter out-of-memory (OOM) issues during inference. This node achieves its purpose by enabling garbage collection after each sampling step, which helps manage memory usage more effectively. While this approach can mitigate memory-related problems, it comes with the tradeoff of potentially slower sampling times. This node is particularly useful for users working with complex models like Flux, where memory management is crucial for successful inference. By integrating garbage collection into the sampling process, this node provides a practical solution for maintaining system stability and preventing crashes due to memory overload.
The sampler
parameter is a required input that specifies the sampler to be used in the process. This parameter is crucial as it determines the sampling method and influences the overall behavior and output of the node. The sampler
is expected to be of type SAMPLER
, and it serves as the foundation upon which additional options, such as garbage collection, are applied. There are no specific minimum or maximum values for this parameter, as it is a categorical input representing different sampler types.
The garbage_collection
parameter is a required boolean input that controls whether garbage collection is enabled during the sampling process. By default, this parameter is set to True
, meaning that garbage collection will be performed after each sampling step. Enabling this option helps manage memory usage and can prevent out-of-memory errors, especially when working with large models. However, it may also result in slower sampling times due to the additional overhead of garbage collection. Users can choose to disable this feature by setting the parameter to False
if they prioritize speed over memory management.
The sampler
output parameter returns the modified sampler with the specified extra options applied, including the garbage collection setting. This output is of type SAMPLER
and reflects the changes made to the original sampler input, ensuring that the garbage collection option is integrated into the sampling process. The returned sampler is ready for use in subsequent steps, with the memory management enhancements provided by the garbage collection feature.
garbage_collection
parameter to True
to help manage memory usage more effectively.garbage_collection
parameter to False
to improve performance.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.