Modifying sections of an image

Altering specific areas or elements within an image

Use case example

  • - Image editing software for selective adjustments
  • - Editing particular regions while preserving the rest of the image

Technical

Stable Diffusion V2 Inpainting pipeline

Added by: APIForAI

Price per call≈ 0.02

Try it nowAPI information

Try it

Examples

Input

Image
Image
{
"input":{
"prompt":"a blue sofa in a living room"
"image":"https://rbqktisnztholqojxlaf.s..."
"mask":"https://rbqktisnztholqojxlaf.s..."
"prompt_strength":0.8
"num_outputs":1
"num_inference_steps":50
"guidance_scale":7.5
"seed":2481
}
"id":100
}

Output

Image
{
"status":"succeeded"
"output":[
0:"https://rbqktisnztholqojxlaf.s..."
]
"prediction_time":6.778481
}

API Information

Input description

prompt string

Input prompt

Default value: a photo of an astronaut riding a horse on mars

image* uri

Inital image to generate variations of. Supporting size with 512x512

mask* uri

Black and white image to use as mask for inpainting over the image provided. Black pixels are inpainted and white pixels are preserved

prompt_strength number

Prompt strength when using init image. 1.0 corresponds to full destruction of information in init image

Default value: 0.8

num_outputs integer

Number of images to output. Higher number of outputs may OOM.

Default value: 1

num_inference_steps integer

Number of denoising steps

Default value: 50

guidance_scale number

Scale for classifier-free guidance

Default value: 7.5

seed integer

Random seed. Leave blank to randomize the seed

Output JSON Schema

This represents the JSON schema that details the structure of the model's output.

{
"type":"array"
"items":{
"type":"string"
"format":"uri"
}
"title":"Output"
}

APIForAI

Build fast by accessing AI models easily