Git Product home page Git Product logo

learning-stable-diffusion's Introduction

Hi 👋, I'm Simon Law

A front-end developer based in Guangzhou, China.

🌈 Languages and Tools:

vue react nestjs electron typescript nodejs sass jquery git webpack npm

learning-stable-diffusion's People

Contributors

isimonlaw avatar

Watchers

 avatar

learning-stable-diffusion's Issues

Couldn't install gfpgan 错误

其实就是连不上网没法下载文件,其他类似 Couldn't install XXX 的报错应该都是这个问题。

打开你的stable-diffusion主目录,找到如图所示的launch.py文件,用编辑器打开。
找到  def prepare_enviroment():  开头的段落,在每个  https://github.com/  开头的链接前面添加   https://ghproxy.com/   ,变成  https://ghproxy.com/https://github.com/  格式开头。

保存文件,去运行 user.bat 测试。

参考:https://www.bilibili.com/read/cv19991459/

缺少 xFormers 模块

xFormers安装使用

xFormers是一个模块化和可编程的Transformer建模库,可以加速图像的生成。
这种优化仅适用于nvidia gpus,它加快了图像生成,并降低了vram的使用量,而成本产生了非确定性的结果。

下载地址:
https://github.com/facebookresearch/xformers

启用xformers对大图及以上有极为巨大的性能提升,极大幅度降低显存占用,并且有很大可能修复黑图。代价是部分细节可能有些许改变(有可能有巨大改变)。如果不是非常吹毛求疵,强烈推荐使用xformers生成高分辨率的图片。

即使同一种子、同一参数,使用xFormers后每次出的图都有点变化,主要是物件的边缘。但是和显卡型号的改变一样,只是细节上一些变化,不对比看不出来。请自行衡量能不能接受这些改变。

linux上构建xFormers:
切换到webui根目录

source ./venv/bin/activate
cd repositories
git clone https://github.com/facebookresearch/xformers.git
cd xformers
git submodule update --init --recursive
pip install -r requirements.txt
pip install -e

Windows上构建xFormers:
安装依赖项:

1、安装VS Build Tools 2022,只需要安装Desktop development with C++
https://visualstudio.microsoft.com/downloads/?q=build+tools#build-tools-for-visual-studio-2022

2、安装Install CUDA 11.3,如果已安装Stable Diffusion WebUI,则忽略
拉取xformers源码,创建venv并激活

git clone https://github.com/facebookresearch/xformers.git
cd xformers
git submodule update --init --recursive
python -m venv venv
.\venv\scripts\activate.bat

然后安装其余的依赖项
pip install -r requirements.txt
pip install wheel

运行以下内容:
python setup.py build
python setup.py bdist_wheel

在xformers目录下,进入dist文件夹,将.whl文件复制到目录stable-diffusion-webui。

如果当前安装的是Python3.10版本,也可以直接下载打包好的whl
https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl

在stable-diffusion-webui目录下,安装.whl,如果名称不同,请在以下命令中更改文件名称:
.\venv\scripts\activate.bat
pip install xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl

修改webui-user.bat,确保xformers被启用
set COMMANDLINE_ARGS=--xformers

最新版本的xformers不需要编译代码,可以直接通过pip安装
在stable-diffusion-webui目录下

.\venv\scripts\activate.bat
pip install xformers

参考:https://blog.csdn.net/watson2017/article/details/129358022

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.