经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 大数据/云/AI » 人工智能基础 » 查看文章
如何使用Stable Diffusion生成艺术二维码? - Cyber-Cynic
来源:cnblogs  作者:Cyber-Cynic  时间:2023/6/14 11:09:45  对本文有异议

硬件准备

物理内存:至少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

  1. 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:
  1. 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:

  1. 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_v11f1e_sd15_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/
https://www.youtube.com/watch?v=XRNQKjhEcyc

原文链接:https://www.cnblogs.com/talentzemin/p/17477282.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号