当前位置: 首页>后端>正文

stable-diffusion-webui 使用

  • 启动含api的webui
webui.bat --api --listen
bash webui.sh --api  --listen
  • Create environment
conda create -n StableDiffusion python=3.10.6
  • Activate environment
conda activate StableDiffusion
  • Validate environment is selected
conda env list
  • Start local webserver
webui-user.bat

Wait for "Running on local URL: http://127.0.0.1:7860" and open that URI.

  • conda 安装设置国内镜像
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main/
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/free/
conda config --add channels https://mirrors.aliyun.com/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.aliyun.com/anaconda/cloud/menpo/
conda config --add channels https://mirrors.aliyun.com/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.aliyun.com/anaconda/cloud/msys2/
  • 验证是否成功设置阿里云镜像
conda config --set show_channel_urls yes
  • pip设置阿里云镜像
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
  • 验证是否成功设置了阿里云的镜像
pip config list
  • github上无法下载,手动安装包进行安装:
python setup.py build install
  • 生成时报错:RuntimeError: "log_vml_cpu" not implemented for 'Half'

修改modules/paths_internal.py启动参数

commandline_args = os.environ.get('COMMANDLINE_ARGS', "--skip-torch-cuda-test --precision full --no-half")
sys.argv += shlex.split(commandline_args)
  • 安装tb-lightly失败,使用阿里云镜像
 pip install tb-nightly -i https://mirrors.aliyun.com/pypi/simple
  • API SDK
https://github.com/mix1009/sdwebuiapi
  • API 文档
http://localhost:7860/docs
  • 相关文档说明
    AI绘图开源工具Stable Diffusion WebUI前端API对接 - Dragonir - 博客园 (cnblogs.com)

https://www.xamrdz.com/backend/3cn1935319.html

相关文章: