novel Ai (stable-diffusion-webui)安装

关于novel ai的本地化安装

环境

  1. 英伟达显卡

  1. win11

  1. 可以连接github并下载内容

安装

  1. python 3.10.6及以上,安装并添加到path

  1. 安装cuDNNCUDAToolKit

  1. 先更新主机的显卡驱动,检查系统的显卡驱动版本的CUDA版本(电脑右下角:NVIDIA设置 -> NVIDIA控制面板 -> 左下角:系统信息 -> 选项卡:组件 -> 3D设置找CUDA:产品名称)

  1. cuDNN版本需比系统的的CUDA版本小

  1. cuDNN版本需符合pyTorch要求的版本

  1. CUDAToolKit 需配套 cuDNN版本

  1. 下载cuDNN和CUDAToolKit

  1. 精简安装cuDNN

  1. 将CUDAToolKit解压到cuDNN目录内

  1. 安装git并配置用户和邮箱

  1. 设置代理

  1. 先有一个梯子,设置系统代理

  1. 打开windows系统设置,进入网络和intenet,选择代理,在代理页面的自动设置代理自动检测设置选择打开-在手动设置代理使用代理服务器点击编辑-查看IP和端口port

  1. 设置git代理

    ::IP和端口填之前查到的IP和端口
    ::设置代理,一般为http,不行的话改为https
    git config --global http.proxy 'http://IP:端口' 
    ::其它
    :: 用编辑器打开git全局配置文件 .gitconf
    git config --global -e
    ::取消代理
    git config --global --unset http.proxy 
  1. 设置pip代理

    :获取各个配置文件的位置及内容
    pip config debug
    :设置代理
    pip config set global.proxy http://IP:端口
    :检查
    pip config debug
  1. 打开要文件夹,在命令行中打开

  1. 克隆stable-diffusion-webui:https://github.com/AUTOMATIC1111/stable-diffusion-webui

git clone git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
  1. 由于国内github环境的原因,可提前下载部分内容(麻烦,先跳过该步骤,如果不行的话在尝试,方便第二次安装,直接拷贝下载)

  1. pytorch,可以手动自己安装

  1. 环境依赖包,在项目文件\stable-diffusion-webui\requirements.txt

  1. 安装环境依赖:进入 stable-diffusion-webui 文件夹,打开命令行,输入 pip install -r requirements.txt,等待命令安装完成。

  1. 在 stable-diffusion-webui 文件夹中新建repositories文件夹并进入,从该目录打开命令行,下载并保存以下5个需要git clone 的文件。此文件夹可直接拷贝

  ::命令结构 git clone 网址 保存目录
  git clone https://github.com/Stability-AI/stablediffusion.git stable-diffusion-stability-ai
  git clone https://github.com/CompVis/taming-transformers.git taming-transformers
  git clone https://github.com/crowsonkb/k-diffusion.git k-diffusion
  git clone https://github.com/sczhou/CodeFormer.git CodeFormer
  git clone https://github.com/salesforce/BLIP.git BLIP
  1. 修改webui-user.bat文件,PYTHON路径填写你安装python的路径比如x:\xxx\xxx\python.exe,VENV_DIR填写-,不构建虚拟环境。COMMANDLINE_ARGS添加–xformers,降低显存需求

    @echo off

    set PYTHON= x:\xxx\xxx\python.exe 
    set GIT=
    set VENV_DIR=-                    
    set COMMANDLINE_ARGS=--xformers

    call webui.bat
  1. 双击webui-user.bat,等待安装完成。

  1. 根据命令行出现的网址打开网页(之后运行,也是先点击webui-user.bat,先启动服务,在打开网站)

中文

安装中文stable-diffusion-webui-localization-zh_CN:https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN,根据教程安装

    ::stable-diffusion-webui\extensions
    git clone gh repo clone dtlnor/stable-diffusion-webui-localization-zh_CN

模型与资源

civitai:模型

元素法典:标签的推荐

问题与解决

  1. RuntimeError: Couldn’t fetch Taming Transformers.Command: “git” -C “repositories\taming-transformers” fetchError code: 128stdout: <empty>stderr: error: RPC failed; curl 92 HTTP/2 stream 3 was not closed cleanly before end of the underlying streamfatal: expected flush after ref listing等问题

答:可能是git协议出错,可以输入:git config –global http.version HTTP/1.1

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
扎眼的阳光的头像扎眼的阳光普通用户
上一篇 2023年12月20日
下一篇 2023年12月20日

相关推荐