Three methods to upscale images by using PAI ArtLab

Updated at: 2024-04-16 05:33

This topic describes how to use Platform for AI (PAI) ArtLab to upscale images.

Background information

The default size of an image generated by using a model of Stable Diffusion V1 is 512 × 512 pixels. This resolution is low when high definition (HD) is becoming an industry standard. For example, the cameras of an iPhone 12 produce images of 12 million pixels (4032 × 3024) and its screen resolution is 2532 x 1170 pixels. Therefore, unscaled Stable Diffusion images are of low quality after they are enlarged.

During text-to-image generation, most users prefer generating multiple low-resolution candidate images at a time due to limited GPU memory and fast iteration requirements.

This leads to inaccurate and low-resolution output images. To resolve this issue, you can use an AI upscaler, SD upscale, and ControlNet tile upscale to enlarge images and recover details.

Prerequisites

The Ultimate SD Upscale and ControlNet extensions are installed if you use ControlNet tile upscale.

Install extensions

By default, the ControlNET extension is installed in ArtLab. To install the Ultimate SD Upscale extension, perform the following steps:

  1. On the Extensions tab of the SD WebUI page, click the Install from URL tab.

  2. Enter https://github.com/Coyote-A/ultimate-upscale-for-automatic1111 in the URL for extension's git repository field.

  1. Click Install and wait until the extension is installed.

    image

  2. On the Installed tab, select ultimate-upscale-for-automatic1111 in the Extension column and click Apply and restart UI.

  3. After ArtLab is restarted, you can view Ultimate SD upscale in the Script drop-down list on the img2img tab.

Use an AI upscaler

  1. Go to the Extras tab and upload the image that you want to upscale.

  2. On the Scale by tab, configure the following core parameters:

    • Resize: the magnification by which the input image is upscaled. In this example, this parameter is set to 4.

    • Upscaler 1: the AI upscaler that you want to use to upscale the image. Select an upscaler from the Upscaler 1 drop-down list based on your business requirements.

    image

  3. Click Generate to view the upscaling results.image.png

Use SD upscale

After you use an AI upscaler to upscale an image, some additional changes may be made to the image. To resolve this issue and maintain accuracy, you can use SD upscale to upscale the image again to recover details. SD upscale uses the same model and prompts of an image to produce details that are in line with the initial design principle.

  1. Go to the img2img tab and upload the image that you want to upscale.

  2. Enter the original positive prompts and negative prompts. If you do not have the original prompts of the image, use general prompts such as perfect.

    Note
    • Alternative 1: If you have generated an image on the txt2img tab, click Send to img2img. The image and prompts are automatically displayed on the img2img tab.

    • Alternative 2: If you have saved the generated image to your local storage, upload the image to the PNG Info tab. After the image is uploaded, you can view the information that is used to generate the image, including the prompts and model. Click Send to img2img. The image and prompts are automatically displayed on the img2img tab.

  3. On the Resize to tab, configure the following core parameters:

    • Width: the tile size to be used for SD upscale. In this example, this parameter is set to 512.

    • Height: the tile size to be used for SD upscale. In this example, this parameter is set to 512.

    • Denoising strength: the number of noise added to the input image. In this example, this parameter is set to 0.3. A higher value results in more details and recovery.

    image

  4. Click Generate to view the upscaling results.

    image.png

Use ControlNet tile upscale

ControlNet tile is a ControlNet model for regenerating image details. This method is ideal for upscaling in tiles with a low video random access memory (VRAM) setup.

  1. Go to the img2img tab and upload the image that you want to upscale.

  2. Enter the original positive prompts and negative prompts.

    Note
    • Alternative 1: If you have generated an image on the txt2img tab, click Send to img2img. The image and prompts are automatically displayed on the img2img tab.

    • Alternative 2: If you have saved the generated image to your local storage, upload the image to the PNG Info tab. After the image is uploaded, you can view the information that is used to generate the image, including the prompts and model. Click Send to img2img. The image and prompts are automatically displayed on the img2img tab.

  3. On the Resize to tab, configure the following core parameters:

    • Sampling steps: the number of iterations that Stable Diffusion runs to generate the image from random noise. In this example, this parameter is set to 50.

    • Denoising strength: the number of noise added to the input image. In this example, this parameter is set to 0.5.

    image

  4. In the ControlNet section of the SD WebUI page, upload the same input image. Configure the following core parameters:

    • Select Enable.

    • Preprocessor: the preprocessor that converts the format of the input image. Select tile_resample from the Preprocessor drop-down list.

    • Model: the ControlNet model that is used to upscale the input image. Select control_v…_sd15_tile from the Model drop-down list.

    • Script: the script that is used to upscale the input image. Select Ultimate SD upscale from the Script drop-down list.

    • Target size type: the size of the output image. Select Scale from image size from the Target size type drop-down list. In this example, the Scale parameter is set to 4.

    • Tile width: the width of tiles for upscaling. In this example, this parameter is set to 512.

    • Tile height: the height of tiles for upscaling. In this example, this parameter is set to 0.

  5. Click Generate.

  • On this page (1, O)
  • Background information
  • Prerequisites
  • Install extensions
  • Use an AI upscaler
  • Use SD upscale
  • Use ControlNet tile upscale
Feedback