Stable diffusion 本地部署

  1. 安装 python 3.10.6
  2. 安装 git
  3. git clone repo
  4. 去 hugging face 里下载 Stable diffusion 的 model,放进项目文件中的 models - Stable-diffusion 中( 这就是将要使用的大模型 )
  5. 在项目中的 webui.bat 中添加这段代码 set COMMANDLINE_ARGS=--no-gradio-queue
  6. 开启魔法,运行 webui.bat 
@echo off

if exist webui.settings.bat (
    call webui.settings.bat
)
set COMMANDLINE_ARGS=--no-gradio-queue 

if not defined PYTHON (set PYTHON=python)
if defined GIT (set "GIT_PYTHON_GIT_EXECUTABLE=%GIT%")
if not defined VENV_DIR (set "VENV_DIR=%~dp0%venv")

注意:如果是最新的 5060 显卡,CUDA 是 12.9 版本,会和项目虚拟环境中的 pytorch 不兼容,需要降低 CUDA版本,并卸载原来的 pytorch 然后安装相匹配的 pytorch 版本

你可能感兴趣的:(stable,diffusion)