Get background mask low level
Get background mask low level — raw model output, no hand-holding
- model
- images
- depths
- masks
- depths
- edges
This is the node you use when you want the model's raw opinion and nothing else. Get background mask low level skips the entire convenience layer - no normalization of your input, no resizing to a model-friendly size, no scaling the mask back up, no threshold. It takes your images, runs them through the network, and hands you the output. If you don't know why you'd want that, you want the normal Get background mask node instead and you can stop reading after the first paragraph.
So who is this for? People doing manual or custom pre/post-processing. The workflow looks like this: you load a model, and the loader gives you train_w, train_h, and norm_params - the training resolution and the exact normalization the model expects. You do that normalization yourself (the README points at the Arbitrary Normalize node from ComfyUI-ImageMisc, which can consume norm_params directly), scale the image to the training size, feed it here, and then handle the output however your pipeline demands. It's the "I'm doing something bespoke" node, and it's deliberately thin.
Inputs
model(SET_REMBG) - from any loader. Note the tooltip warning: images must be normalized to a range the model likes, and sized close to the training resolution. Feed it arbitrary 0–255 images and the results will be nonsense.images(IMAGE) - your pre-processed, correctly-sized images.batch_size- how many to process at once (default 1).depths(optional) - external depth maps for PDFNet.out_dtype(optional) -float16to save RAM on long jobs.
Outputs
masks(MASK) - raw estimated foreground masks.depths(MASK) - depth maps, PDFNet only.edges(MASK) - edge maps, DiffDIS only.
Install
Same pack as everything here:
cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-RemoveBackground_SET
pip install -r ComfyUI-RemoveBackground_SET/requirements.txt
ComfyUI 0.3.48+, seconohe >= 1.0.6 (fresh pip install git+https://github.com/set-soft/seconohe.git if it errors).
The honest framing: this is the pack's "you should know what you're doing" node, and the pack knows it - the description literally says no pre or post processing is applied and points you at Get background mask for the easy path. The reason it exists is the 04_Advanced example workflow, which shows custom pre/post processing that the standard nodes can't express. If you're building a research-y pipeline, matching the author's exact preprocessing, or comparing models on a level playing field, this is your node. For everyone else, it's a good reminder that the friendly nodes in this pack are doing real work for you.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | SET_REMBG | The remove background model from `Load RemBG model by file` or any of the `Load XXXXXX model by name` nodes | |
| images | IMAGE | One or more images to process, they must be normalized to a range that is good for the model. Their size must be similar to the size used to train the model. | |
| batch_size | INT | 11–256 | How many images to process at once |
| depthsopt | MASK | For models that starts with a depth map | |
| out_dtypeopt | COMBO | AUTO | Data type used for the outputs. `AUTO` means the same as the input.Using `float16` can help when processing videos. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| masks | MASK | The estimated masks, where a higher value means the model estimates it belongs to the foreground with more confidence. |
| depths | MASK | The estimated depth map. Either from the `depths` input or computed. Note this applies only to PDFNet. This is the map generated by `Depth Anything V2` |
| edges | MASK | The estimated edges. This is only generated by the DiffDIS model. |