安装流程:
-
下载stable-diffusion源码
<https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.2.1>
-
安装python
<https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe>
-
添加host
-
打开C:\Windows\System32\drivers\etc\host
-
添加
199.232.69.194 github.global-ssl.fastly.net 140.82.112.3 github.com
-
-
修改launch.py
将所有 <https://github.com> 替换成 <https://ghproxy.com/https://github.com>
-
运行stable-diffusion-webui-1.2.1目录下webui-user.bat
安装时长较长,耐心等待
-
安装成功日志,主要是出现了地址“http://127.0.0.1:7860”
venv "G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\venv\\Scripts\\Python.exe" Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: <none> Commit hash: <none> Cloning Stable Diffusion into G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\repositories\\stable-diffusion-stability-ai... Cloning Taming Transformers into G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\repositories\\taming-transformers... Cloning K-diffusion into G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\repositories\\k-diffusion... Cloning CodeFormer into G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\repositories\\CodeFormer... Cloning BLIP into G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\repositories\\BLIP... Installing requirements for CodeFormer Installing requirements Launching Web UI with arguments: No module 'xformers'. Proceeding without it. Downloading: "<https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors>" to G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\models\\Stable-diffusion\\v1-5-pruned-emaonly.safetensors 100%|█████████████████████████████████████████████████████████████████████████████| 3.97G/3.97G [15:04<00:00, 4.72MB/s] Calculating sha256 for G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\models\\Stable-diffusion\\v1-5-pruned-emaonly.safetensors: Running on local URL: <http://127.0.0.1:7860> To create a public link, set `share=True` in `launch()`. Startup time: 922.7s (import torch: 1.5s, import gradio: 1.5s, import ldm: 0.5s, other imports: 1.1s, list SD models: 916.2s, load scripts: 1.3s, create ui: 0.4s). 6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa Loading weights [6ce0161689] from G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\models\\Stable-diffusion\\v1-5-pruned-emaonly.safetensors Creating model from config: G:\\funny\\stable_diffusion\\tmp\\stable-diffusion-webui-1.2.1\\configs\\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Downloading (…)olve/main/vocab.json: 100%|███████████████████████████████████████████| 961k/961k [00:02<00:00, 428kB/s] Downloading (…)olve/main/merges.txt: 100%|███████████████████████████████████████████| 525k/525k [00:00<00:00, 788kB/s] Downloading (…)cial_tokens_map.json: 100%|████████████████████████████████████████████████████| 389/389 [00:00<?, ?B/s] Downloading (…)okenizer_config.json: 100%|████████████████████████████████████████████████████| 905/905 [00:00<?, ?B/s] Downloading (…)lve/main/config.json: 100%|████████████████████████████████████████████████| 4.52k/4.52k [00:00<?, ?B/s] Applying cross attention optimization (Doggettx). Textual inversion embeddings loaded(0): Model loaded in 17.2s (calculate hash: 3.5s, load weights from disk: 0.2s, create model: 9.0s, apply weights to model: 1.5s, apply half(): 1.0s, move model to device: 0.5s, load textual inversion embeddings: 1.3s).
-
打开chrome,输入http://127.0.0.1:7860
注意事项
- python版本要为3.10.6版本,不然会出现奇怪报错
- 主要解决的问题就是github下载一些开源工程会超时,只要按照教程修改host和lanch.py就能解决