Stability Replace Background and Relight

Model Information

Display Name: Stability Replace Background and Relight

API Model ID: stability-ai/replace-background-relight

Category: Image To Image

Description: Replace Background and Relight swaps the background of a subject — using an AI-generated or uploaded image — while adjusting lighting to match. This is an ASYNC service: it returns a generation id to be polled at results/{id}. **Key Features:** - Background replacement and AI background generation - Relighting with direction/strength and light reference - Subject preservation and depth controls **Best For:** - E-commerce, real estate and product photography - Relighting under/over-exposed images **Note:** Asynchronous — poll results/{id} for the final image.

How to Use This Model

To use Stability Replace Background and Relight via the HInow.ai API, use the model ID: stability-ai/replace-background-relight

API Request Example (Image Generation)


POST https://api.hinow.ai/v1/images
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "model": "stability-ai/replace-background-relight",
  "prompt": "Your image description here"
}
              

Pricing

  • total: $0.12

Available Parameters

  • background_prompt: What you want in the background. Required unless background_reference is provided.
  • foreground_prompt: Description of the subject, to prevent background elements bleeding into it.
  • preserve_original_subject: How much to overlay the original subject to match the input (0-1). 1.0 is an exact pixel match.
  • original_background_depth: Controls the generated background to have the same depth as the original subject image (0-1).
  • keep_original_background: Whether to keep the background of the original image (relit). (Options: false, true)
  • light_source_direction: Direction of the light source. (Options: above, below, left, right)
  • light_source_strength: Strength of the light source (0-1). Requires light_reference or light_source_direction.
  • negative_prompt: Keywords describing what you do NOT wish to see in the output image. Advanced feature.
  • seed: Random seed for reproducibility. Use -1 (or omit) for a random seed.
  • output_format: Output image format. (Options: jpeg, png, webp)

Quick Reference

To use this model, set: "model": "stability-ai/replace-background-relight"

Featured: No

Documentation: https://hinow.ai/models/stability-ai/replace-background-relight

API Endpoint: https://api.hinow.ai/v1

Back to Models

Stability Replace Background and Relight

stability-ai/replace-background-relight

$0.120
per image

About

Replace Background and Relight swaps the background of a subject — using an AI-generated or uploaded image — while adjusting lighting to match. This is an ASYNC service: it returns a generation id to be polled at results/{id}.

Key Features:

  • Background replacement and AI background generation
  • Relighting with direction/strength and light reference
  • Subject preservation and depth controls

Best For:

  • E-commerce, real estate and product photography
  • Relighting under/over-exposed images

Note: Asynchronous — poll results/{id} for the final image.

Capabilities

Image To Image

Parameters

background_prompt

What you want in the background. Required unless background_reference is provided.

foreground_prompt

Description of the subject, to prevent background elements bleeding into it.

preserve_original_subject

How much to overlay the original subject to match the input (0-1). 1.0 is an exact pixel match.

original_background_depth

Controls the generated background to have the same depth as the original subject image (0-1).

keep_original_background

Whether to keep the background of the original image (relit).

falsetrue
light_source_direction

Direction of the light source.

abovebelowleftright
light_source_strength

Strength of the light source (0-1). Requires light_reference or light_source_direction.

negative_prompt

Keywords describing what you do NOT wish to see in the output image. Advanced feature.

seed

Random seed for reproducibility. Use -1 (or omit) for a random seed.

output_format

Output image format.

jpegpngwebp

Code Examples

curl -X POST https://api.hinow.ai/v1/images \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $HINOW_API_KEY" \
  -d '{
    "model": "stability-ai/replace-background-relight",
    "prompt": "Transform this image into cyberpunk style",
    "images": [
      "https://example.com/image1.jpg",
      "data:image/png;base64,iVBORw0KGgo..."
    ],
    "parameters": {
      "background_prompt": "",
      "foreground_prompt": "",
      "preserve_original_subject": "",
      "original_background_depth": "",
      "keep_original_background": "false",
      "light_source_direction": "above",
      "light_source_strength": "",
      "negative_prompt": "",
      "seed": "",
      "output_format": "jpeg"
    }
  }'