Update app.py
Browse files10 unmodified lines1112131415161718192021222314151666 unmodified lines8384858687888990919293949596979810 unmodified lines check=False,)
from flash_attn import flash_attn_func
try: from ltx_core.model.transformer import attention as _attn_mod _attn_mod.memory_efficient_attention = flash_attn_funcexcept Exception as e: print(f"[ATTN] FA3 import failed: {e}, using xformers") from xformers.ops import memory_efficient_attention as _mea _attn_mod.memory_efficient_attention = _mea
# Clone LTX-2 repo and install packagesLTX_REPO_URL = "https://github.com/Lightricks/LTX-2.git"LTX_REPO_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "LTX-2")66 unmodified linesfrom ltx_core.loader.primitives import LoraPathStrengthAndSDOpsfrom ltx_core.loader.sd_ops import LTXV_LORA_COMFY_RENAMING_MAP
from flash_attn import flash_attn_func
try: from ltx_core.model.transformer import attention as _attn_mod _attn_mod.memory_efficient_attention = flash_attn_funcexcept Exception as e: print(f"[ATTN] FA3 import failed: {e}, using xformers") from xformers.ops import memory_efficient_attention as _mea _attn_mod.memory_efficient_attention = _mea
# Attention kernels: try FlashAttention-3 first, fall back to xformersfrom ltx_core.model.transformer import attention as _attn_modprint(f"[ATTN] Before patch: memory_efficient_attention={_attn_mod.memory_efficient_attention}")app.py+10-10