Skip to main content

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

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

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

Source fingerprint (SHA-256): 02841975f123cc8ae8152ea86f1798e0e7e68255ecd11e04271da886b75eb0fd