Exploring the production process of high-definition artistic QR codes-AI painting Wenshengtu

I saw a few high-quality QR codes a few days ago, and then I made them myself to show you the effect (platform restrictions, mosaics have been added):

1. Vincentian Picture (Lion):

 

2. Vincentian map (city):

 

The following will start to introduce how to do it. If you are interested, you can continue reading.

The AI ​​drawing tool used here is Stable Diffusion. Students who don’t have one need to deploy one. It is recommended to use AutoDL as a computing platform in China. Foreign countries can use Kaggle’s computing power for free. I have used both of them. There are already many tutorials on the Internet about how to deploy, so I won’t go into details here. If you want me to write another deployment instructions, please leave a message in the comment area. If there are more people, you can consider it.

There are two ways to generate artistic QR codes:

One is to directly use prompt words, that is, Vincent pictures. The QR code produced in this way is more beautiful, but the details are difficult to control.

The second is to use drawings to reproduce the composition or posture of existing pictures. This makes it easier to control the details, but the images are not so beautiful.

Since there is quite a lot of content, this article will first talk about Wen-shengtu, and then there will be another article on Wen-shengtu.

Vincentian picture

The model used in the Wensheng diagram here is: revAnimated. You can download it from huggingface. Reference address: https://huggingface.co/hanafuusen2001/ReVAnimated/tree/main

1. Let’s take generating a lion QR code as an example. The prompt words given here are all about generating a lion, and the QR code part is at the back.

提示词:Full Photo shot of a lion, Yoji Shinkawa style, Jean-baptiste Monge, general plan, central composition, entirely on a sheet, Ink painting, expressive painting, watercolor, bold brushstrokes, Concept art, orange, (purple:1.2), gray and white, stylize, intricate detail, 8k, transparent background, (white background:1.4), 3D vector
反向提示词: Watermark, Text, censored, deformed, bad anatomy, disfigured

2. First, let’s look at the main parameters:

  • Sampler: DPM++ 2M Karras
  • Number of sampling steps: 30
  • Resolution 768 x 768
  • Prompt word guidance coefficient: 11

3. Then we add two ControlNets to control the processing of the QR code part. Both ControlNets need to upload the QR code to be synthesized.

(1) Let’s first look at the configuration of the first ControlNet, which mainly integrates the black and white contrast of the QR code into the image.

Pay attention to several parameters set here:

  • Control Type:All
  • Preprocessor: inpaint_global_harmonious
  • ControlNet model: control_v1p_sd15_brightness
  • Control weight: 0.35. If the image is too gray, try increasing this weight.

(2) Let’s look at the configuration of the second ControlNet, which is mainly to restore the details of the QR code and make it easier to scan out the QR code.

Pay attention to several parameters set here:

  • Control Type:All
  • Preprocessor: inpaint_global_harmonious
  • ControlNet model: control_v11f1e_sd15_tile
  • Control weight: 0.5. If it is not easy to sweep out, you can increase this parameter.
  • Starting Control Step: When to start intervention? The earlier you intervene, the easier it will be to identify the QR code.
  • Ending Control Step: When to end the intervention. The later you exit, the easier it is to recognize the QR code.

4. Finally, click Generate (due to platform limitations, mosaic has been added).


 

If the generated image is not beautiful or cannot be scanned, you can try adjusting various parameters of ControlNet.

ControlNet

1. What is ControlNet?

If we only use prompt words, we cannot accurately control the details of the image, such as how high people raise their hands; or we just want to copy the face in the picture, and other parts can be used freely; or we need a QR code here The base map of the QR code must be scanned and cannot be generated randomly.

To sum up, ControlNet allows designers to copy the composition of reference pictures or the posture of the human body.

2. Relevant parameters

Preprocessor: Extract features of the reference image. Different preprocessors will extract different features.

Model: Implement different image generation controls, such as human posture, line control, image depth, color scheme, etc.

Weight: The larger the value, the more the generated image follows the reference image, and vice versa.

Number of starting/ending control steps: The number of starting and ending sampling steps for ControlNet intervention image drawing. The value range is 0-1, which is a percentage.

For the QR code example, you can adjust the weight and start steps to control the image display effect and QR code recognition rate.

other

In addition, the test found that bright colors, 2.5D or 3D models have better effects. For example, I tried the "Guofeng 3" model and felt that the picture rendering effect was okay. If you are interested, you can try it.


The above is the main content of this article. I will continue to share things about AI applications in the future. If you are interested, please follow me in time (WeChat public account: Yinghuowu AI) to avoid missing exciting content.

Guess you like

Origin blog.csdn.net/bossma/article/details/131540803