ComfyUI Node
Estimate foreground (FMLFE)
Estimate the foreground image using Fast Multi-Level Foreground Estimation.
Estimate foreground (FMLFE)
- images
- masks
- foreground
- background
- mask
◄implementationauto►
◄regularization0.0000►
◄n_small_iterations10►
◄n_big_iterations2►
◄small_size32►
◄gradient_weight1.0►
Categoryimage/foreground
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The source image(s) from which to estimate the foreground and background. | |
| masks | MASK | The alpha matte that guides the estimation. White areas are treated as known foreground, black as known background, and gray areas are the semi-transparent regions the algorithm will solve for. | |
| implementation | COMBO | auto | 5 options: auto, cupy, opencl, numba, torch |
| regularizationopt | FLOAT | 0.00000–0.1 | The regularization strength (epsilon). This acts as a smoothness prior. Higher values result in smoother, more blended foreground and background colors, but may lose very fine details. Lower values preserve more detail but can be noisier. |
| n_small_iterationsopt | INT | 101–100 | The number of solver iterations to perform on the lower-resolution levels of the image pyramid. More iterations can improve quality at the cost of speed. |
| n_big_iterationsopt | INT | 21–100 | The number of solver iterations to perform on the higher-resolution (larger) levels of the image pyramid. Fewer iterations are typically needed at high resolution as the details are propagated up from the smaller levels. |
| small_sizeopt | INT | 328–256 | The pixel dimension threshold. Image pyramid levels smaller than this size will use the higher 'n_small_iterations' count, while larger levels will use 'n_big_iterations'. |
| gradient_weightopt | FLOAT | 1.00–10 | Controls how strongly the edges in the alpha matte influence color blending. A higher value makes the algorithm respect the mask's edges more, leading to sharper color boundaries. A lower value allows more color bleeding, an effect similar to increasing regularization. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| foreground | IMAGE | — |
| background | IMAGE | — |
| mask | MASK | — |