Skip to content

Commit d4c7ebf

Browse files
Remove old useless no comfy kitchen fallback. (Comfy-Org#14245)
* Remove old fallback used when no comfy kitchen. * Remove unused logging import
1 parent dc10c01 commit d4c7ebf

1 file changed

Lines changed: 13 additions & 19 deletions

File tree

comfy/ldm/flux/math.py

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from comfy.ldm.modules.attention import optimized_attention
66
import comfy.model_management
7-
import logging
7+
import comfy.quant_ops
88

99

1010
def attention(q: Tensor, k: Tensor, v: Tensor, pe: Tensor, mask=None, transformer_options={}) -> Tensor:
@@ -44,21 +44,15 @@ def _apply_rope(xq: Tensor, xk: Tensor, freqs_cis: Tensor):
4444
return apply_rope1(xq, freqs_cis), apply_rope1(xk, freqs_cis)
4545

4646

47-
try:
48-
import comfy.quant_ops
49-
q_apply_rope = comfy.quant_ops.ck.apply_rope
50-
q_apply_rope1 = comfy.quant_ops.ck.apply_rope1
51-
def apply_rope(xq, xk, freqs_cis):
52-
if comfy.model_management.in_training:
53-
return _apply_rope(xq, xk, freqs_cis)
54-
else:
55-
return apply_rope1(xq, freqs_cis), apply_rope1(xk, freqs_cis)
56-
def apply_rope1(x, freqs_cis):
57-
if comfy.model_management.in_training:
58-
return _apply_rope1(x, freqs_cis)
59-
else:
60-
return q_apply_rope1(x, freqs_cis)
61-
except:
62-
logging.warning("No comfy kitchen, using old apply_rope functions.")
63-
apply_rope = _apply_rope
64-
apply_rope1 = _apply_rope1
47+
def apply_rope(xq, xk, freqs_cis):
48+
if comfy.model_management.in_training:
49+
return _apply_rope(xq, xk, freqs_cis)
50+
else:
51+
return comfy.quant_ops.ck.apply_rope(xq, xk, freqs_cis)
52+
53+
54+
def apply_rope1(x, freqs_cis):
55+
if comfy.model_management.in_training:
56+
return _apply_rope1(x, freqs_cis)
57+
else:
58+
return comfy.quant_ops.ck.apply_rope1(x, freqs_cis)

0 commit comments

Comments
 (0)