HomeTutorials
【SD Tutorials】How to Use Image-to-image
271

【SD Tutorials】How to Use Image-to-image

Noodle
Noodle
March 10th, 2023

Contents

  1. Img2img tab
  2. Image-to-image
  3. Sketch
  4. Inpainting
  5. Inpaint sketch
  6. Inpaint upload
  7. Batch
  8. Get prompt from an image

Img2img tab

The img2img tab is where you use the image-to-image functions. You can create new images that follow the composition of the base image.

Image-to-image

Step 1: Drag and drop the base image to the img2img tab on the img2img page. Step 2: Adjust width or height. Step 3: Set the sampling method(e.g.DPM++ 2M Karass) and sampling steps(e.g.25). Step 4: Set batch size. Step 5: Write a prompt for the new image. Step 6: Press the Generate button and then adjust denoising strength and repeat.

Resize mode: "Just resize" scales the input image to fit the new image dimension. It will stretch or squeeze the image. "Crop and resize" fits the new image canvas into the input image. The parts that don’t fit are removed. The aspect ratio of the original image will be preserved. "Resize and fill" fits the input image into the new image canvas. The extra part is filled with the average color of the input image. The aspect ratio will be preserved. “Just resize (latent upscale)” is similar to “Just resize”, but the scaling is done in the latent space. Use denoising strength larger than 0.5 to avoid blurry images. Denoising strength: 0.75 is a good starting point that has a good amount of changes.

Sketch

To avoid uploading an image, you have the option to sketch the initial picture instead. To enable the color sketch tool, simply use the specified argument when starting the webui.

--gradio-img2img-tool color-sketch

Step 1: Navigate to sketch tab on the img2img page. Step 2: Upload a background image to the canvas. Step 3: Sketch your creation. With color sketch tool enabled, you should be able to sketch in color. Step 4: Write a prompt. Step 5: Press Generate.

Inpainting

Inpainting is the most commonly used feature.Suppose you have produced an image in the txt2img section, but the face appears distorted. To fix this issue, you can utilize the "Send to inpaint" option to transmit the image from the txt2img section to the img2img section.

Press"Inpaint tab "on the img2img page and use the paintbrush tool to create a mask over the area to be regenerated.

You usually would adjust -denoising strength: Start at 0.75 to decrease or increase -Mask content: original -Mask Mode: Inpaint masked -Batch size: 4

Inpaint sketch

Inpaint sketch combines inpainting and sketch. The Inpaint Sketch function is a combination of inpainting and sketching. It allows you to paint similarly to the sketch tab, but only regenerates the painted portion, leaving the unpainted area unaltered.

Inpaint upload

Inpaint upload lets you upload a separate mask file instead of drawing it.

Batch

Batch lets you inpaint or perform image-to-image for multiple images.

Get prompt from an image

Interogate CLIP button takes the image you upload to the img2img tab and guesses the prompt. It is useful when you want to work on images you don’t know the prompt. To get a guessed prompt from an image: Step 1: Navigate to the img2img page. Step 2: Upload an image to the img2img tab. Step 3: Click the Interrogate CLIP button and then a prompt will show up in the prompt text box. (The Interrogate DeepBooru button offers a similar function, except it is designed for anime images.)

Comments