Skip to content

Commit c350009

Browse files
authored
ops: Put weight cast on the offload stream (comfyanonymous#10697)
This needs to be on the offload stream. This reproduced a black screen with low resolution images on a slow bus when using FP8.
1 parent dea899f commit c350009

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

comfy/ops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ def cast_bias_weight(s, input=None, dtype=None, device=None, bias_dtype=None, of
110110
for f in s.bias_function:
111111
bias = f(bias)
112112

113-
weight = weight.to(dtype=dtype)
114-
if weight_has_function:
113+
if weight_has_function or weight.dtype != dtype:
115114
with wf_context:
115+
weight = weight.to(dtype=dtype)
116116
for f in s.weight_function:
117117
weight = f(weight)
118118

0 commit comments

Comments
 (0)