Python 3.11.6 で reforge を使う
カテゴリ:deeplearning
ROCm の whl のサポートが 3.11 からなので、3.11 で動作することは重要だ。
Python 3.13 では Numpy でコンフリクトがおこる
reforge は UI を Gradio 3 で作っている。Gradio 3 は Numpy < 2 を要求している。
Python 3.13 を使うと Pillow==11.0.0 にする必要がある。
Pillow==11.0.0 にすると blendmodes==2025 を使う必要がある。
blendmode==2025 は numpy>=2.02 を要求しており、Gradio 3 とコンフリクト。
python のバージョンチェックを無効化
webui-user.bat に以下のコマンドを追加。
set COMMANDLINE_ARGS=--skip-python-version-check
pytorch のバージョン変更(オプション)
modules/launch_utils.py の 364 行目と 389 行目で torch index の変更。
torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu124")
xformers_package = os.environ.get('XFORMERS_PACKAGE', '--index-url https://download.pytorch.org/whl/cu124 xformers==0.0.27')
インストールする torch のバージョンの指定。
torch_command = os.environ.get('TORCH_COMMAND', f"pip install torch==2.6.0 torchvision==0.21.0 --extra-index-url {torch_index_url}")
requirements_versions.txt の修正
- scikit-imageのバージョン削除
- Pillow==10.0.0
- blendmodes==2023
- safetensors==0.6.2
- transformers==4.48.3
- accelerate==0.4.0
- numpy==1.26.4
requirements_versions.txt の全文。
setuptools==69.5.1 # temp fix for compatibility with some old packages GitPython==3.1.32 Pillow==10.0 accelerate==0.4.0 blendmodes==2023 clean-fid==0.1.35 diskcache==5.6.3 einops==0.4.1 facexlib==0.3.0 fastapi==0.94.0 gradio==3.41.2 httpcore==0.15 inflection==0.5.1 jsonmerge==1.8.0 kornia==0.6.7 lark==1.1.2 numpy==1.26.4 omegaconf==2.2.3 open-clip-torch==2.20.0 piexif==1.1.3 protobuf==3.20.0 psutil==5.9.5 pytorch_lightning==1.9.4 resize-right==0.0.2 safetensors==0.6.2 scikit-image spandrel==0.3.4 spandrel-extra-arches==0.1.1 tomesd==0.1.3 torch torchdiffeq==0.2.3 torchsde==0.2.6 transformers==4.48.3 httpx==0.24.1 pillow-avif-plugin==1.4.3 albumentations==1.4.3 pydantic==1.10.15 diffusers==0.28.2 cachetools==5.3.2 colorama==0.4.6 huggingface_hub==0.25.0
起動
webui-user.bat を実行すると環境が構築されて実行される。