解决stable-diffusion-webui时的问题:No module ‘xformers‘. Proceeding without it

p.s 被另一篇文章坑了,装个xformers把我原先的pytorch降智了&%$^#

注意:!!!xformers非强制安装;可优化显存,提高性能和出图速率,对于GPU能力有限的用户很有用;安装过程会调整pytorch版本以适配xformers安装版本。过高版本的xformers可能会引起兼容性问题

被坑后总结的方法:

stable-diffusion-webui/venv/Scripts目录下进入terminal,输入activate激活stable diffusion创建的虚拟环境,然后使用:

pip install xformers==x.x.x

xformers同pytorch的版本对应关系:

py 复制代码
# 进入sd虚拟python环境查看
import torch # 如果pytorch安装成功即可导入
print(torch.__version__) # 查看pytorch版本
print(torch.cuda.is_available()) # 查看CUDA是否可用
print(torch.cuda.device_count()) # 查看可用的CUDA数量
print(torch.version.cuda) # 查看CUDA的版本号

详细可查 https://github.com/facebookresearch/xformers/tags

例如我的pytorch是2.1.2+cu121版本,根据github文档这里我下载的便是v0.0.23.post1

提供一些参考:

可能的问题:

  • 如果出现长路径不支持的警告
    ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory...HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths

参照这篇文章设置:

https://www.cnblogs.com/sugarwxx/p/17804888.html

win11:

Win +R 打开运行 输入 gpedit.msc 》计算机配置》管理模板=》系统=》文件系统=》双击启用Win32长路径=》选择启用

相关推荐
weiwei228443 天前
文生图模型Stable Diffusion使用详解
stable diffusion·文生图
Hello123网站3 天前
DreamStudio-Stable Diffusion官方绘画工具
stable diffusion·ai工具
如若1233 天前
CompVis Stable Diffusion 正确安装与运行指南
stable diffusion
全息数据8 天前
DDPM代码讲解【详细!!!】
深度学习·stable diffusion·多模态·ddpm
老鱼说AI17 天前
当自回归模型遇上扩散模型:下一代序列预测模型详解与Pytorch实现
人工智能·pytorch·深度学习·神经网络·语言模型·自然语言处理·stable diffusion
我希望的一路生花23 天前
Nik Collection 6.2全新版Nik降噪锐化调色PS/LR插件
人工智能·计算机视觉·设计模式·stable diffusion·aigc
GetcharZp23 天前
玩转AI绘画,你只差一个节点式“魔法”工具——ComfyUI 保姆级入门指南
人工智能·stable diffusion
Seeklike25 天前
diffuxers学习--AutoPipeline
人工智能·python·stable diffusion·diffusers
游戏AI研究所25 天前
ComfyUI 里的 Prompt 插值器(prompt interpolation / text encoder 插值方式)的含义和作用!
人工智能·游戏·机器学习·stable diffusion·prompt·aigc
迈火1 个月前
ComfyUI-3D-Pack:3D创作的AI神器
人工智能·gpt·3d·ai·stable diffusion·aigc·midjourney