位置: IT常识 - 正文
推荐整理分享如何部署一个自己的AI绘图(怎样部署),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:怎样部署,如何部署一个自己的文档,怎样部署,怎么部署工作,如何部署一个自己的大语言模型,怎样部署,如何部署一个自己的大语言模型,如何部署一个自己的大语言模型,内容如对您有帮助,希望把文章链接给更多的朋友!
目前AI绘图只支持N卡,显存最少4G,部署的时候一定要注意设备的配置**
1.在windows上部署可以观看b站up:独立研究员-星空的教程 AI绘画 【Stable Diffusion】 NovelAI 整合包 解压即用 AI绘画 【Stable Diffusion】NovelAI整合包 WebUI更新与最新设置 一定要完整做完两个教程,否则有电脑被入侵的风险** ⚠️警惕!你的NovelAI模型,极有可能被恶意攻击! 藏在AI绘画泄露模型背后的,巨大安全隐患!
2.在linux/GPU服务器(ubuntu)上部署参考:官方文档 官方文档中的自动安装会有各种各样的问题,这里建议手动安装
2.1用anaconda管理环境2.1.1 安装anacondawget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.shbash Anaconda3-2022.05-Linux-x86_64.sh2.1.2 创建虚拟环境 conda create --name NovelAI python=3.9.12 # NovelAI为环境名,3.8为python的版本号2.1.3 激活环境conda activate NovelAI2.2安装stable-diffusion-webui依次运行一下代码,如果出现Permission denied,在相应命令前加上sudo
# install torch with CUDA support. See https://pytorch.org/get-started/locally/ for more instructions if this fails.pip install torch --extra-index-url https://download.pytorch.org/whl/cu113# check if torch supports GPU; this must output "True". You need CUDA 11. installed for this. You might be able to use# a different version, but this is what I tested.python -c "import torch; print(torch.cuda.is_available())"# clone web ui and go into its directorygit clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.gitcd stable-diffusion-webui# clone repositories for Stable Diffusion and (optionally) CodeFormermkdir repositoriesgit clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusiongit clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformersgit clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormergit clone https://github.com/salesforce/BLIP.git repositories/BLIP# install requirements of Stable Diffusionpip install transformers==4.19.2 diffusers invisible-watermark --prefer-binary# install k-diffusionpip install git+https://github.com/crowsonkb/k-diffusion.git --prefer-binary# (optional) install GFPGAN (face restoration)pip install git+https://github.com/TencentARC/GFPGAN.git --prefer-binary# (optional) install requirements for CodeFormer (face restoration)pip install -r repositories/CodeFormer/requirements.txt --prefer-binary# install requirements of web uipip install -r requirements.txt --prefer-binary# update numpy to latest versionpip install -U numpy --prefer-binary2.3 模型刚安装完是没有模型的,需要下载模型
2.3.1 模型目录所以模型都放在这个目录下,可以通过sftp上传到该目录下
stable-diffusion-webui\models\Stable-diffusion2.3.2 各种各样的模型下载https://rentry.org/sdmodels2.3.3最近泄露的NovelAI模型链接:https://pan.baidu.com/s/1Mu_ynhBkkWi1Nr1nWl_Xyw?pwd=rs47 提取码:rs47
2.4运行2.4.1 本地运行python webui.py2.4.2 服务器运行本地远程访问python webui.py --listen然后即可通过服务器7860端口访问(记得服务器控制台放行端口)
http://<服务器公网ip>:7860/2.4.3 后台运行nohup python webui.py --listen 2>&1 &更多参数设置
3.在colab上部署如果自己电脑显存不够,又没有GPU服务器的话可以在colab部署,可以免费使用一块T4,只需要一个谷歌账号,而且没有安全风险,缺点就是不稳定,需要魔法 代码:colab一键部署 教程:NovelAI 4chan colab tutorial教學:目前最接近NovelAI官方且免費的版本(需要魔法 )
上一篇:机器视觉系列5:C++部署pytorch模型onnxruntime(机器视觉 machine)
下一篇:PCA降维原理 操作步骤与优缺点(pca降维的原理)
友情链接: 武汉网站建设