stable diffusion webui 搭建和初步使用

官方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

  • 15
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Stable Diffusion WebUI是一种用于管理CodePlex常见操作的网络用户界面(WebUI),这意味着您不需要登录到服务器上的命令行界面来管理项目。安装过程并不复杂,但需要一些基本的技术知识。下面是安装过程的一些步骤: 首先,确保您的服务器已安装一个数据库管理系统。Stable Diffusion WebUI支持MSSQL Server、MySQL和SQLite等数据库系统,您可以根据自己的需要选择。然后,您需要在服务器上安装.NET框架,因为Stable Diffusion WebUI是一个基于.NET开发的应用程序。您可以在微软官网上下载适合您的版本。 接下来,您需要下载最新版本的Stable Diffusion WebUI。您可以从官方网站或GitHub页面上找到下载链接。将安装包下载到服务器上的任何目录中,然后解压缩它。安装包中包含了一些必要的文件和文件夹,包括安装向导(Install.bat)、WebUI配置文件(StableDiffusion.config)和WebUI启动程序(WebUI.exe)。 在使用安装向导之前,您需要进一步配置您的数据库。因此,您需要使用数据库管理系统(如MSSQL Server Management Studio)创建一个新的Database,并确保您对其具有足够的权限。然后,将您的数据库连接字符串添加到StableDiffusion.config文件中,并更改一些其他设置,例如端口号和SSL证书等。您还需要指定用于启动WebUi的帐户和密码。 一旦您完成了这些准备工作,就可以启动安装向导了。双击Install.bat脚本文件,它会自动安装Stable Diffusion WebUI,并将相关的文件复制到服务器上的指定目录中。安装程序还可以安装.NET框架和其他必要的组件(如IIS和ASP.NET)。 最后,您可以尝试连接到WebUI界面并登录到您的CodePlex项目。在您经过手动或自动设置后,您可以使用Stable Diffusion WebUI的各种功能来管理代码版本控制、问题跟踪、建立代码合并请求等等。它非常方便、强大,是一个非常受欢迎的开源项目管理工具。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值