[AI Painting Stable Diffusion] High-definition image enlargement + face repair + one-click cutout, talk about optimization skills you may not know!

When it comes to post-processing, I guess what you might immediately think of is image enlargement.

Today, I'm going to show you some post-processing techniques, as well as optimization techniques.

Image Enlargement Algorithm

If you often use Akiba's integration package, then you should be familiar with "R-ESRGAN 4x+" and "R-ESRGAN 4x+ Anime6B".

R-ESRGAN 4x+: Realistic pictures

R-ESRGAN 4x+ Anime6B: Two-dimensional pictures

However, have you ever seen advanced algorithms such as "4x-UltraSharp" appear in the works posted by big guys at station C or other places.

Then you can't find it in your own SD?

The reason is simple, because you have not downloaded and installed these high-end algorithms.

So, here I recommend four more powerful zoom-in algorithms for you:

“4x-UltraSharp”、

“8x_NMKD-Superscale_150000_G”、

“8x_NMKD-Typescale_175k”、

“16xPSNR”

Network disk link: https://pan.quark.cn/s/f7d53bd18095

After downloading, put it in the path "...\sd-webui-aki-v4.2\models\ESRGAN" , and then restart the software. You can use it happily

Then comes the most anticipated part: looking at the capabilities of these new algorithms.

I took a picture of blurred dots as experimental material

The traditional algorithm "Lanczos", the commonly used algorithm "R-ESRGAN 4x+", and the four new algorithms just downloaded were used for comparison.

The picture is too small, and you may not be able to see the details clearly, so I will just make a summary.

Summarized as follows:

1. Lanczos simply magnified the pixels, that is, magnified.

2. R-ESRGAN 4x+ showed his kingly demeanor, the enlarged picture has more details and clearer outline.

The 3.4x-UltraSharp is even better, with sharper details and no over-sharpening.

The 4.8x and 16x series amplifiers show their ability to deal with details. They not only pursue beauty, but also pay more attention to reality, so they will add more noise and pore details. But the processing speed will be slower

5. Among the four new algorithms, "4x-UltraSharp" performs well, "8x_NMKD-Superscale_150000_G" has a slightly cold tone, "8x_NMKD-Typescale_175k" has more skin noise than 4x, and "16xPSNR" although the processing speed is slower , the effect is not significantly improved compared to 8x, so it is not recommended.

Background removal (cutout)

This function needs to install a plug-in REMBG

The installation address is https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg.git

The installation process takes about 1 minute

Then click [Installed], the list shows that the stable-diffusion-webui-rembg plugin has been installed

Click the [Apply and Restart UI] button above

The following actual operation, a demonstration of removing the background of the picture

Navigation Bar: Additional Features

U2Net

Click Generate and the console can see the corresponding progress

The problem I encountered: the download speed of my console here is very slow, so I downloaded it manually and put it in the corresponding directory

final effect:

It supports a variety of modes to choose from, each mode is to download the model separately

Some people with poor internet speed may not be able to download it. I will upload the model to the quark network disk here.

If necessary, you can go to the network disk to download, and put the downloaded model file in the .cache\u2net folder of the AI ​​​​installation directory, as shown in the figure below.

In addition, click this button to directly generate a mask.

u2net_cloth_seg

There is also a model here that specializes in clothing cutouts, which can identify the model's clothing with one click.

facial repair

Let's take a look at this GFPGAN facial restoration. I will find a blurred portrait to repair it.

Keep the other parameters unchanged, just pull the GFPGAN parameter to 1, and that’s it.

Effect comparison:

Look at the facial repair effect, like rebirth. Of course, this function can only repair the face, so there is no change in hair, clothes, background, etc.

Guess you like

Origin blog.csdn.net/weixin_38428126/article/details/131798271