Search and Recolor
The Search and Recolor service provides the ability to change the color of a specific object in an image using a prompt. This service is a specific version of inpainting that does not require a mask. The Search and Recolor service will automatically segment the object and recolor it using the colors requested in the prompt.
How to use
Please invoke this endpoint with a POST request.
The headers of the request must include an API key in the authorization field. The body of the request must be
multipart/form-data, and the accept header should be set to one of the following:
image/*to receive the image in the format specified by theoutput_formatparameter.application/jsonto receive the image encoded as base64 in a JSON response.
The body of the request should include:
imagepromptselect_prompt
The body may optionally include:
grow_maskseednegative_promptoutput_formatstyle_preset
Note: for more details about these parameters please see the request schema below.
Output
The resolution of the generated image will match the resolution of the input image.
Credits
Flat rate of 5 credits per successful generation. You will not be charged for failed generations.
Authorizations
Your Stability API key, sent as a bearer token in the Authorization header.
Headers
Body
What you wish to see in the output image. A strong, descriptive prompt that clearly defines elements, colors, and subjects will lead to better results.
To control the weight of a given word use the format (word:weight),
where word is the word you'd like to control the weight of and weight
is a value between 0 and 1. For example: The sky was a crisp (blue:0.3) and (green:0.8)
would convey a sky that was blue and green, but more green than blue.
1 - 10000Grows the edges of the mask outward in all directions by the specified number of pixels. The expanded area around the mask will be blurred, which can help smooth the transition between inpainted content and the original image.
Try this parameter if you notice seams or rough edges around the inpainted content.
Note: Excessive growth may obscure fine details in the mask and/or merge nearby masked regions.
0 <= x <= 20Response
Search-and-Recolor was successful.
The bytes of the generated image.
The finish-reason and seed will be present as headers.