stable diffusion webui 搭建和初步使用

news/2024/7/10 22:04:55 标签: stable diffusion

官方repo: GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI

关于stable-diffusion的介绍:Stable Diffusion|图解稳定扩散原理 - 知乎

一、环境搭建和启动

准备在容器里面搞一下

ubuntu22.04 为基础镜像,新建/code, /dataset目录,添加非root用户auser并添加到sudo(webui.sh要以非root用户执行)

mkdir /sd
chmod -R 777 /sd
useradd auser
passwd auser
usermod -aG sudo auser
mkdir -p /home/auser
chmod -R 777 /home
# 安装sudo
apt-get update
apt-get install sudo

commit 上述container为一个新镜像

用以上述新镜像起container,把webui.sh, weibui-user.sh下载到/sd挂在的地方并给与+x权限, 进入docker后:

sudo apt update
sudo apt install libgoogle-perftools4 libtcmalloc-minimal4
sudo apt install wget git python3 python3-venv libgl1 libglib2.0-0
sudo apt install bc

# 添加国内pip源(比如中科大源)
mkdir -p ~/.pip
echo "[global]" > ~/.pip/pip.conf
echo "index-url = https://pypi.mirrors.ustc.edu.cn/simple/" >> ~/.pip/pip.conf

# automatic intall
./webui.sh

# 安装xformer,安装之前需要看下 torch 的版本,2.1.2对应:
pip install xformers==0.0.23.post1

# Can‘t load tokenizer for ‘openai/clip-vit-large-patch14‘ 参考:
# https://cloud.baidu.com/qianfandev/topic/268119

启动:

# docker内启动
cd /sd/stable-diffusion-webui
source ./venv/bin/activate
python webui.py --xformers

二、初步体验

这次用了sd_xl_base_1.0.safetensors,使用下来觉得小场景不错,大场景一般,用LoRA效果很好,但是AI还是不能画Ai自己(prompt 2)

1024x1024的分辨率显存占用大概11.5GB。

很多模型可去hugging face上搜,text-to-image 标签, 国内也有 hf 的镜像 ByteDance/SDXL-Lightning at main

1. prompt: In a sunny morning, at a busy road cross, peoples are waiting for the green light. a car is breaking to avoid impacting a cyclist.

2. prompt: A diagram of a ViT commonly used in computer vision.

3. prompt: A busy 21-century candy factory. Trucks are waiting at the gate. It's going to raining, so lots of workers are try their best to cover the raw materials. The boss of the factory is on a meeting with some important guests behind the office window. There're also some students visitors.

4. 是否使用LoRA对比, 使用LoRA参考:Yangdf/mini-mecha-sdxl-lora · HF Mirror

prompt: A dynamic scene of two mecha battle in the air, one is flying and shooting blue energy beam to another which standing on building roof, unreal engine 5 with epic cinematography, in an industrial snow covered planet with green grass

with lora prompt: mini-mecha-sdxl-lora_emb,lora:mini-mecha-sdxl-lora:1>, A dynamic scene of two mecha battle in the air, one is flying and shooting blue energy beam to another which standing on building roof, unreal engine 5 with epic cinematography, in an industrial snow covered planet with green grass


http://www.niftyadmin.cn/n/5435085.html

相关文章

论文阅读——RSGPT

RSGPT: A Remote Sensing Vision Language Model and Benchmark 贡献:构建了一个高质量的遥感图像描述数据集(RSICap)和一个名为RSIEval的基准评估数据集,并在新创建的RSICap数据集上开发了基于微调InstructBLIP的遥感生成预训练…

解决谷歌浏览器最新chrome94版本CORS跨域问题

项目场景: 谷歌浏览器升级到chrome94版本出现CORS跨域问题 问题描述 解决谷歌浏览器最新chrome94版本CORS跨域问题。 CORS跨域问题: 升级谷歌浏览器最新chrome94版本后,提示Access to XMLHttpRequest at ‘http://localhost:xxxx/api’ fro…

用尾插的思想实现移除链表中的元素

目录 一、介绍尾插 1.链表为空 2.链表不为空 二、题目介绍 三、思路 四、代码 五、代码解析 1. 2. 3. 4. 5. 6. 六、注意点 1. 2. 一、介绍尾插 整体思路为 1.链表为空 void SLPushBack(SLTNode** pphead, SLTDataType x) {SLTNode* newnode BuyLTNode(x); …

AI:149-法律电子邮件图像中的欺诈检测与敲诈勒索追踪—深度学习技术

🚀点击这里跳转到本专栏,可查阅专栏顶置最新的指南宝典~ 🎉🎊🎉 你的技术旅程将在这里启航! 从基础到实践,深入学习。无论你是初学者还是经验丰富的老手,对于本专栏案例和项目实践都有参考学习意义。 ✨✨✨ 每一个案例都附带关键代码,详细讲解供大家学习,希望…

【开源】SpringBoot框架开发二手车交易系统

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块2.1 数据中心模块2.2 二手车档案管理模块2.3 车辆预约管理模块2.4 车辆预定管理模块2.5 车辆留言板管理模块2.6 车辆资讯管理模块 三、系统设计3.1 E-R图设计3.2 可行性分析3.2.1 技术可行性分析3.2.2 操作可行性3.2.3 经济…

计算机设计大赛 题目:基于深度学习卷积神经网络的花卉识别 - 深度学习 机器视觉

文章目录 0 前言1 项目背景2 花卉识别的基本原理3 算法实现3.1 预处理3.2 特征提取和选择3.3 分类器设计和决策3.4 卷积神经网络基本原理 4 算法实现4.1 花卉图像数据4.2 模块组成 5 项目执行结果6 最后 0 前言 🔥 优质竞赛项目系列,今天要分享的是 基…

C++/CLI学习笔记5(快速打通c++与c#相互调用的桥梁)

3.6 句柄与指针 在标准C中,指针容纳的是另一个变量或函数的内存地址。这意味着可用指针间接引用变量。 但在C/CLI中,是“运行时”帮你管理内存,所以它保留了将内存里的东西移来移去以最大化可用内存的权利。这意味着对象可能不老是呆在一个位…

怎样合理规划游戏的玩法、关卡结构及剧情线?

规划游戏的玩法、关卡结构和剧情线是游戏设计的核心环节,以下是一些合理规划的方法: 玩法规划: 核心玩法确定: 首先明确游戏的核心机制或玩法(例如:动作战斗、解谜探索、角色扮演等)&#xff0…