如何使用Stable Diffusion生成艺术二维码?

2023/6/13 18:23:41

本文主要是介绍如何使用Stable Diffusion生成艺术二维码?,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

硬件准备

物理内存:至少16G(8G直接安装阶段就卡死)
N卡:此处我使用GTX 1660 6G (2019年双12购买)

操作系统

windows 11

软件准备

网络要通畅
git: https://git-scm.com/download/win
Python: https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe
CUDA驱动:https://developer.nvidia.com/cuda-toolkit-archive

如何查看下载哪个版本的CUDA驱动?

安装stable_diffusion_webUI

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

下载模型

https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt
https://civitai.com/models/6424/chilloutmix
https://civitai.com/models/36520/ghostmix

下载完成后,放在 stable-diffusion-webui\models\Stable-diffusion 目录下

修改启动配置

stable-diffusion-webui\webui-user.bat

set COMMANDLINE_ARGS=--lowvram --precision full --no-half --disable-nan-check

启动

运行 stable-diffusion-webui\webui.bat

第一次启动会非常的耗时,因为要下载N多依赖的东西。出现错误肯定是网络问题。

启动成功,使用浏览器访问http://127.0.0.1:7860/就能看到UI页面

为stable-diffusion-webui 添加 ControlNet 支持

  1. 在此处填写:https://github.com/Mikubill/sd-webui-controlnet

  2. 点击install进行安装

  3. 重启UI

  4. 安装模型
    https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main

    下载后放在:stable-diffusion-webui\extensions\sd-webui-controlnet\models

生成普通二维码

我们使用该网站生成二维码:https://34qr.com/en/


使用stable_diffusion_webUI生成艺术二维码

  1. 选择img2img
  2. 选择模型,选择GhostMix
  3. 填写prompt
    prompt:
a cubism painting of a town with a lot of houses in the snow with a sky background, Andreas Rocha, matte painting concept art, a detailed matte painting

negative prompt:

ugly, disfigured, low quality, blurry, nsfw
  1. 上传二维码

  2. 配置
    Resize mode: Just resize
    Sampling method: DPM++2M Karras
    Sampling step: 50
    Width: 768
    Height: 768
    CFG Scale: 7
    Denoising strength: 0.75

  3. ControlNet中上传二维码

  4. 配置
    Enable: Yes
    Control Type: Tile
    Preprocessor: tile_resample
    Model: control_xxx_tile
    Control Weight: 0.87
    Starting Control Step: 0.23
    Ending Control Step: 0.9

  5. 点击生成

这是完整的配置

效果图

Ref

https://zhuanlan.zhihu.com/p/617997179
https://stable-diffusion-art.com/qr-code/
https://www.kombitz.com/2023/02/18/how-to-use-controlnet-with-automatic1111-stable-diffusion-web-ui/



这篇关于如何使用Stable Diffusion生成艺术二维码?的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程