AI Painting Stable Diffusion Research (10) Detailed Explanation of sd Map Generating Functions - Production of Exquisite QR Codes


Disclaimer:
The installation package used in this case is provided free of charge without any profit purpose.

Hello everyone, I am rain or shine.


In order to let everyone understand the function of generating graphs more intuitively, understand what the function of generating graphs does, and what can it do? Today we continue to introduce the practical case of Tushengtu - the production of exquisite QR codes.


For new friends, if you want to learn more about Stable Diffusion, please check out previous articles:

AI Painting Stable Diffusion Research (1) sd Integration Package v4.2 Version Installation Instructions
AI Painting Stable Diffusion Research (2) sd Model ControlNet1.1 Introduction and Installation
AI Painting Stable Diffusion Research (3) sd Model Types Introduction and Detailed Installation and Use
AI Painting Stable Diffusion Research (4) Detailed Explanation of sd Wensheng Diagram Function (Part 1)
AI Painting Stable Diffusion Research (5) Detailed Explanation of sd Wensheng Diagram Function (Part 2)
AI Painting Stable Diffusion Research (6) sd Prompt Word Plug-in
AI Painting Stable Diffusion Research (7) ) One article to understand the working principle of Stable Diffusion
AI painting Stable Diffusion research (8) Detailed explanation of sd sampling method
AI painting Stable Diffusion research (9) Detailed explanation of sd map generation function - HD repair and zoom in of old photos


The old rules, here are still explained in the way of case interspersed with knowledge points.


Dear friends, you can follow my steps while doing practical operations and learning theoretical knowledge at the same time, which can improve learning efficiency.


Exquisite two-dimensional code production case


Recently, I found that many friends have artistically turned the QR code into a very beautiful picture, and the effect is good. After all, the application of the QR code is too wide now, and most of the QR codes are piled up. Small black spots, no beauty at all.


insert image description here


So, how to make these QR codes?

That is to use the function of Stable Diffusion to generate a picture, and cooperate with the Brightness model of ControlNet to generate a fusion picture effect.

Brightness is a special model, it is not the official ControlNet model.


The following are the detailed production steps.


If you haven't installed ControlNet's Brightness model, please go to download and install it. Friends who have already installed it, please ignore it.


1. Download and install the Brightness model

(1), Brightness model download

https://huggingface.co/ioclab/control_v1p_sd15_brightness/tree/main

As shown below:

Open the download address and click to download the diffusion_pytorch_model.safetensors file.


insert image description here

If the above site is slow to download, you can also download control_v1p_sd15_brightness for free here .


(2) Rename the downloaded model file to: control_v1p_sd15_brightness.safetensors

Put it in the models\ControlNet directory

\sd-webui-aki-v4.2\models\ControlNet\control_v1p_sd15_brightness.safetensors

As shown in the picture:

insert image description here


2. Prepare your QR code


The QR code requires that there is no icon in the middle, and it needs to be a pure QR code, otherwise it will affect the quality of the image generated later.

If you cannot obtain pure QR codes, you can use tools such as Linkmap , QR Code or other QR codes to generate pure QR codes.


3. Setting supports at least 2 or more controlnet windows


In Settings -> controlnet, set the number of controlnet models no less than 2.

For example, 4. After the setting is completed, you need to click the "Save Settings" button on the top, and then click the "Reload Front End" button to reload the interface.


insert image description here


4. Parameter setting of graph generation graph


(1), import pictures


insert image description here


(2), Reverse prompt word


The function introduction of the map-generated map reverse deduction prompt words:

Reverse prompt is a function of the Stable diffusion graph. The basic logic of the graph is to use the uploaded image to generate a similar-style image based on the selected Stable diffusion model. .


insert image description here


  • CLIP pushback

CLIP deduces the prompt words based on the pictures uploaded in the graph and uses natural language to describe and display them. The reverse push speed of clip is relatively slow.

  • DeepBoru reverse push

DeepBooru reverses the prompt words, which are displayed in the form of keywords based on the pictures uploaded in the graph. DeepBooru inversion is faster and more professional.


Therefore, here we choose to use DeepBooru to deduce the prompt words.


insert image description here


Then fill in the fixed reverse prompt:

NSFW, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality,(monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, (ugly:1.331),duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:l.331), mutated hands, (poorly drawnands:1.5), blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331),missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051),unclear eyes:1.331), lowers, bad hands, missing fingers, extra digit,bad hands, missing fingers.((extra arms and legs)))

insert image description here


(3), set parameters

  • Set scaling mode: resize only

  • Set the number of iteration steps: 28

  • Select sampling method: dpm++ sde karras

  • Tick ​​the Facial Restoration

  • Set the redrawing size: click the lower triangle to automatically obtain the original image size

  • Return range, prompt word default


As shown in the picture:

insert image description here


5. ControlNet plug-in settings


(1) Import the prepared QR code into the ControlNet image area

insert image description here


(2), check enable, select the default control type


insert image description here


(3), set the first ControlNet


  • Preprocessing option: inpaint_global_harmonious
  • Model selection: control_v1p_sd15_brightness
  • Control weight setting: 0.3, others keep default

insert image description here



(4), set the second controlnet


  • Preprocessing option: inpaint_global_harmonious

  • Model selection: control_v11file_sd15_title

  • Control weight setting: 0.5, start step setting 0.35, end step setting 0.75


insert image description here


After ControlNet is set up, you will find that 2unit is displayed on the back, and the two ControlNet windows below both turn green, indicating that both ControlNets are enabled.


insert image description here


6. Generate and debug parameters


Click the Generate button to see the effect.


When it is found that the traces of the QR code are relatively deep, while the traces of the image are relatively shallow, moderately reduce the weight of the first controlnet

The recommended debugging range is between 0.2-0.4 (the debugging interval is 0.05)


When it is found that the two-dimensional code and the image are well integrated, but the information of the two-dimensional code cannot be scanned, you can moderately increase the parameters of the second controlnet

It is recommended that the debugging range be above 0.5 (the debugging interval is 0.05)


7. Finally, the two-dimensional code and the image are basically integrated into an artistic two-dimensional code


As shown in the picture:

insert image description here


Are you satisfied with the effect of this exquisite QR code picture?

Well, this is the end of our second function case of graph generation.

Guess you like

Origin blog.csdn.net/lizhong2008/article/details/132348738