AI艺术二维码通过添加艺术设计元素,使其在众多二维码中更易于被识别和记忆,提高了个人、品牌或产品的辨识度。艺术二维码可以应用于各种场景,如名片、广告、包装、展览、艺术品等,还可以结合互动技术,如扫码后触发音频、视频、动画等内容,增加用户的参与度和互动体验。
市面上已经出现了很多现成的 AI 生成二维码工具,大家可以去试试。本文基于Stable Diffusion来实现,准备工作包括传统的二维码、Stable Diffusion整合包以及必要的ControlNet模型,用于描述画面的提示词。
获取二维码数据
到草料生成传统的二维码或对已有的二维码解码处理
复制解码结果,对二维码进行简单处理,主要是让它变得比较均匀,看起来没有那么明显的二维码特征。
可以“前往首页生码”生成新的二维码。或着打开https://qrcode.antfu.me/ 将上面的解码复制进去,可以尝试修改左侧各种配置,生成新的二维码,下载下来。
Stable Diffusion+ControlNet生图
拿到二维码后我们接下来要使用AI绘画工具Stable Diffusion来生成二维码画作。安装ControlNet插件并下载4个模型:Tile、Depth、Brightness、Qrcode_monster
注意AI绘图时比较依赖显卡性能,性能越高出图越快。
选择SD模型、输入文生图的正向提示词以及反向提示词、采样方法、迭代步数、图片宽度高度及提示词引导系数。
下面我们需要通过ControlNet插件将之前的二维码特征和图像融合到一起。
首先在ControlNet单元0中上传我们之前制作好的二维码,然后点击启用和完美像素模式。
然后在下面的模型中选择control_v1p_sd15_qrcode_monster、权重设置为1.3左右。这里的权重越高,图像的二维码特征会越明显,权重越低,图像会越自然。适当调整,保证二维码能够被扫描就够了。
然后设置ControlNet单元1,同样上传二维码图片、然后选择control_v1p_sd15_brightness模型,将权重设置在0.2左右,引导范围0.1-0.5即可。
两个ControlNet共同作用,将二维码的特征和图像进行融合,完成上面的配置后就可以进行抽卡了,以能否被识别作为标准,来反复调整参数,无法识别就增大两个ControlNet的权重或引导范围,过于明显就降低这些参数。
各款不同风格的正向提示词
1.花田女孩
1girl,chinese,kawaii,print_dress,smile,absurdres,in summer,flowers meadows,flower sea,flower field,cowboy_shot,dynamic pose,
2.森林女孩
(8k, best quality, masterpiece:1.2),(best quality:1.0), (ultra highres:1.0), watercolor, a beautiful woman, shoulder, hair ribbons, by agnes cecile, full body portrait, extremely luminous bright design, (pastel colors), forest background, modelshoot style, very long hair, intricate, elegant, realism, (hyperrealism), (cinematic), (hyperdetailed:1.2), hdr
3.街道
abstract street street in the city with abstract buildings and cars, in the style of otherworldly visions, gravity-defying landscapes, richly colored skies, hyperrealistic illustrations, psychedelic surrealism, swirling vortexes
4.客厅
masterpiece,bestquality,ultra-detailed,sitting room,8k,extremely delicate and beautiful,highresolution,ray tracing,(realistic, photorealistic:1.37),professional lighting,photon mapping,radiosity,physically-based rendering,wabisabi style
5.办公室
masterpiece,best quality,This image is a high-resolution photograph of a modern,minimalist home office. The room features light beige walls and a light wooden floor,creating a warm and inviting atmosphere. A large window on the left side allows natural light to flood the room,and beige curtains frame the window,providing a touch of softness.,In the left corner of the room,there is a white desk with a minimalist chair. On the desk,there is a closed laptop,a small plant,and a few scattered papers. Above the desk,a black wall-mounted round mirror and a small black shelf holding framed pictures add a personal touch. To the right of the desk,a tall wooden bookshelf is filled with neatly organized white binders,adding a sense of order.,In the foreground,there is a white chair with a modern design,positioned next to a white side table. On the side table,there is a small potted plant and a stack of books. A plush,light beige throw blanket is draped over the arm of the chair,enhancing the cozy feel.,A floor lamp with a sleek,modern design stands near the bookshelf,providing additional light. The room is decorated with a patterned rug featuring earthy tones,adding texture and warmth to the space.,