StableDiffusion运行多显卡上

395 词

StableDiffusion运行多显卡上

相当于SD的 CUDA_VISIBLE_DEVICES。

webui-user.sh中加入export参数。

export CUDA_VISIBLE_DEVICES=0,1,2,3

./stable-diffusion-webui/webui.sh --listen --device-id 1
这样运行,SD可以同时使用显卡0和显卡1.

CUDA_VISIBLE_DEVICES=0,1,2,3 python launch.py --share

CUDA_VISIBLE_DEVICES=1 python launch.py --share

cmd_args.py --device-id

device-id参数是在cmd_args.py文件中出现的。

os.environ.get(‘CUDA_VISIBLE_DEVICES’)
Python文件中会用这个参命令取得用户的设置,GPU数。