Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI Any-Device Offload > Offload Anything (GPU/CPU)

ComfyUI Node: Offload Anything (GPU/CPU)

Class Name

AnyDeviceOffload

Category
utils/hardware
Author
FearL0rd (Account age: 3646days)
Extension
ComfyUI Any-Device Offload
Latest Updated
2026-02-06
Github Stars
0.03K

How to Install ComfyUI Any-Device Offload

Install this extension via the ComfyUI Manager by searching for ComfyUI Any-Device Offload
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Any-Device Offload 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

Offload Anything (GPU/CPU) Description

Optimizes AI model performance by offloading tasks to CPUs/GPUs, enhancing efficiency.

Offload Anything (GPU/CPU):

The AnyDeviceOffload node is designed to optimize the performance of AI models by managing the allocation of computational resources across different devices, such as CPUs and GPUs. This node allows you to offload specific parts of a model to a target device, which can help in balancing the workload and improving efficiency, especially in environments with limited GPU memory. By dynamically adjusting where the model components are processed, AnyDeviceOffload ensures that your AI models can run smoothly without being constrained by the hardware limitations of a single device. This capability is particularly beneficial for complex models that require significant computational power, as it allows for more flexible resource management and can lead to faster processing times and reduced memory usage.

Offload Anything (GPU/CPU) Input Parameters:

target_device

The target_device parameter specifies the device to which you want to offload the model components. This can be a GPU or a CPU, depending on your system's configuration and the computational requirements of your model. The parameter accepts a string that represents the device, such as "cuda:0" for the first GPU or "cpu" for the central processing unit. The choice of device impacts the execution speed and efficiency of the model, with GPUs generally providing faster computation for parallelizable tasks. There are no explicit minimum or maximum values, but the default is typically set to "cpu" if no valid GPU is specified.

vae_mode

The vae_mode parameter determines how the Variational Autoencoder (VAE) component of the model is handled during the offloading process. This parameter influences whether the VAE is kept in memory or offloaded to the specified device, affecting the model's memory usage and processing speed. The options for this parameter are typically binary, such as True or False, indicating whether to keep the VAE in memory or not. The default setting is often False, meaning the VAE is offloaded unless specified otherwise.

keep_in_memory

The keep_in_memory parameter is a boolean flag that indicates whether the model components should remain in memory on the target device or be offloaded to the CPU when not in use. Setting this parameter to True can improve performance by reducing the need to reload model components from the CPU, but it may increase memory usage on the target device. Conversely, setting it to False can conserve memory but may result in slower execution due to the overhead of moving data between devices. The default value is typically False.

model

The model parameter refers to the specific AI model you are working with, such as a UNet or Transformer model. This parameter is crucial as it defines the primary computational workload that will be managed by the AnyDeviceOffload node. The model's architecture and size can significantly impact the effectiveness of offloading, with larger models benefiting more from distributed processing across devices. There are no specific default values, as this parameter is dependent on the user's choice of model.

clip

The clip parameter is associated with the CLIP (Contrastive Language–Image Pretraining) model, which is often used for tasks involving image and text processing. This parameter allows you to specify whether the CLIP model should be included in the offloading process, potentially improving performance by distributing its computational load. The impact of this parameter depends on the specific use case and the role of the CLIP model in your workflow. There are no explicit default values, as it is determined by the user's requirements.

vae

The vae parameter specifies the Variational Autoencoder component of the model, which can be offloaded to the target device. This parameter is important for managing the memory and processing resources associated with the VAE, which is often used in generative models. The choice of whether to offload the VAE can affect the model's performance and memory usage, with the default behavior typically being to offload unless specified otherwise.

Offload Anything (GPU/CPU) Output Parameters:

offloaded_model

The offloaded_model parameter represents the AI model after it has been processed by the AnyDeviceOffload node. This output is crucial as it indicates that the model components have been successfully distributed across the specified devices, optimizing resource usage and potentially improving performance. The offloaded model retains its original functionality but is now configured to operate more efficiently within the constraints of your hardware setup.

device_status

The device_status parameter provides information about the current allocation of model components across devices. This output is important for understanding how the offloading process has been executed and for verifying that the model components are correctly distributed according to the specified parameters. It helps in diagnosing any issues related to device allocation and ensures that the model is running as intended.

Offload Anything (GPU/CPU) Usage Tips:

  • Ensure that your target device has sufficient memory to handle the offloaded components, especially when working with large models or datasets.
  • Experiment with different configurations of vae_mode and keep_in_memory to find the optimal balance between performance and memory usage for your specific use case.
  • Regularly monitor the device_status output to verify that the offloading process is functioning correctly and that model components are allocated as expected.

Offload Anything (GPU/CPU) Common Errors and Solutions:

Device not found

  • Explanation: This error occurs when the specified target_device is not recognized by the system, possibly due to incorrect device naming or lack of available hardware.
  • Solution: Verify that the device name is correct and that the hardware is properly installed and recognized by your system. Use commands like torch.cuda.is_available() to check for available GPUs.

Memory allocation failed

  • Explanation: This error indicates that there is insufficient memory on the target device to accommodate the offloaded model components.
  • Solution: Reduce the model size or batch size, or consider offloading additional components to the CPU to free up memory on the target device.

Model component not found

  • Explanation: This error suggests that a specified model component, such as the VAE or CLIP, is not present or incorrectly referenced in the offloading process.
  • Solution: Ensure that all model components are correctly initialized and referenced in the input parameters. Double-check the model architecture and input settings.

Offload Anything (GPU/CPU) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Any-Device Offload
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.

Offload Anything (GPU/CPU)