Skip to content

安装推理加速插件 FlashAttention-windows

FlashAttention 用于 GPU 推理加速,主要服务于 Linux。Windows 安装 FlashAttention 可以通过如下方式安装。

安装过程较为复杂,故制作了一键整合包,仅包含原生的 ComfyUI 代码和以上介绍的底层依赖,未安装任何插件,绿色干净,关注本公众号,回复 comfyui 获取下载链接

下载轮子

首先去 此处 下载对应版本的轮子。

img.png

例如,我的版本是:

text
python:3.12.8
cuda:12.4
pytorch:2.5.1

则下载上图框中所示的版本。下载之后,进行安装即可。

安装

常规命令:

shell
pip install flash_attn-2.7.4.post1+cu124torch2.5.1cxx11abiFALSE-cp312-cp312-win_amd64.whl

ComfyUI 命令:

shell
.\python_embeded\python.exe -m pip install .\bak\flash_attn-2.7.4.post1+cu124torch2.5.1cxx11abiFALSE-cp312-cp312-win_amd64.whl

Conda 环境:

shell
激活 Conda 环境
pip install flash_attn-2.7.4.post1+cu124torch2.5.1cxx11abiFALSE-cp312-cp312-win_amd64.whl