Skip to content

Commit fcdb4a5

Browse files
committed
ops: dont take an offload stream if you dont need one
1 parent c58c13b commit fcdb4a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

comfy/ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def cast_bias_weight(s, input=None, dtype=None, device=None, bias_dtype=None, of
8484
if device is None:
8585
device = input.device
8686

87-
if offloadable:
87+
if offloadable and (device != s.weight.device or
88+
(s.bias is not None and device != s.bias.device)):
8889
offload_stream = comfy.model_management.get_offload_stream(device)
8990
else:
9091
offload_stream = None

0 commit comments

Comments
 (0)