mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-12 15:20:51 +08:00
Merge branch 'comfyanonymous:master' into master
This commit is contained in:
commit
a09513099a
@ -21,6 +21,7 @@ import comfy.model_management
|
||||
|
||||
|
||||
def cast_to(weight, dtype=None, device=None, non_blocking=False):
|
||||
non_blocking = False
|
||||
return weight.to(device=device, dtype=dtype, non_blocking=non_blocking)
|
||||
|
||||
def cast_to_input(weight, input, non_blocking=False):
|
||||
@ -34,7 +35,7 @@ def cast_bias_weight(s, input=None, dtype=None, device=None):
|
||||
device = input.device
|
||||
|
||||
bias = None
|
||||
non_blocking = comfy.model_management.device_should_use_non_blocking(device)
|
||||
non_blocking = comfy.model_management.device_supports_non_blocking(device)
|
||||
if s.bias is not None:
|
||||
bias = cast_to(s.bias, dtype, device, non_blocking=non_blocking)
|
||||
if s.bias_function is not None:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user