Generated reference · ComfyUI workflow · Utility & post

Intelligent Background Removal

Remove or replace image backgrounds using AI-powered segmentation with multiple output options

Utility & post10nodesGPU A4000out unspecified~30sv1.0.0

On this page
10Graph nodes
8Node classes
13Inputs
0Models

Tags: utilitybackgroundremovalsegmentationcutoutmask

Inputs (13)#

The typed parameter surface callers bind when they request this workflow. Enum options and numeric bounds are the values the workflow document declares.

input_imageimagerequired
Image to process
removal_methodenumdefault auto
Background removal method
options: autorembgsamu2netisnet
output_modeenumdefault transparent
What to do with the background
options: transparentsolid_colorgradientblur_originalreplace_image
solid_colorstringdefault #FFFFFF
Solid color for background (if selected)
gradient_colorsstringdefault #000000,#333333
Gradient colors (comma-separated)
gradient_directionenumdefault vertical
Direction of gradient
options: verticalhorizontalradialdiagonal
blur_strengthintegerdefault 25
Blur strength for blur_original mode
replacement_imageimage
Replacement background image
edge_refinementenumdefault medium
Level of edge refinement
options: nonelightmediumheavy
feather_edgesbooleandefault true
Feather edges for smoother blending
feather_amountintegerdefault 3
Amount of edge feathering
preserve_shadowsbooleandefault false
Attempt to preserve shadows
output_formatenumdefault png
Output format (PNG/WebP for transparency)
options: pngwebp

ComfyUI node graph (10)#

The executable ComfyUI prompt graph: 10 nodes across 8 distinct node classes, wired by 12 data dependencies. Nodes tinted green come from a custom node pack this workflow declares; the rest are ComfyUI core / baked-community classes.

flowchart TD n0["1: LoadImage"] n1["2: LoadImage"] n2["3: RemoveBackground"] n3["4: MaskRefinement"] n4["5: MaskFeather"] n5["6: ShadowPreservation"] n6["7: BackgroundGenerator"] n7["8: CompositeImage"] n8["9: SaveImage"] n9["10: SaveImage"] n0 -->|image| n2 n2 -->|mask| n3 n3 -->|mask| n4 n0 -->|image| n5 n4 -->|mask| n5 n0 -->|original_image| n6 n1 -->|replacement_image| n6 n2 -->|foreground| n7 n6 -->|background| n7 n5 -->|mask| n7 n7 -->|images| n8 n5 -->|images| n9 classDef custom fill:#12b886,stroke:#0b6b4f,color:#04110c; class n2,n3,n4,n5,n6,n7 custom;
Data-flow DAG — scroll to zoom, drag to pan.

Nodes (10)#

1LoadImagecore
image = {{input_image}} tmpl
outputs: IMAGEMASK
2LoadImagecore
image = {{replacement_image}} tmpl
outputs: IMAGEMASK
3RemoveBackgroundcustom pack
image = ◂ node 1 · out[0]method = {{removal_method}} tmplthreshold = 0.5
outputs: IMAGEMASK
4MaskRefinementcustom pack
mask = ◂ node 3 · out[1]iterations = {{refinement_configs[edge_refinement].iterations}} tmplthreshold_adjust = {{refinement_configs[edge_refinement].threshold_adjust}} tmpl
outputs: MASK
5MaskFeathercustom pack
mask = ◂ node 4 · out[0]amount = {{feather_amount}} tmplenabled = {{feather_edges}} tmpl
outputs: MASK
6ShadowPreservationcustom pack
image = ◂ node 1 · out[0]mask = ◂ node 5 · out[0]enabled = {{preserve_shadows}} tmpl
outputs: IMAGEMASK
7BackgroundGeneratorcustom pack
mode = {{output_mode}} tmploriginal_image = ◂ node 1 · out[0]replacement_image = ◂ node 2 · out[0]solid_color = {{solid_color}} tmplgradient_colors = {{gradient_colors}} tmplgradient_direction = {{gradient_direction}} tmplblur_strength = {{blur_strength}} tmpl
outputs: IMAGE
8CompositeImagecustom pack
foreground = ◂ node 3 · out[0]background = ◂ node 7 · out[0]mask = ◂ node 6 · out[1]
outputs: IMAGE
9SaveImagecore
images = ◂ node 8 · out[0]filename_prefix = bg_removed
10SaveImagecore
images = ◂ node 6 · out[0]filename_prefix = mask_output

Parameter banks (2)#

The prompt / configuration lookup tables this workflow keys into from its inputs — the vocabulary that turns a style / palette / preset selection into graph parameters.

method_configs (5)#

auto
{"description": "Automatically select best method"}
rembg
{"description": "Fast general-purpose removal"}
sam
{"description": "Segment Anything Model - precise segmentation"}
u2net
{"description": "U2-Net - good for people and products"}
isnet
{"description": "IS-Net - excellent edge detection"}

refinement_configs (4)#

none
{"iterations": 0, "threshold_adjust": 0}
light
{"iterations": 1, "threshold_adjust": 0.1}
medium
{"iterations": 2, "threshold_adjust": 0.15}
heavy
{"iterations": 3, "threshold_adjust": 0.2}

Models & dependencies#

Custom node packs (6)#

The non-core ComfyUI node classes this graph requires; the RunPod worker image the workflow runs on must bake or install a pack that provides every one of them.

BackgroundGeneratorCompositeImageMaskFeatherMaskRefinementRemoveBackgroundShadowPreservation

Output contract#

What a successful run of this workflow returns.

primary
{"type": "image", "format": "png", "channels": 4, "description": "Image with new/removed background"}
mask
{"type": "image", "format": "png", "description": "Extracted mask"}

Taxonomy & routing#

How the control plane classifies this workflow — from the committed workflow-taxonomy-registry.json. It drives the consistency / control surface the agentic director can exercise over the workflow.

assetFamily
mkt-product-packshot-suite
outputPackageProfile
image-single-profile
controlModalities
camera-lockcolor-script-lockcontrolnet-inpaintcontrolnet-segmentationdepth-constraintidentity-adapterlatent-reusemodel-lockpalette-lockpose-constraintprompt-template-lockreference-ensemblesampler-scheduler-lockscene-lockseed-lockstyle-anchor +3 more
consistencyDimensions
environmentcolor-script
notes
Auto-mapped from utility defaults