POST/v1/images/edits

Edit an image

Multipart image editing (inpaint, erase, outpaint, search and replace, style transfer). Served by the Stable Image models; other image models refuse it on model. Always returns b64_json, one image (n must be 1, size is refused).

Each image part is at most 20 MiB. Unknown fields are refused by name.

認証: AuthorizationヘッダーにBearer形式のAPIキー

リクエストボディ

  • modelstring必須

    A Stable Image model slug.

  • imagestring必須

    The source image (image or image[], exactly one).

  • maskstring

    Optional mask.

  • style_imagestring

    Optional style reference, for style models.

  • promptstring

    What to change.

  • output_formatenum
    "png""jpeg""webp"
  • negative_promptstring

    What to avoid. Up to 10,000 characters.

  • search_promptstring

    The object to find, for search and replace.

  • seedinteger
  • grow_maskinteger
  • strengthnumber

レスポンス

  • 200

    The edited image.

    レスポンス
    • createdinteger
    • dataarray<object>
      data
      • b64_jsonstring
      • urlstring
      • revised_promptstring
    • backgroundstring
    • output_formatstring
    • qualitystring
    • sizestring
    • usageobject

      The provider's usage object, when it reports one.

  • 400

    Invalid request. param names the field; code says why (invalid_parameter, unsupported_parameter, unsupported_capability, refusal, previous_response_not_found). Not charged.

    レスポンス
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 401

    The key is missing, malformed, expired or revoked.

    レスポンス
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 402

    The organization must act first: card_required, email_unverified, org_under_review, free_tier_requires_payment or promotion_ended. The message names the step; retrying does not help.

    レスポンス
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 429

    insufficient_quota (out of credits, over a spend limit, or the model needs a purchase) and promo_credits_now (a free promotion is used up): add credits, the message names the step. rate_limit_exceeded, free_limit_reached, admission_capacity_exceeded: wait Retry-After seconds and retry.

    レスポンス
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"

リクエスト

curl https://api.experientiallabs.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F model=stable-image-inpaint \
  -F prompt="a red bicycle" \
  -F image=@street.png \
  -F mask=@mask.png

レスポンス

{
  "created": 1795132800,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}

https://api.experientiallabs.ai/v1/images/edits