ComfyUI/comfy/ldm/modules
Luca Wehrstedt 2fde495c33 Replace xformers FMHA imports with mslk package
The xFormers project has migrated its fused multi-head attention (FMHA)
implementation to a new standalone package called `mslk` (Meta
Superintelligence Labs Kernels). The `xformers` package now re-exports
from `mslk` for backward compatibility, but direct dependence on `mslk`
is preferred going forward.

This commit updates all FMHA import sites to use
`mslk.attention.fmha` instead of `xformers.ops`. All user-facing
behavior -- CLI arguments, environment variables, log messages, error
messages, and documentation -- remains unchanged.

What changed:
- `import xformers` / `import xformers.ops` replaced with
  `import mslk` / `import mslk.attention.fmha` in:
    comfy/model_management.py
    comfy/ldm/modules/attention.py
    comfy/ldm/modules/diffusionmodules/model.py
    comfy/ldm/pixart/blocks.py
- Calls to `xformers.ops.memory_efficient_attention(...)` replaced with
  `mslk.attention.fmha.memory_efficient_attention(...)`.
- Version-gating logic for old xformers bugs (0.0.18, 0.0.2x) removed,
  as those versions predate the mslk migration.
- The pip dependency is now `mslk` rather than `xformers`.

This migration was prepared by the xFormers team. We have done our best
to ensure correctness and preserve all existing behavior, but we welcome
feedback from maintainers if anything should be adjusted.
2026-04-23 04:14:12 -07:00
..
diffusionmodules Replace xformers FMHA imports with mslk package 2026-04-23 04:14:12 -07:00
distributions Small optimizations. 2024-12-18 18:23:28 -05:00
encoders Remove dead code. (#13251) 2026-04-01 20:22:06 -04:00
attention.py Replace xformers FMHA imports with mslk package 2026-04-23 04:14:12 -07:00
ema.py New Year ruff cleanup. (#11595) 2026-01-01 22:06:14 -05:00
sdpose.py SDPose: resize input always (#13349) 2026-04-10 11:26:55 -10:00
sub_quadratic_attention.py Widen OOM_EXCEPTION to AcceleratorError form (#12835) 2026-03-10 00:41:02 -04:00
temporal_ae.py Basic Hunyuan Video model support. 2024-12-16 19:35:40 -05:00