Fix regression when text encoder loaded directly on GPU. (#11129)

This commit is contained in:
comfyanonymous
2025-12-05 12:33:16 -08:00
committed by GitHub
parent 43071e3de3
commit 6fd463aec9
2 changed files with 26 additions and 20 deletions

View File

@@ -552,6 +552,8 @@ def mixed_precision_ops(quant_config={}, compute_dtype=torch.bfloat16, full_prec
weight_scale_key = f"{prefix}weight_scale"
scale = state_dict.pop(weight_scale_key, None)
if scale is not None:
scale = scale.to(device)
layout_params = {
'scale': scale,
'orig_dtype': MixedPrecisionOps._compute_dtype,