Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.comfy.org/llms.txt

Use this file to discover all available pages before exploring further.

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub

Overview

The SelectModelDevice node allows you to manually choose which device (CPU or a specific GPU) a diffusion model runs on. It can move a model to a different device, and it handles conflicts with other multi-GPU nodes automatically.

Inputs

ParameterData TypeRequiredRangeDescription
modelMODELYesThe diffusion model to place on a specific device.
deviceCOMBOYes"default"
"cpu"
"gpu:0"
"gpu:1"
"gpu:2"
"gpu:3"
"gpu:4"
"gpu:5"
"gpu:6"
"gpu:7"
The target device for the model. Options are dynamically generated based on available GPUs. (default: “default”)
Parameter Details:
  • "default": Restores the device assigned by the model loader, even if a previous SelectModelDevice node changed it.
  • "cpu": Pins both the load and offload device to the CPU.
  • "gpu:N": Pins the load device to the Nth available GPU (e.g., "gpu:0" for the first GPU). The offload device is restored to the loader’s original choice.
Important Notes:
  • If the requested device does not exist on the current machine (e.g., a workflow created on a 2-GPU machine is opened on a 1-GPU machine), the node will pass the model through unchanged and log a message instead of failing.
  • If the model is already on the requested device, the node takes a fast path and does not reload the model.
  • Placing this node after a node that has already consumed the model (e.g., a KSampler) is not recommended, as any state changed by the prior node will be observed if the device matches the original.

Outputs

Output NameData TypeDescription
modelMODELThe diffusion model, now placed on the selected device. If the device was invalid or unavailable, the model is passed through unchanged.

Source fingerprint (SHA-256): 02841975f123cc8ae8152ea86f1798e0e7e68255ecd11e04271da886b75eb0fd