mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-21 20:00:17 +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):
|
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)
|
return weight.to(device=device, dtype=dtype, non_blocking=non_blocking)
|
||||||
|
|
||||||
def cast_to_input(weight, input, non_blocking=False):
|
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
|
device = input.device
|
||||||
|
|
||||||
bias = None
|
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:
|
if s.bias is not None:
|
||||||
bias = cast_to(s.bias, dtype, device, non_blocking=non_blocking)
|
bias = cast_to(s.bias, dtype, device, non_blocking=non_blocking)
|
||||||
if s.bias_function is not None:
|
if s.bias_function is not None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user