@@ -603,6 +603,8 @@ def _comfy_kitchen_int8_inputs(q, k, v, heads, mask, skip_reshape, enable_gqa):
603603
604604@wrap_attn
605605def attention_comfy_kitchen_int8 (q , k , v , heads , mask = None , attn_precision = None , skip_reshape = False , skip_output_reshape = False , ** kwargs ):
606+ if kwargs .get ("low_precision_attention" , True ) is False and q .dtype == torch .float32 :
607+ return attention_pytorch (q , k , v , heads , mask = mask , attn_precision = attn_precision , skip_reshape = skip_reshape , skip_output_reshape = skip_output_reshape , ** kwargs )
606608 q , k , v , mask , b , dim_head = _comfy_kitchen_int8_inputs (
607609 q , k , v , heads , mask , skip_reshape , kwargs .get ("enable_gqa" , False )
608610 )
@@ -622,6 +624,8 @@ def _attention_comfy_kitchen_int8_containers(q, k, v, heads, mask=None, attn_pre
622624 q = q .take ()
623625 k = k .take ()
624626 v = v .take ()
627+ if kwargs .get ("low_precision_attention" , True ) is False and q .dtype == torch .float32 :
628+ return attention_pytorch (q , k , v , heads , mask = mask , attn_precision = attn_precision , skip_reshape = skip_reshape , skip_output_reshape = skip_output_reshape , ** kwargs )
625629 q , k , v , mask , b , dim_head = _comfy_kitchen_int8_inputs (
626630 q , k , v , heads , mask , skip_reshape , kwargs .get ("enable_gqa" , False )
627631 )
0 commit comments