本篇主要介绍stable_diffsion的本地部署过程以及有哪些坑。
AI部署参考的主要教程是B站秋葉aaaki
下载他的最终版整合包,然后自己配置环境,没有使用启动器
首先anaconda创建一个新的环境(推荐创建新的,免去包冲突的问题)
然后进入解压后的项目目录下,激活创建的环境,使用pip命令安装依赖包
注意:这里的requirements.txt文件可能会有冲突,因此我导出了我配置好环境的依赖文件,复制进去替换掉原来的内容,torch的版本需要根据自己显卡环境调整
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
| absl-py==1.4.0 accelerate==0.12.0 addict==2.4.0 aenum==3.1.11 aiofiles==23.1.0 aiohttp==3.8.4 aiosignal==1.3.1 altair==4.2.2 antlr4-python3-runtime==4.9.3 anyio==3.6.2 async-timeout==4.0.2 attrs==22.2.0 basicsr==1.4.2 beautifulsoup4==4.12.0 blendmodes==2022 boltons==23.0.0 cachetools==5.3.0 certifi==2022.12.7 chardet==4.0.0 charset-normalizer==3.1.0 clean-fid==0.1.29 click==8.1.3 clip @ git+https://github.com/openai/clip.git@a9b1bf5920416aaeaec965c25dd9e8f98c864f16 colorama==0.4.6 coloredlogs==15.0.1 contourpy==1.0.7 cssselect2==0.7.0 cycler==0.11.0 deprecation==2.1.0 docopt==0.6.2 einops==0.4.1 entrypoints==0.4 facexlib==0.2.5 fastapi==0.90.1 ffmpy==0.3.0 filelock==3.10.2 filterpy==1.4.5 flatbuffers==23.3.3 font-roboto==0.0.1 fonts==0.0.3 fonttools==4.39.2 frozenlist==1.3.3 fsspec==2023.3.0 ftfy==6.1.1 future==0.18.3 gdown==4.6.4 gfpgan==1.3.8 gitdb==4.0.10 GitPython==3.1.27 google-auth==2.16.2 google-auth-oauthlib==0.4.6 gradio==3.16.2 grpcio==1.51.3 h11==0.12.0 httpcore==0.15.0 httpx==0.23.3 huggingface-hub==0.13.3 humanfriendly==10.0 idna==2.10 imageio==2.26.1 inflection==0.5.1 invisible-watermark==0.1.5 Jinja2==3.1.2 jsonmerge==1.8.0 jsonschema==4.17.3 kiwisolver==1.4.4 kornia==0.6.7 lark==1.1.2 lazy_loader==0.2 linkify-it-py==2.0.0 llvmlite==0.39.1 lmdb==1.4.0 lpips==0.1.4 lxml==4.9.2 Markdown==3.4.2 markdown-it-py==2.2.0 MarkupSafe==2.1.2 matplotlib==3.7.1 mdit-py-plugins==0.3.5 mdurl==0.1.2 mpmath==1.3.0 multidict==6.0.4 networkx==3.0 numba==0.56.4 numpy==1.23.3 oauthlib==3.2.2 omegaconf==2.2.3 onnx==1.13.1 onnxruntime==1.14.1 open-clip-torch @ git+https://gitee.com/ufhy/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b opencv-contrib-python==4.7.0.72 opencv-python==4.7.0.72 orjson==3.8.8 packaging==23.0 pandas==1.5.3 piexif==1.1.3 Pillow==9.4.0 pipreqs==0.4.11 protobuf==3.20.0 psutil==5.9.4 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycryptodome==3.17 pydantic==1.10.7 pyDeprecate==0.3.2 pydub==0.25.1 pyparsing==3.0.9 pyreadline3==3.4.1 pyrsistent==0.19.3 PySocks==1.7.1 python-dateutil==2.8.2 python-multipart==0.0.6 pytorch-lightning==1.7.6 pytz==2022.7.1 PyWavelets==1.4.1 PyYAML==6.0 realesrgan==0.3.0 regex==2023.3.22 reportlab==3.6.12 requests==2.25.1 requests-oauthlib==1.3.1 resize-right==0.0.2 rfc3986==1.5.0 rsa==4.9 safetensors==0.2.7 scikit-image==0.19.2 scipy==1.10.1 sentencepiece==0.1.97 six==1.16.0 smmap==5.0.0 sniffio==1.3.0 soupsieve==2.4 starlette==0.23.1 svglib==1.5.1 sympy==1.11.1 tb-nightly==2.13.0a20230317 tensorboard==2.12.0 tensorboard-data-server==0.7.0 tensorboard-plugin-wit==1.8.1 tifffile==2023.3.21 timm==0.6.7 tinycss2==1.2.1 tokenizers==0.13.2 toolz==0.12.0 torch==1.13.1+cu117 torchaudio==0.13.1+cu117 torchdiffeq==0.2.3 torchmetrics==0.11.4 torchsde==0.2.5 torchvision==0.14.1+cu117 tqdm==4.65.0 trampoline==0.1.2 transformers==4.25.1 typing_extensions==4.5.0 uc-micro-py==1.0.1 urllib3==1.26.15 uvicorn==0.21.1 wcwidth==0.2.6 webencodings==0.5.1 websockets==10.4 Werkzeug==2.2.3 yapf==0.32.0 yarg==0.1.9 yarl==1.8.2
|
在配置好环境后需要启动launch.py文件
启动时还可以配置参数:如python launch.py –no-half –no-half-vae –disable-nan-check
具体说明可以参见up主的教程和其他资料
下面是几张生成图的示例:
positive tags:
1
| (((masterpiece))),best quality, illustration,(beautiful detailed girl),beautiful detailed glow,detailed ice,beautiful detailed water,(beautiful detailed eyes),expressionless,(floating palaces),azure hair,disheveled hair,long bangs, hairs between eyes,(skyblue dress),black ribbon,white bowties,midriff,{{{half closed eyes}}},big forhead,blank stare,flower,large top sleeves
|
negative tags:
1
| owres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,missing fingers,bad hands,missing arms,large breasts
|