Image-to-image with a mask
Selectively modify portions of an image using a mask. The mask must be the same shape and size as the init image. This endpoint also supports image parameters with alpha channels. See below for more details.
NOTE: Only Version 1 engines will work with this endpoint.
Authorizations
Your Stability API key, sent as a bearer token in the Authorization header.
Headers
Body
- Option 1
- Option 2
Represents the optional parameters that can be passed to any generation request.
An array of text prompts to use for generation.
Due to how arrays are represented in multipart/form-data requests, prompts must adhere to the format text_prompts[index][text|weight],
where index is some integer used to tie the text and weight together. While index does not have to be sequential, duplicate entries
will override previous entries, so it is recommended to use sequential indices.
Given a text prompt with the text A lighthouse on a cliff and a weight of 0.5, it would be represented as:
To add another prompt to that request simply provide the values under a new index:
1For any given pixel, the mask determines the strength of generation on a linear scale. This parameter determines where to source the mask from:
MASK_IMAGE_WHITEwill use the white pixels of the mask_image as the mask, where white pixels are completely replaced and black pixels are unchangedMASK_IMAGE_BLACKwill use the black pixels of the mask_image as the mask, where black pixels are completely replaced and white pixels are unchangedINIT_IMAGE_ALPHAwill use the alpha channel of the init_image as the mask, where fully transparent pixels are completely replaced and fully opaque pixels are unchanged
Which sampler to use for the diffusion process. If this value is omitted we'll automatically select an appropriate sampler for you.
DDIM, DDPM, K_DPMPP_2M, K_DPMPP_2S_ANCESTRAL, K_DPM_2, K_DPM_2_ANCESTRAL, K_EULER, K_EULER_ANCESTRAL, K_HEUN, K_LMS "K_DPM_2_ANCESTRAL"
Pass in a style preset to guide the image model towards a particular style. This list of style presets is subject to change.
enhance, anime, photographic, digital-art, comic-book, fantasy-art, line-art, analog-film, neon-punk, isometric, low-poly, origami, modeling-compound, cinematic, 3d-model, pixel-art, tile-texture