Wan2.2をcomfyui を使わず実行する

Wan2.2

GitHub – Wan-Video/Wan2.2: Wan: Open and Advanced Large-Scale Video Generative Models

バッチファイル

@echo off
call %~dp0\scripts\env_for_icons.bat  %*
SET PATH=%PATH%;%WINPYDIRBASE%\PortableGit;%WINPYDIRBASE%\PortableGit\bin
SET PATH=%PATH%;%WINPYDIRBASE%\ffmpeg\bin
If not exist %WINPYDIRBASE%\content mkdir  %WINPYDIRBASE%\content 

set APP_NAME=Wan2.2
set APP_DIR=%WINPYDIRBASE%\content\%APP_NAME%
echo %APP_DIR%
cd %WINPYDIRBASE%\content\

If not exist  %APP_DIR% git clone https://github.com/Wan-Video/Wan2.2


cd %APP_DIR%
timeout /t 5
if not defined VENV_DIR (set "VENV_DIR=%APP_DIR%\venv")
if EXIST %VENV_DIR% goto :activate_venv

::python.exe -m venv "%VENV_DIR%" 
python.exe -m venv "%VENV_DIR%" --system-site-packages 
if %ERRORLEVEL% == 0 goto :pip
echo Unable to create venv 
goto :skip_venv

:pip
call "%VENV_DIR%\Scripts\activate"
pip install -r requirements.txt
cmd.exe /k

:activate_venv
call "%VENV_DIR%\Scripts\activate"
 
cmd.exe /k
goto :skip_venv
:skip_cmd
::
:skip_venv
cmd.exe /k

requirements.txt追加と消してください

peft
librosa
decord

flash_attn 消し

コマンド

Releases · petermg/flash_attn_windows
GitHub – woct0rdho/triton-windows: Fork of the Triton language and compiler for Windows support and easy installation
からダウンロードしてから

pip install -r requirements.txt
pip uninstall torch
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124    pip install 
pip install "E:\WPy64-31241\content\Wan2.2\triton-3.0.0-cp312-cp312-win_amd64.whl"
pip install "E:\WPy64-31241\content\Wan2.2\flash_attn-2.7.4-cp312-cp312-win_amd64.whl"

pip install "huggingface_hub[cli]"
huggingface-cli download Wan-AI/Wan2.2-T2V-A14B --local-dir ./Wan2.2-T2V-A14B
huggingface-cli download Wan-AI/Wan2.2-I2V-A14B --local-dir ./Wan2.2-I2V-A14B

実行

python generate.py --task i2v-A14B --size 1280*720 --ckpt_dir ./Wan2.2-I2V-A14B --offload_model True --convert_model_dtype --image examples/i2v_input.JPG --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."

これで実行できましたが私の環境で重すぎました

Python

Posted by eightban