CentOs7 + Stable Diffusion + Novel AI实现AI绘画

article/2023/9/24 17:37:36

前提条件

  • GPU服务器
  • 含有NVIDIA显卡
  • 安装Git环境(版本 >= 1.8.5)
    查看版本:git version
    升级git:yum install -y https://repo.ius.io/ius-release-el7.rpm && yum install -y epel-release && yum erase -y git* && yum install -y git-core

开始搭建

1. 安装python3及依赖环境

参考:centOs7安装Python3

2. 下载源码

cd /data && git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

3. 安装依赖(预计5小时+)

可能存在部分超时问题,重试即可

cd stable-diffusion-webui && python3 -m pip install --upgrade pip && \
pip3 install --upgrade setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install -r requirements_versions.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install open_clip_torch -i https://pypi.tuna.tsinghua.edu.cn/simple

以下若下载超时可手动本地下载后上传至服务器指定位置即可

git clone https://github.com/Stability-AI/stablediffusion.git /data/stable-diffusion-webui/repositories/stable-diffusion-stability-ai
wget -P /data/stable-diffusion-webui/models/Stable-diffusion https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors

4. 运行

运行并绑定自定义端口:6006

python3 launch.py --no-half --no-half-vae --disable-nan-check --listen --port 6006

模型下载网址:https://civitai.com/
可根据自己喜好下载模型风格进行绘画,即可绘画出同类型图片


5. 导入Novel AI模型

Novel AI 种子:magnet:?xt=urn:btih:5bde442da86265b670a3e5ea3163afad2c6f8ecc
整个内容很大,有52G,只需下载stableckpt目录下的animefull-final-pruned文件夹以及animevae.pt文件

将下载的文件重命名

animevae.pt >> nai.vae.pt
config.yaml >> nai.yaml
model.ckpt>> nai.ckpt

把改名后的三个文件放到/stable-diffusion-webui/models/Stable-diffusion目录下,重启Stable Diffusion后左上角选择nai模型

开启API调用(非必须)

开启此功能后供其他应用程序通过api接口的方式调用功能
启动时增加参数:--nowebui 开启API功能

python3 launch.py --no-half --no-half-vae --disable-nan-check --nowebui --listen --port 6006

api文档地址:http://127.0.0.1:6006/docs


http://www.ngui.cc/article/show-1007634.html

相关文章

SpringCloud:SpringAMQP介绍

Spring AMQP是基于RabbitMQ封装的一套模板,并且还利用SpringBoot对其实现了自动装配,使用起来非常方便。Spring AMQP官方地址 Spring AMQP提供了三个功能: 自动声明队列、交换机及其绑定关系基于注解的监听器模式,异步接收消息封…

【致敬未来的攻城狮计划】连续打卡第4天+物联网操作系统概述

开启攻城狮的成长之旅!这是我参与的由 CSDN博客专家 架构师李肯(http://yyds.recan-li.cn)和 瑞萨MCU (https://www.renesas.cn/cn/zh) 联合发起的「 致敬未来的攻城狮计划 」的第 4 天,点击查看活动计划详…

hastcat

hashcat 下载地址: https://hashcat.net/hashcat/ 案例 Usage: hashcat [options]... hash|hashfile|hccapxfile [dictionary|mask|directory]...https://xz.aliyun.com/t/4008破解linux shadow /etc/shadow中密码格式: $id$salt$encrypted如:$1$2eWq10AC$NaQqalCk3 1表…

ssm+vue在线课程培训系统java

在线培训系统的需求和管理上的不断提升,在线培训系统的潜力将无限扩大,在线培训系统在业界被广泛关注,本网站及对此进行总体分析,将在线培训系统信息管理的发展提供学校的管理帮助更大。 根据现有的模块,除管理员对系统…

docker安装Redis高可用(一主二从三哨兵)

本次教程使用docker swarm安装 准备三台机器 hostIP用途node1192.168.31.130redis-master01,redis哨兵节点01node2192.168.31.131redis-slave01, redis哨兵节点02node3192.168.31.132redis-slave02 redis哨兵节点02 注意事项: 1:需要保证三…

(数字图像处理MATLAB+Python)第二章数字图像处理基础-第二节:色度学基础与颜色模型

文章目录一:颜色匹配二:CIE 1931-RGB系统三:CIE 1931标准色度系统四:CIE 1976Lab均匀颜色空间五:孟塞尔表色系统(1)孟塞尔明度(Value,记为V)(2)孟塞尔彩度(Ch…

Linq使用where sql in (...)

List<int?> 机构编号数组 new List<int?>();var begin new DateTime(year, 1, 1);var end begin.AddYears(1);IQueryable<DtoReport健康体检表> Q_健康体检表 es.jktjEntitys.Where(m > m.体检日期 > begin && m.体检日期 < end).Whe…

linux 产生随机数 并遍历

1、产生随机数 varRANDOMvarRANDOM varRANDOMvar[ $var % 150 ] 2、产生不重复的随机数 $ entries($(shuf -i 0-149 -n 15)) $ echo “${entries[]}” 3、对随机数排序 $ entries($(shuf -i 0-149 -n 15 | sort -n)) $ echo “entries[]"12224549546678798393118119124140…

Vue的:key用法及示例

在 Vue 中&#xff0c;使用 v-for 指令循环遍历数组或对象时&#xff0c;每个子元素都需要绑定一个唯一的 key 值&#xff0c;用于标识这个子元素。我们可以使用 :key 属性来绑定这个 key 值。例如&#xff1a; <div v-for"item in itemList" :key"item.id&…

开发过程中遇到的关于flask的相关问题(flask入门教程,flask CORS跨域访问、base64解码为图像、PIL、CV2和bytes之间格式转换)

1、flask入门上手教程 我主要目的是快速开发&#xff0c;因此学习flask是随便找的一个教程跟着做了下&#xff0c;而没有系统地学习&#xff0c;大概差不多了就去按自己需求进行开发了。 以下是我跟的一个简单教程&#xff0c;讲述了如何快速部署一个简单的python服务器&…