Try to fix TE bug.

This commit is contained in:
comfyanonymous 2024-08-18 14:02:41 -04:00 committed by GitHub
parent 73332160c8
commit 569e9ecce0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,8 @@ import comfy.model_management
def cast_to(weight, dtype=None, device=None, non_blocking=False):
if weight.device == device:
non_blocking = False
return weight.to(device=device, dtype=dtype, non_blocking=non_blocking)
def cast_to_input(weight, input, non_blocking=False):