本想在 Google Colab 上,连接本地运行时(本地安装的 Jupyter Notebook 服务器),<br>执行 ipynb 文件 进行部署,但似乎其依赖 Google Colab 云环境,所以没有成功。<br>(这里只是记录一下 Google Colab 连接本地运行时 的过程)。<br>
0、安装 Python 3.10.x
注意直接勾选 添加环境变量,否则还要手动添加
1、在 Google Colab 上,连接本地运行时,弹出确认框,先阅读其中内容
2. 按照 <u>这些说明 </u>创建本地连接
https://research.google.com/colaboratory/local-runtimes.html
3、按照此说明安装 Jupyter
http://jupyter.org/install
注意,其中包含 Jupyter Lab、Jupyter Notebook 和 Voila
需要了解,JupyterLab 是包括了 Notebook 的下一代用户界面
4、安装并启用 jupyter_http_over_ws jupyter 扩展程序(一次性)(cmd 中输入下方两个命令)
pip install jupyter_http_over_ws
jupyter serverextension enable --py jupyter_http_over_ws
5、启动服务器并进行身份验证(cmd 中输入下方命令)
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0
此时的 cmd 窗口中会出现一个地址:http://localhost:8888/?token=0743557fcc3f7495b05c668dee4df713238415c6e848e68c
6、在弹出确认框中输入该地址,并点击连接按钮,完成连接
7、运行 笔记本文件(一堆报错。。放弃)
基于 Stable Diffusion<br>
sygil-webui
https://github.com/Sygil-Dev/sygil-webui
根据其文档进行部署
https://sygil-dev.github.io/sygil-webui/docs/Installation/one-click-installer
stable-diffusion-webui
https://github.com/AUTOMATIC1111/stable-diffusion-webui
按照其 ReadMe 及 wiki 中所述进行部署
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/
(常见错误)https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Troubleshooting
0、确保满足所需的依赖项,并遵循 NVidia (推荐) 和 AMD gpu可用的说明。
1、安装 Python 3.10.6,并勾选 "Add Python to Path"
2、下载 stable-diffusion-webui 到本地
可以用 git 下载 或 直接 Download Zip后解压
3、将 model.ckpt(模型文件)放到 stable-diffusion-webui/models/Stable-diffusion/ 目录下
4、(可选)将 GFPGANv1.4.pth 放到 stable-diffusion-webui/ 下
5、运行 webui-user.bat
注意,Python版本必须是 3.10.6,否则会各种报错。(wiki中也说了,不要用其他版本,除非你自找麻烦)
注意,在每个 Installing xxx、Cloning xxx 处都可能会等待很久,因为下载、拷贝需要时间,有的较大,保持网络良好并耐心等待即可
报错:Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check<br>(我只是个核显,为了先走通安装流程)编辑 webui-user.bat,修改 set COMMANDLINE_ARGS=--skip-torch-cuda-test<br>
警告:Launching Web UI with arguments:<br>Warning: caught exception 'Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx', memory monitor disabled<br>No module 'xformers'. Proceeding without it.<br>LatentDiffusion: Running in eps-prediction mode<br>DiffusionWrapper has 859.52 M params.<br>(还是显卡的问题,忽略)
6、在浏览器中打开 cmd 窗口中显示的地址使用
http://127.0.0.1:7860/
7、运行错误
报错:RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'<br>(还是显卡问题)编辑 webui-user.bat,在 COMMANDLINE_ARGS 中增加参数 --precision full --no-half