레이블이 create images인 게시물을 표시합니다. 모든 게시물 표시
레이블이 create images인 게시물을 표시합니다. 모든 게시물 표시

2025년 3월 8일 토요일

prompt for generating an image of Geno Smith using Stable Diffusion, including both positive and negative aspects

 Positive Prompt: "Create an image of Geno Smith, the professional American football quarterback. He is wearing his Seattle Seahawks uniform, which includes a navy blue jersey with the number 7, navy blue pants, and a helmet with the Seahawks logo. Geno Smith is in a dynamic action pose, either throwing a football or celebrating a touchdown. The background should be a football stadium filled with cheering fans."

Negative Prompt: "Avoid any elements that depict injuries, negative expressions, or any controversial or inappropriate content. Do not include any other players or team logos that are not related to the Seattle Seahawks."


generating an image of Geno Smith using Stable Diffusion



2025년 3월 7일 금요일

4-7 Let's upscale with the extension function(Stable Diffusion Practical Guide Table of Contents)

>>>What is Ultimate SD Upscale?

In Section 4-6, we looked at upscaling using img2img. This time, we will explain another way of upscaling using an extension called Ultimate SD Upscale. First, let’s start by installing the extension.

About the Stable Division Extension

Stable Diffusion and AUTOMATIC1111 are open source licenses that disclose the source code of the program. This means that anyone can use the program and develop and disclose additional programs. By using these additional programs, you can add new functions to suit your usage environment or expand them to use them more freely, so let's actively use them. However, some extended functions have restricted licenses, so be sure to check before installing.

>>> Install the extension.

All extensions can be installed via the WebUI. First, launch the WebUI and open the Extentions tab. Select Install from URL, and then click and copy and paste the code from the GitHub page of the extension you want to install into the URL for extension's git repository.

GitHub - Coyote-A/ultimate-upscale-for-automatic1111

https://github.com/Coyote-A/ultimate-upscale-for-automatic1111

Let's install Ultimate SD Upscale from the Extensions tab.

Once the installation is complete, click on the Installed tab and check if Ultimate SD Upscale is in the list of installed extensions. If it is not in the list, click on Apply and quit to restart the WebUI and check again. For Colab, you will need to run the last cell of the notepad again and then access the new Gradio URL.

Check if Ultimate SD Upscale is in the list of installed extensions.

>>>Let's try Ultimate SD Upscale

Restart the WebUI. Since Ultimate SD Upscale is an extension used by img2img, go to the img2img tab. Select Ultimate SD Upscale from the Script menu at the bottom of the Generation tab.

Set Resize by to 2 and Denosing strength to 0.5

In the Ultimate SD Upscale menu, set five additional parameters.

In the Ultimate SD Upscale menu

  • Target size type

Specifies the size of the upscaled image.

From img2img2 settings: Matches the settings in the img2img tab.

Custom size: A slider is displayed, specifying the width and height sizes respectively.

Scale from image size: Specifies how many times the size of the input image will be scaled.

  • Upscaler

Select the upscaler algorithm to use.

  • Type

When upscaling, AI divides the image and processes it. The divided parts are called 'tiles'. Here, we specify how to divide the tiles. For undulation, we can keep the initial state.

  • Tile width/height

Specifies the size of the tiles.

  • Mask blur

Specifies how much to blur the boundaries between tiles.

Okay, let's actually use it. First, prepare the image created with txt2img. Upload it to the img2img tab, and set img2img → Resize by: 2, Denosing strength: 0.5. Select Ultimate SD Upscale → Upscaler: R-ESRGAN 4x+, and create it while maintaining the default settings for other things.

Set Resize by to 2 and Denosing strength to 0.5

Select Ultimate SD Upscale → Upscaler R-ESRGAN 4x+

Let's check the generated image

Original image

Image with ESRGAN 4x+ applied

I just chose ESRGAN 4x+ as my upscaler, but I wonder what kind of images other upscalers will produce. Let's test it out.

Lanczos

Nearest

ESRGAN_4x

LDSR

Lanczos

Nearest

ESRGAN_4x

LDSR

R-ESRGAN 4x+

R-ESRGAN 4X+ Anime6B

ScuNET GAN

SwinlR 4x

R-ESRGAN 4x+

R-ESRGAN 4X+ Anime6B

ScuNET GAN

SwinlR 4x

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.

2025년 3월 6일 목요일

4-5 Expand the image with outpainting(Stable Diffusion Practical Guide Table of Contents)

>>>What is Outpainting?

In the previous section, we learned that using Inpaint, we can select a part of the input image and create it. Using Outpainting, we can create a new image that continues around the input image. This is useful when you find out later that there is a broken part in the subject of the image or that the image size is small.

Here, we will proceed with outpainting using the most practical outpainting tool, Poor man's outpainting. First, open the img2img →img2img tab and upload the input image.

>>>Let's try Outpainting

Here, we will proceed with outpainting using the most practical outpainting tool, Poor man's outpainting. First, open the img2img →img2img tab and upload the input image.

