For the complete documentation index, see llms.txt. This page is also available as Markdown.

Background Handling

AI segmentation separates the subject from the background. Can add an alpha channel, replace the background with a solid color or custom image, or apply balancing between foreground and background.

Example

Before

Before — Background Handling

After

After — Background Handling

Parameters

Parameter
Section
Value
Default
Description

BGmode

Config

0 – 4

0

Mode selection (see below)

BGBalmode

Config

0 – 3

0

Balancing: 0 = off, 1 = to first, 2 = strict, 3 = to parameters

ReplacePath

Background

String

Path to a replacement background image (mode 3)

backgroundR

Background

0 – 255

255

Red component for solid-color replacement

backgroundG

Background

0 – 255

255

Green component for solid-color replacement

backgroundB

Background

0 – 255

255

Blue component for solid-color replacement

balanceH

Background

-1.0 – 1.0

0.0

Hue balance adjustment

balanceS

Background

-1.0 – 1.0

0.0

Saturation balance adjustment

balanceV

Background

-1.0 – 1.0

0.0

Value balance adjustment

Modes

Value
Description

0 — Off

No background handling

1 — Alpha channel

Background made transparent

2 — Solid color replacement

Background replaced with backgroundR/G/B

3 — Image replacement

Foreground composited onto ReplacePath

4 — Alpha + solid color

Pre-composited RGBA

Last updated

Was this helpful?