2025년 3월 7일 금요일

4-6 Increase image resolution with im2img(Stable Diffusion Practical Guide Table of Contents)

>>>Why is upscaling necessary?

Upscaling refers to expanding an image to increase its resolution. The image generated using Stable Diffusion has an initial size of 512x512 (1024x1024 in SDXL), which is quite low in resolution. Upscaling is removing noise from an image generated with such low resolution and generating a high-resolution image.

Then why not generate a high-resolution image from the beginning? This is because inferring and generating a high-resolution image from the beginning requires a very large computational space. Generating a high-resolution image requires a huge VRAM, that is, an expensive GPU with high computational power, and it costs much more. Also, there is a limit to the size of the learned image, so if you try to generate a high-resolution image, the image itself may be damaged.

Hires. Fix, which was explained in Chapter 3, is also one of the various upscaling methods, and here we will explain upscaling using img2img.

>>>Let's try upscaling using img2img

Upscale the generated image with img2img. First, create an image in the txt2img tab. Send the generated image to the img2img tab by clicking Send to img to img in the viewer.

Prompt

score_9, score_8_up, score_7_up,  realistic, realism, raw photo of 20 years old woman in off-shoulder, close up portrait, deep blue sky, cloudy sky, outdoor, high key light, soft shadow, Fiery clouds

Negative Prompt

score_6, score_5, score_4, source_pony, (worst quality:1.2), (low quality:1.2), (normal quality:1.2), lowres, bad anatomy, bad hands, signature, watermarks, ugly, imperfect eyes, skewed eyes, unnatural face, unnatural body, error, extra limb, missing limbs, painting by bad-artist, 3d

Let's create an image in the tex2img tab

In the img2img tab, specify the size after enlarging with the Resize to parameter. This time, specify it as 1024x1024, which is twice as much. The same thing happens if you specify the enlargement ratio with Resize by.

Let's enlarge the image with the Resize to parameter in the img2img tab.

Since we want to generate an image that is as similar to the input image as possible, leave the prompt unchanged and set Resize mode: Just resize, Denoising strength: 0.5. The smaller the Denoising strength value, the more faithfully the input image is reproduced before enlargement, but if it is too small, the output image will be unclear like a low-resolution image even if the size is large. After completing the settings, click Generate to generate the image.

댓글 없음:

댓글 쓰기

Recommended Posts

Love is taking responsibility till the end

  I created a campaign called "Don't Abandon Your Beloved Dog" with Stable Diffusion. I tried creating it several times, but i...