Skip to content

Commit f6b869d

Browse files
fp16 intermediates doen't work for some text enc models. (Comfy-Org#13056)
1 parent 56ff88f commit f6b869d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

comfy/sd1_clip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def encode_token_weights(self, token_weight_pairs):
4646
out, pooled = o[:2]
4747

4848
if pooled is not None:
49-
first_pooled = pooled[0:1].to(device=model_management.intermediate_device(), dtype=model_management.intermediate_dtype())
49+
first_pooled = pooled[0:1].to(device=model_management.intermediate_device())
5050
else:
5151
first_pooled = pooled
5252

@@ -63,9 +63,9 @@ def encode_token_weights(self, token_weight_pairs):
6363
output.append(z)
6464

6565
if (len(output) == 0):
66-
r = (out[-1:].to(device=model_management.intermediate_device(), dtype=model_management.intermediate_dtype()), first_pooled)
66+
r = (out[-1:].to(device=model_management.intermediate_device()), first_pooled)
6767
else:
68-
r = (torch.cat(output, dim=-2).to(device=model_management.intermediate_device(), dtype=model_management.intermediate_dtype()), first_pooled)
68+
r = (torch.cat(output, dim=-2).to(device=model_management.intermediate_device()), first_pooled)
6969

7070
if len(o) > 2:
7171
extra = {}

0 commit comments

Comments
 (0)