Linux 下从头部署 Wan2.2 模型(小显存优化)
本文介绍如何在 Linux 环境下从零部署 Wan2.2 开源视频生成模型,支持小显存运行。
前置条件
确保已安装 Python、Conda 环境及英伟达显卡驱动。
一、安装 PyTorch 与 CUDA
若已有相关环境可跳过此步。
-
创建 Python 虚拟环境
为保证稳定性,建议配置国内源:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple创建 Conda 环境:
conda create -n comfyui python=3.10 -y conda activate comfyui -
安装 PyTorch
查看 CUDA 版本:
nvidia-smi根据 CUDA 版本选择对应命令:
CUDA >= 12.1:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121CUDA = 11.8:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
二、安装 ComfyUI
-
下载 ComfyUI 主仓库
git clone https://github.com/comfyanonymous/ComfyUI.git cd ComfyUI -
安装依赖
pip install -r requirements.txt -
启动服务
在 8188 端口运行:
python main.py --listen 0.0.0.0 --port 8188本地浏览器访问
localhost:8188即可进入界面。 -
安装插件
进入
custom_nodes文件夹并克隆以下插件:-
ComfyUI-GGUF(用于小显存 GGUF 模型支持)
cd custom_nodes git clone https://github.com/cubiq/ComfyUI_GGUF.git cd ComfyUI_GGUF pip install gguf -
ComfyUI-Manager(节点管理器)
cd .. git clone https://github.com/ltdrdata/ComfyUI-Manager.git cd ComfyUI-Manager pip install -r requirements.txt
-


