Find objects in an image by text description and replace them with AI-generated content, paid per call via MPP.
What it does
The Stability AI Search and Replace endpoint, served through the Locus MPP gateway, automatically locates an object in a source image using a text description (search_prompt) and replaces it with new AI-generated content guided by a replacement prompt. This is useful for product photography edits, creative compositing, and batch asset modification without manual masking. The endpoint accepts a source image, a search_prompt describing what to find, a prompt describing the replacement, and optional parameters like negative_prompt, grow_mask (to expand the detection area), output_format (jpeg/png/webp), and a random seed for reproducibility.
Payment is handled via the MPP (Micropayment Protocol) with the Tempo settlement method. The listed price for this endpoint is 57,000 base units of pathUSD (6 decimals), which equals $0.057 per call. The endpoint is part of a broader Stability AI suite available through the same Locus gateway, including generation (Ultra, Core, SD3), editing (erase, inpaint, outpaint, sketch, structure, style transfer, recolor), background removal/replacement, upscaling, 3D model generation, and audio generation/editing.
The endpoint uses HTTP POST and returns a 402 Payment Required challenge to unauthenticated callers. Note that the probe received 404 on HEAD/GET methods, which is expected since this endpoint only accepts POST requests. The OpenAPI schema is well-documented with clear field descriptions and required parameters. Response format details beyond a 200 success status are not specified in the schema.
Capabilities
Use cases
- —Replacing a product in a lifestyle photo with a different product using text descriptions
- —Swapping background objects in real estate photography without manual masking
- —Batch-editing marketing assets by finding and replacing branded elements
- —Automating creative compositing workflows where specific objects need substitution
- —Removing unwanted objects and replacing them with contextually appropriate content
Fit
Best for
- —Agents needing automated, mask-free object replacement in images
- —E-commerce product photo editing pipelines
- —Creative teams doing rapid visual iteration with text-guided edits
- —Developers integrating AI image editing into apps via pay-per-call micropayments
Not for
- —Free or high-volume batch processing without per-call payment tolerance
- —Tasks requiring pixel-perfect manual masking control (this uses automatic detection)
- —Non-image workloads like text generation or structured data processing
Quick start
curl -X POST https://stability-ai.mpp.paywithlocus.com/stability-ai/search-and-replace \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <MPP_TOKEN>" \
-d '{
"image": "<base64-encoded-image>",
"prompt": "a red sports car",
"search_prompt": "the blue sedan",
"output_format": "png"
}'Example
Request
{
"seed": 42,
"image": "<base64-encoded-source-image>",
"prompt": "a red sports car",
"grow_mask": 5,
"output_format": "png",
"search_prompt": "the blue sedan",
"negative_prompt": "blurry, low quality"
}Endpoint
Quality
Full OpenAPI schema with clear field descriptions, required parameters, and pricing info. The endpoint returned 404 on HEAD/GET (expected for POST-only), and the broader OpenAPI confirms the route exists with a 402 payment challenge. No response schema or example responses are provided, and crawled pages returned no additional documentation.
Warnings
- —Probe returned 404 on HEAD/GET; endpoint is POST-only — this does not indicate it is down
- —No response schema documented — the shape of the 200 response (image bytes, base64, URL) is unspecified
- —Currency address 0x20c000000000000000000000b9537d11c60e8b50 is assumed to be pathUSD with 6 decimals based on context; if decimals differ, the $0.057 price would be incorrect
Citations
- —Search and Replace endpoint charges 57,000 base units via Tempo methodhttps://stability-ai.mpp.paywithlocus.com
- —Required parameters are image, prompt, and search_prompthttps://stability-ai.mpp.paywithlocus.com
- —API reference available at platform.stability.aihttps://platform.stability.ai/docs/api-reference
- —LLM-readable docs at beta.paywithlocus.com/mpp/stability-ai.mdhttps://beta.paywithlocus.com/mpp/stability-ai.md