Stable Diffusion Inpaint

Use any diffusion model on Civitai to inpaint the mask region of your image!

Try it in the Widget Center

Click this url to try this widget and copy the Pro Config template.

Usage

Utilize diffusion model to fill in the masked region of your image!

Input Parameters

Name
Type
Description
Default
Required

image

string

The input image, can be a url or base64 sting

mask

string

The correspond mask, can be a url or base64 sting. 1 for mask region

model

string

The model id from civitai (SD1.5, SDXL 1.0, PlaygroundV2). How to get it? Click on a model page on civitai, and copy the series number within the download link.

64094

prompt

string

The text prompt for image transformation. Add lora? add `` to your prompt. `$id` is the series number and `$weight` is the lora weight you want (always set to 1.0). You can use multiple loras.

negative_prompt

string

The negative prompt for image transformation.

(worst quality, low quality:1.4),(malformed hands:1.4),(poorly drawn hands:1.4),(mutated fingers:1.4),(extra limbs:1.35),(poorly drawn face:1.4),bad leg,strange leg, poor eyes, full screen of face

mask_blur

integer

Mask blur refers to the feathering of a mask (from edges to inside the mask), adjusted between 0-64. A smaller value results in sharper edges. Default to 4

4

inpainting_fill

integer

Choose the fill content in mask: 0 - fill, 1 - original, 2 - latent noise, 3 - latent nothing

1

inpainting_mask_invert

integer

0 - Inpaint masked region, 1 - Inpaint not masked region

0

sampler

string

Sampler for diffusion model inference

DPM++ 2M Karras

steps

integer

Steps for sampler to step whle sampling

25

cfg_scale

number

Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results. Default to 7.

7.0

seed

integer

Random seed for generation process. -1 means random seed

-1

clip_skip

integer

Early stopping parameter for CLIP model; 1 is stop at last layer as usual, 2 is stop at penultimate layer, etc.

1

denoising_strength

number

Strength of image transfomation during inpainting precess. High means more influence during transformation

0.7

Output Parameters

Name
Type
Description
File Type

url

string

The url of generated image, stored in the cloud. Only temporarily effective, will be cleared in a few hours.

image

Output Example

{
  "url": "https://image.myshell.ai/image/chat/embed_obj/40295/20240423/2f1f812747e6468b959ea7dde217b78b.jpg"
}

Detailed Guidelines

  • inpaint

    • Main parameter:

      • image : The input image, can be a url or base64 sting. Any size

      • mask: The correspond mask, can be a url or base64 sting. 1 means the masked region

      • mask_blur : Mask blur refers to the feathering of a mask (from edges to inside the mask), adjusted between 0-64. A smaller value results in sharper edges. Default to 4

      • inpainting_fill : Choose the fill content in mask: 0 - fill, 1 - original, 2 - latent noise, 3 - latent nothing. Default to 1

      • inpainting_mask_invert: 0 - Inpaint masked region, 1 - Inpaint not masked region

      • denoising_strength: Strength of image transfomation during inpainting precess. High means more influence during transformation

Last updated