【收藏】制作艺术二维码,用 Stable Diffusion 就行!
基于函数计算 FC 快捷部署 Stable Diffusion,自己设计 T 恤自己穿!赢 Airpods 三代,森马周边!
https://developer.aliyun.com/adc/series/activity/aigc_design


用 Stable Diffusion 制作艺术二维码,本文将详细讲解基于函数计算部署 Stable Diffusion 做一个艺术二维码,艺术化的二维码不是单纯的艺术作品,具备可识别的功能性非常重要,因此在生成过程中,需要对参数和二维码进行多次调整以达到最佳状态,希望这篇文章能够帮助您提供一些生成方法,观看文章需要 5 分钟,看完即会赶紧尝试!
资源准备
注册并登录阿里云账号 [ 1]
开通函数计算并领取试用额度 [ 2]
开通文件存储 NAS 服务并领取试用额度 [ 3]
部署云端 Stable Diffusion
选择“AI 数字绘画 stable-diffusion 自定义模版“,点击立即创建,开始创建 Stable Diffusion
https://fcnext.console.aliyun.com/applications/create

创建 Stable Diffusion 需要开通函数计算 FC 和文件存储 NAS,新用户一定领取试用额度

创建 Stable Diffusion WebUI
选择地域 —》选择“绘图类型”(后续可自己换)—》首次部署需要 RAM 角色 APN 授权
其他地方如无特殊要求可以直接默认

确认知晓使用 SD 过程中产生的函数计算费用及重要提醒,等待 Stable Diffusion WebUI 部署成功

更换及管理模型需要进行“初始化模型管理”,注意存储模型开始用到文件存储 NAS 产品

确认了解使用 NAS 的费用和注意事项,确认开始创建模型管理工具——选择“自动配置”——确认

访问 admin 开头的域名,进入模型管理平台

准备大模型
您可以选择喜欢的模型用以生成二维码的风格,本教程推荐模型库中下载 majicMix realistic 模型,模型将会被下载至您的 文件管理(NAS) 中,这会产生一定的文件存储费用请务必注意。下载好后重启 Stable Diffusion 即可使用。
模型库功能由阿里云 OSS 提供,模型/数据集/文件均来源于第三方,不保证合规性,请您在使用前慎重考虑。

准备制作艺术二维码需要的模型
部署的 Stable Diffusion 已经内置了 Controlnet 和常用 ControlNet 插件。
本教程仅仅需要下载需要的 ControlNet 插件即可。
前置准备:调整出多个 ControlNet Unit,方便多个 ControlNet 叠加使用

调整出多个 ControlNet Unit,方便多个 ControlNet 叠加使用

此时可以看到您的页面上已经有了 ControlNet 配置项

下载 qrcode moster 模型
下载地址:https://huggingface.co/monster-labs/control_v1p_sd15_qrcode_monster/tree/main

下载 brightness 模型
下载地址:https://huggingface.co/ioclab/control_v1p_sd15_brightness

上传下载模型后上传在文件夹中 /mnt/auto/sd/models/ControlNet,重新加载 Stable Diffusion 备用

以上步骤如果遇到任何问题可以查看详细文档:
https://developer.aliyun.com/adc/scenario/exp/b2cc0e1c3a6244e0bd9fc0f37acd5a0e?
制作艺术二维码
准备二维码,可以选择草料网:https://cli.im/ ,免费生成二维码,可以根据自己的需要选择二维码美化,让二维码更适合生成图画

进一步美化二维码,可以修改颜色,码点形状,码眼形状,因为二维码不是单纯的图片,具备很强的功能性,制作成艺术二维码需要能够方便识别,建议前期二维码美化使用比较大块的码点形状

添加提示词设置
正向提示词:(((1boy))),((masterpiece)),((best quality)),8k,high detailed,((chinese clothes)),((hanfu)),Fisheyes,masterpiece,top quality,best quality,animation, long hair
反向提示词:(worst quality, low quality:2),NSFW,monochrome,zombie,overexposure,watermark,text,bad anatomy,bad hand,extra hands,extra fingers,too many fingers,fused fingers,bad arm,distorted arm,extra arms,fused arms,extra legs,missing leg,disembodied leg,extra nipples,detached arm,liquid hand,inverted hand,disembodied limb,oversized head,extra body,extra navel,EasyNegative,(hair between eyes)
选择喜欢的模型,我这里选择的是 AWPainting 模型
二维码图片放入 ControlNet 1
启用—All—预处理:None——模型:qrcode monster
以下参数经过测试,您可以根据需要自行调节
Control Weight:1 以上,二维码生成需要精确度,控制比重要比较强
Starting Control Step:0~0.3
Endting Control Step:0.7~0.8

二维码图片放入 ControlNet 2
启用—All—预处理:None——模型:brightness
以下参数经过测试,您可以根据需要自行调节
Control Weight:0.6 左右
Starting Control Step:0~0.3
Endting Control Step:0.4~0.7

点击生成,可以看到生成的图像面部有问题

点击局部绘制,进行脸部修饰,小面积修饰不会影响识别

如果你的二维码无法识别……
Control Weight 和 Endting Control Step 这两个参数在生成二维码时非常重要。如果你的二维码无法被扫描,那么你需要调整这两个参数。当 Control Weight 越高时,二维码会更加明显,但是如果 Control Weight 太低,可能会导致扫描不出来。Endting Control Step 代表着 AI 在渲染过程中停止的时间,如果你的图层渲染有 10 层,那么当你选择 0.8 的终止时机时,代表着围绕二维码的渲染在第 8 层结束,剩下的 2 层 AI 会自由发挥。这就是为什么有些艺术二维码生成出来并不像二维码的原因。
每个人的二维码都是不同的,调整一个兼顾好看和实用的艺术二维码其实是一个细致活儿,希望大家都能做出好看的二维码!
阿里云 X 森马 AIGC T 恤设计大赛
阿里云携手国民服装品牌森马推出 AIGC T 恤设计大赛,无论您是开发者、设计师、还是 AI 绘画爱好者,都可以使用阿里云函数计算快速部署 Stable Diffusion,以“宇宙漫游”为主题,进行 AI 创作并投递作品即可参赛。所有作品均有机会被森马选中并购买版权成为下一季服装图案主题。
通过函数计算 FC 快捷部署 Stable Diffusion:内置模型库+常用插件+ControlNet,支持 SDXL1.0
立即参赛:https://developer.aliyun.com/adc/series/activity/aigc_design
可获得奖品:Apple Airpods、作品定制阿里云 X 森马联名 T 恤、森马定制旅行箱、森马无门槛代金券等丰厚奖励
活动时间:8 月 21 日-9 月 21 日
相关链接:
[1] 注册并登录阿里云账号
[2] 开通函数计算并领取试用额度
https://free.aliyun.com/?pipCode=fc&spm=5176.137990.J_5253785160.5.36551608plfTh6
[3] 开通文件存储 NAS 服务并领取试用额度
评论