Skip to navigation

Media · Image · Generative fill / inpaint with prompt

View as Markdown

Fill a masked region of an image with AI-generated content described by prompt. Requires a mask (mask_url or mask_base64) marking WHERE to fill. Use this when you have a specific region to replace; for removing an object by description (no mask) use magicInpaint; to extend the image past its edges use imageOutpainting. Async — returns a task_id (auto-polled).

Authentication

AuthorizationApi-Key

Header authentication of the form Api-Key <token>

OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
image_urlstringRequired
URL of the source image.
promptstringRequired
Text description of what to generate in the masked area.
mask_urlstringOptional

URL of the mask image (white = fill area).

mask_base64stringOptional

Base64-encoded mask image (alternative to mask_url).

negative_promptstringOptional
What to avoid in the generated content.
countintegerOptionalDefaults to 4
Number of variations to generate.

Response

Async task queued.
task_idstringOptional

Poll GET /api/v1/tasks/{task_id} until SUCCESS or FAILURE.