This commit is contained in:
comfyanonymous 2026-03-05 10:35:56 -08:00 committed by GitHub
parent 5073da57ad
commit 1c3b651c0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,7 +86,7 @@ def cast_bias_weight_with_vbar(s, dtype, device, bias_dtype, non_blocking, compu
#a clone conservatively as we are mmapped and some SFT files are packed misaligned #a clone conservatively as we are mmapped and some SFT files are packed misaligned
#If you are a custom node author reading this, please move your layer to the GPU #If you are a custom node author reading this, please move your layer to the GPU
#or declare your ModelPatcher as CPU in the first place. #or declare your ModelPatcher as CPU in the first place.
if device is not None and device.type == "cpu": if comfy.model_management.is_device_cpu(device):
weight = s.weight.to(dtype=dtype, copy=True) weight = s.weight.to(dtype=dtype, copy=True)
if isinstance(weight, QuantizedTensor): if isinstance(weight, QuantizedTensor):
weight = weight.dequantize() weight = weight.dequantize()