ホーム 暮らし Upscale Beautifully with Stable Diffusion! How to Install and Use 4x-UltraSharp

Upscale Beautifully with Stable Diffusion! How to Install and Use 4x-UltraSharp

藤崎 健人 藤崎 健人 • 更新: • 公開: • 読了約 9 分
目次

For those who want to "generate images in beautiful high resolution" or "want to know how to use 4x-UltraSharp,"
this article explains how to install and use 4x-UltraSharp for high-resolution upscaling, as well as the results of comparing it with other upscaling methods.



How to Install 4x-UltraSharp

ne526c4ac6c25

You can download "4x-UltraSharp" from the Hugging Face website.

Please access the following link:
https://huggingface.co/lokCX/4x-Ultrasharp/tree/main

From here, I will explain the installation methods separately for those using a local environment and those using Google Colab.


For Local Users

Click on "Files and versions."

Click the "download icon" to the right of "4x-UltraSharp.pth" to download the file, then place the file into "models/ESRGAN/" to complete the installation.


For Google Colab Users

You need to copy the download URL.

Right-click on the "download icon" located to the right of "Files and versions" -> "4x-UltraSharp.pth."


If you are using Google Chrome, click "Copy link address."

This completes the copying of the download URL.


You need to add it to your code using the download URL.

If you do not create the "ESRGAN" folder (directory) before adding "4x-UltraSharp," an error will occur and you will not be able to use it.

The following is sample code for creating an "ESRGAN" folder.

%mkdir -p /content/stable-diffusion-webui/models/ESRGAN/


The following is sample code that allows you to use 4x-UltraSharp, so please use it as a reference.

!wget https://huggingface.co/lokCX/4x-Ultrasharp/resolve/main/4x-UltraSharp.pth -O /content/stable-diffusion-webui/models/ESRGAN/4x-UltraSharp.pth


There are two points to note:
First, make sure to place "4x-UltraSharp" inside "ESRGAN/".
Second, ensure the file extension at the end of the filename is "pth".

If the extension is different, an error will occur and it will not work, so please check it.

You can check the extension at the end of the filename on Hugging Face.

In the case of "4x-UltraSharp", the extension at the end of the filename is "pth", so make sure to match the extension in Google Colab as well.


How to use 4x-UltraSharp and comparison results

Using "4x-UltraSharp" is simple.

Please click the inverted triangle on the right side of the "Hires.fix" section to open it.

You can use it by selecting "4x-UltraSharp" in the "Upscaler" section.


It has changed slightly since V1.7.0, so please also make sure to check the checkbox on the left side of "Hires.fix".


The video below shows the comparison results between "none" and "4x-UltraSharp" for the "Upscaler".

Compared to "none", with "4x-UltraSharp", the background is clearer, and the overall outline of the person is sharper and more beautiful when generating images.


Here are the results compared in images.

It is a bit hard to tell, but using "4x-UltraSharp" makes the overall image sharper and improves the quality.


Summary

I have explained how to install and use "4x-UltraSharp".

I recommend 4x-UltraSharp because it makes images sharper overall and allows for higher resolution compared to other upscaling methods.

同じカテゴリの記事

藤崎 健人

芸能取材歴10年のデスク。所属事務所の公式リリース、番組公式サイト、配信サービスの告知を一次情報として採用し、裏付けの取れない内容は記事にしていません。

おすすめの関連記事