Generate an AI image variation of the source asset
POST /assets/{id}/edit/img2img
Enqueues an aiedit.img2img job that dispatches a prompt +
the source image’s bytes to the operator-configured MCP
image-edit server (see /admin/system/aiedit). The job runs
async (ComfyUI generation can take seconds-to-minutes);
endpoint returns 202 + the job id. Poll /jobs/{id} for
status; on completion the job result carries the new
derivative asset id. A creative_lineage row links the
derivative back to the source for the asset detail panel.
Requires capabilities mcp.client.use (umbrella) plus the
per-tool capability operator pinned on the img2img grant
(typically mcp.client.images.write).
Errors:
- 400 if the request body is missing / malformed.
- 401 if the caller is unauthenticated.
- 403 if the caller lacks the required capabilities.
- 404 if the source asset doesn’t exist.
- 409 if no MCP image-edit server is configured.
- 422 if the source asset is not an image (audio / video / doc / archive — img2img only applies to images).
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”Payload for POST /assets/{id}/edit/img2img. Zero-value knobs (denoise_strength, steps, seed) tell the bridge to apply its own defaults; the operator’s workflow defaults stay authoritative unless the caller explicitly overrides.
object
Steers the variation. Required even when empty-like (e.g. ”.”) to keep the operator’s audit trail human-readable.
0 = no change from source; 1 = ignore source entirely (effectively txt2img). Bridge default is 0.7.
Inference step count. Bridge default is 20.
0 (or omitted) = random; the response carries the actual seed used.
Responses
Section titled “ Responses ”Img2img job enqueued.
The 202 response for the enqueue endpoints. Caller polls /jobs/{job_id} for status; on completion the job result carries the new derivative asset id.
object
The enqueued jobs.* row id.
The asset the variation derives from. Echoed for caller-side correlation.
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completedResource not found
object
Human-readable error summary
Example
the request could not be completedConflict (slug taken, would create cycle, etc.)
object
Human-readable error summary
Example
the request could not be completedRequest shape is valid but the action doesn’t apply (e.g. subtitles on a non-video/audio asset).
object
Human-readable error summary
Example
the request could not be completed