GET

/v1/schemas/stability/image/v2beta/stable-image/edit/replace-background-and-relight

kind inputactivity imagehash 06527040…extracted Sep 16, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
1ea5455da5ce2efef103daa142cc44a3e70b4fb3cfcdfa0c9a6a6f46d93912ea
{
  "fetchedAt": 1789536057,
  "extractorVersion": "1",
  "verifiedAt": null
}

Request body

13 properties · 1 required · 2 $defs
propertytypedescriptionconstraints
subject_image*stringAn image containing the subject that you wish to change background and relight.format: binary
background_referencestringAn image whose style you wish to use in the background. Similar to the Control: Style API, stylistic elements from this image are added to the background.format: binary
background_promptstringWhat you wish to see in the background of the output image. This could be a description of the desired background scene, or just a description of the lighting if modifying the light source through `light_source_direction` or `light_reference`.length ≤ 10000
foreground_promptstringDescription of the subject. Use this to prevent elements of the background from bleeding into the subject. For example, if you find your subject is turning green with a forest in the background, try putting a short description of the subject in this field.length ≤ 10000
negative_promptstringA blurb of text describing what you **do not** wish to see in the output image. This is an advanced feature.length ≤ 10000
preserve_original_subjectnumberHow much to overlay the original subject to exactly match the original image. A 1.0 is an exact pixel match for the subject, and 0.0 is a close match but will have new lighting qualities. This is an advanced feature.0 ≤ n ≤ 1 · default: 0.6
original_background_depthnumberControls the generated background to have the same depth as the original subject image. This is an advanced feature.0 ≤ n ≤ 1 · default: 0.5
keep_original_backgroundenumWhether to keep the background of the original image. When this is on, the background will have different lighting than the original image that changes based on the other parameters in this API.true | false · default: "false"
light_source_directionenumDirection of the light source.left | right | above | below
light_referencestringAn image with the desired lighting. Lighter sections of the light_reference image will correspond to sections with brighter lighting in the output image.format: binary
light_source_strengthnumberIf using `light_reference_image` or `light_source_direction`, controls the strength of the light source. 1.0 is brighter and 0.0 is dimmer. This is an advanced feature.0 ≤ n ≤ 1 · default: 0.3
seednumberA specific value that is used to guide the 'randomness' of the generation. (Omit this parameter or pass `0` to use a random seed.)0 ≤ n ≤ 4294967294 · default: 0
output_formatenumDictates the `content-type` of the generated image.jpeg | png | webp · default: "png"

Types

2 $defs

NegativePromptstring

A blurb of text describing what you **do not** wish to see in the output image. This is an advanced feature.

length ≤ 10000

Seednumber

A specific value that is used to guide the 'randomness' of the generation. (Omit this parameter or pass `0` to use a random seed.)

0 ≤ n ≤ 4294967294 · default: 0

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"stability","endpointId":"v2beta/stable-image/edit/replace-background-and-relight","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}