Prompt

masterpiece, best quality, ultra detailed, fantasy,colorful, portrait, 1 girl, straw hat, white shirt,white background

Negative Prompt

worst quality, low quality, normal quality, easynegative, multiple girls,

Let's try Outpainting

From the Script menu, select Poor man's outpainting. The Poor man's outpainting menu will appear, and you can set four additional parameters.

From the Script menu, select Poor man's outpainting.

poor man's outpainting menu

  • Pixels to expand: Specifies the range to expand in pixels.

  • Mask blur: Specifies how to blur the border between the input image and the newly created area.

  • Masked content: Specifies the method to supplement the range to expand. There are four types of supplementation methods, just like Inpaint.

  • Outpainting direction: Specifies the direction to expand in: up, down, left, or right. Multiple directions can be selected at the same time.

This time, let's expand the image at the bottom by setting Pixels to expand: 128, Mask blur: 4, Masked content: fill, Outpainting direction: down without changing the prompt.

Original pictureImage processed with outpainting

If you repeatedly run Outpainting on an image that has been Outpainted, you can further expand the image. If the boundary with the expanded part is noticeable, try adjusting the Mask blur or Pixels to expand values.

2025년 3월 5일 수요일

4-4 Modify images using Inpaint(Stable Diffusion Practical Guide Table of Contents)

>>>Change expression

In the previous section, we explained how to mask with Inpaint and add a new prompt to reflect the content in the generated image. You can also use this feature to modify only the expression. For example, let's change the shape of the mouth of the input image to make it a smiling face. Upload the image to Inpaint, mask around the mouth, modify the prompt, and proceed with the image generation

.

Mask around the mouth with Inpaint.

Input image

Prompt

masterpiece, best quality, ultra detailed, fantasy,colorful, portrait, 1 girl, straw hat, white shirt,white background

Prompt

masterpiece, best quality, ultra detailed, fantasy,colorful, portrait, 1 girl, straw hat, white shirt,white background,smile

>>>Add accessories

If you want to add hair decorations, accessories, ribbons, etc., just mask the area you want to create and give it a prompt. This time, let's add an earring to the right ear. Mask the area below the earlobe where you want to add the earring, and input the prompt 'star-shaped earring' to create the image.

Mask the area where you want to add earrings, and generate the image by entering the prompt 'star shaped earrings'.

Prompt

masterpiece, best quality, ultra detailed, fantasy,colorful, portrait, 1 girl, straw hat, white shirt,white background,star earring,

2025년 3월 4일 화요일

4-3 Let's edit the image with Inpaint(Stable Diffusion Practical Guide Table of Contents)

>>>What is Inpaint?

Inpaint is a function that specifies a certain area (masking) of an input image, creates only that area, and then changes it. You can later add or delete the background and details of the input image.

>>>Let's try Inpaint

Now let's actually use Inpaint. Open the img2img tab, and select Generation → Inpaint tab. Drag and drop the input image into the area, or click inside the area to upload the file directly.

Let's insert an image into inpaint

Prompt 

masterpiece, best quality, ultra detailed, 1girl, upper body

Negative Prompt

worst quality, low quality, normal quality, easynegative,

When you upload the input image, a toolbar will appear at the top right of the canvas, just like in Sketch. The operation method is the same as in Sketch. Color and mask all the parts you want to modify in Illustrator. This time, let's mask them by surrounding the background part.

inpaint parameter

  • Mask blur

Specifies the range to blur the boundary with the masked area in pixels.

  • Mask mode

Sets how to handle the masked area.

impaint masked: Creates the masked area.

Inpaint not masked: Creates the area outside the masked area.

  • Masked content

Selects how to handle the masked area in advance.

fill: Creates an image by filling the masked area with a color that is the same as the surrounding pixels.

original: Creates an image by leaving the masked area as the input image.

latent noise: Creates an image by filling the masked area with random noise.

latent nothing: Creates an image without giving any features to the masked area.

  • Inpaint area

Sets the range to be the input target.

whole picture: Extracts features from the entire input image and creates an image.

Only masked: Creates an image by extracting features only from the masked area.

  • Only masked padding, pixels

When Inpaint area: Only masked is selected above, specify how much to expand the masked area in pixels.

This time, I set Mask blur: 4, Mask mode: Inpaint masked, Masked content: original, Inpaint area: Whole picture.

Let's load the image and not enter any prompts for now.

Let's clean up the mask blur around the character.

First, let's click the Generate button without entering the prompt. Then, the image is generated by only taking advantage of the features of the input image without being instructed by the prompt, so there is no significant change in the masked range.

There is no significant change in the masked area.

Let's do inpaint blur processing.

Next, let's change the background by writing a prompt this time. Let's change the background around the character by adding Prompt blue sky. The blue sky appears in the masked area as the prompt instruction is reflected.

Prompt 

masterpiece, best quality, ultra detailed, 1girl, upper body, blue sky,

Negative Prompt

worst quality, low quality, normal quality, easynegative,

Completed 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...