Sign in

Edit - Replace Background and Relight

documented

Replace the background and relight the subject.

POST /v2beta/stable-image/edit/replace-background-and-relightStable Imageno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://api.stability.ai/v2beta/stable-image/edit/replace-background-and-relight" \
  -X POST \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {{STABILITY_API_KEY}}" \
  -H "Content-Type: multipart/form-data" \
  -F "subject_image=@{{$subject_image_path}}" \
  -F "background_reference=@{{$background_reference_path}}" \
  -F "background_prompt={{$background_prompt}}" \
  -F "foreground_prompt={{$foreground_prompt}}" \
  -F "preserve_original_subject={{$preserve_original_subject}}" \
  -F "original_background_depth={{$original_background_depth}}" \
  -F "light_source_direction={{$light_source_direction}}" \
  -F "light_reference=@{{$light_reference_path}}" \
  -F "light_source_strength={{$light_source_strength}}" \
  -F "seed={{$seed}}" \
  -F "output_format={{$output_format}}"
Edit - Replace Background and Relight · Stability AI · OpenIntegrations