Original link: http://afoo.me/posts/2023-07-05-art-qrcode-with-comfyui.html
Three ways to generate artistic QR codes – Mr. Fuqiang said: the thinking and precipitation of an architect
Three ways to generate artistic QR codes
Wang Fuqiang
What? Have you heard of the artistic QR code? In fact, it is a new form of two-dimensional code that has emerged with the rise of AIGC, especially Stable Diffusion. Like the following, it is not only like a two-dimensional code, but also integrated with the generated picture:
The first method is to directly use SaaS provided by others on the Internet, such as the demo space opened by others on Huggingface, or join the Discord server provided by others.
The second routine is of course our famous Stable Diffusion. However, there are at least two routines for Stable Diffusion:
- img2img + controlnet
- controlnet + controlnet
Now the most used is the second type, that is, two controlnets connected in series, the first one generally uses the brightness control net, which is mainly used to adjust the color or recolor, and the second generally uses the tile controlnet, the purpose is to increase or decrease details , this feature was mentioned in the Stable Diffusion series (5) – Explaining ControlNet in a simple way by Mr. Fuqiang .
By balancing the control weight and range of the two controlnets or one parameter, you can generate a QR code that combines the generated image, but this trial and error process is usually time-consuming, so if you want To play by yourself, it is best to search for the parameter values after other people’s experiments before as a reference, otherwise, trying to make mistakes from the beginning, sometimes it is quite frustrating, for example, here are many defective products (https://keepoints. feishu.cn/docx/ZxMndkpwRoongpxAUcbcUn9xnad), and this is just a good-looking one selected from hundreds of pictures, but it still cannot be scanned successfully. It is necessary to select from the generated results that are both beautiful (creative) and successfully scanned. (recognizable), it is even more difficult.
The third routine is actually a bit reluctant. The reason is that when I use my own script to start and execute the Automatic1111 Stable Diffusion WebUI, the controlnet model of brightness actually reports an error:
Total progress: 100% 20/20 [00:03<00:00, 6.53it/s] 2023-07-05 06:18:14,882 - ControlNet - INFO - Loading model: control_v1p_sd15_brightness [e3b0c442] *** Error running process: /content/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py Traceback (most recent call last): File "/content/stable-diffusion-webui/modules/scripts.py", line 474, in process script.process(p, *script_args) File "/content/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 742, in process model_net = Script.load_control_model(p, unet, unit.model, unit.low_vram) File "/content/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 303, in load_control_model model_net = Script.build_control_model(p, unet, model, lowvram) File "/content/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 331, in build_control_model state_dict = load_state_dict(model_path) File "/content/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/utils.py", line 20, in load_state_dict state_dict = safetensors.torch.load_file(ckpt_path, device=location) File "/usr/local/lib/python3.10/dist-packages/safetensors/torch.py", line 259, in load_file with safe_open(filename, framework="pt", device=device) as f: safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
So I took a detour, started comfyui instead, and then hung up two controlnets to create a batch of artistic QR codes. As for the idea, it was the idea of brightness controlnet plus tile controlnet. After all, As long as you know what it is and why it is, everything you use is just a tool, isn’t it? !
Finally, I would like to make an advertisement. If you are interested in how Stable Diffusion is created, welcome to join the “Crazy for AI” Knowledge Planet and get access to https://edu.afoo.me thousands of minutes of premium content.
On the planet “Crazy for AI”, Mr. Fuqiang is discussing interesting AI topics with his friends. Would you like to come together? ^-^
here
- Not only timely and fresh AI information and in-depth discussions
- Also share AI tools, product approaches and business opportunities
- There are more than 1,000 original paid content (nearly 500 minutes) waiting for you, join the planet (https://t.zsxq.com/0dI3ZA0sL) to get it for free!
Everything is homebrewed with pandoc and Markdown , little Scala also included.
This article is transferred from: http://afoo.me/posts/2023-07-05-art-qrcode-with-comfyui.html
This site is only for collection, and the copyright belongs to the original author.