Nodes/Depth Layer Rasterizer/Depth Rasterize Layers
ComfyUI Node

Depth Rasterize Layers

Turn an image and depth map into layered paper-cut pieces with flat color styles, depth shadows, optional outlines, and parallax offsets.

By maDcaDDie2000·Created about a month ago·Updated about a month ago· 1
Depth Rasterize Layers
  • image
  • depth_map
  • region_mask
  • background
  • layered_images
  • layer_masks
  • depth_quantized
  • composited_image
  • debug_preview
rasterization_levels12
output_modecomposite
selected_layer0
invert_depthfalse
normalization_modeper_frame
depth_min0.000
depth_max1.000
depth_gamma1.00
depth_blur1.0
temporal_smoothing0.00
layer_smoothing1.0
mask_feather0.50
layer_color_modecolor_zones
color_zones_per_layer4
color_brightness0.00
color_contrast1.00
color_saturation1.00
black_white_threshold0.50
enable_shadowtrue
shadow_distance8
shadow_angle135
shadow_blur6
shadow_opacity0.35
shadow_color_r0.00
shadow_color_g0.00
shadow_color_b0.00
depth_scaled_shadowtrue
enable_outlinefalse
outline_width2
outline_opacity0.50
outline_color_r0.00
outline_color_g0.00
outline_color_b0.00
enable_layer_offsetfalse
offset_x0
offset_y0
Categorydepth/layers

Inputs (40)

NameTypeDefaultDescription
imageIMAGERGB input image or video frame batch to turn into depth-cut paper layers.
depth_mapIMAGEAligned grayscale depth map from a depth node such as Depth Anything.
rasterization_levelsINT122–48Number of depth slices to cut from the image. More slices add depth detail.
output_modeCOMBOcompositeReturn all cut layers, one selected layer, the final composite, masks, or a debug depth preview.
region_maskoptMASKOptional mask limiting where the paper-cut effect is applied.
backgroundoptIMAGEOptional bottom plate for the composite output.
selected_layeroptINT00–47Layer index for single_layer or masks_only output. 0 is the nearest layer after depth normalization.
invert_depthoptBOOLEANfalseSwap near and far if your depth map is reversed.
normalization_modeoptCOMBOper_frameper_frame adapts each image, whole_sequence stabilizes video batches, manual uses depth_min/depth_max.
depth_minoptFLOAT0.000-1000000–1000000Manual minimum depth. Used only when normalization_mode is manual.
depth_maxoptFLOAT1.000-1000000–1000000Manual maximum depth. Used only when normalization_mode is manual.
depth_gammaoptFLOAT1.000.1–4Curve the normalized depth before slicing. Higher values move more pixels toward near layers.
depth_bluroptFLOAT1.00–24Blur the raw depth map before slicing to reduce noisy cut boundaries.
temporal_smoothingoptFLOAT0.000–0.99Blend video depth with the previous frame to reduce flicker.
layer_smoothingoptFLOAT1.00–24Smooth tiny depth islands after normalization for cleaner paper shapes.
mask_featheroptFLOAT0.500–8Soft edge width at layer boundaries. Set 0 for crisp hard cuts.
layer_color_modeoptCOMBOcolor_zonesPaper fill style: original RGB, one average color per layer, color zones, grayscale, or black/white.
color_zones_per_layeroptINT42–24Number of flat color patches inside each depth slice when using color_zones.
color_brightnessoptFLOAT0.00-1–1Brightness adjustment applied after the layer fill mode.
color_contrastoptFLOAT1.000–3Contrast multiplier applied after the layer fill mode.
color_saturationoptFLOAT1.000–3Saturation multiplier applied after the layer fill mode.
black_white_thresholdoptFLOAT0.500–1Luminance cutoff for black_white mode.
enable_shadowoptBOOLEANtrueDrop a blurred offset shadow behind each paper layer in composite mode.
shadow_distanceoptFLOAT80–96Shadow offset distance in pixels.
shadow_angleoptFLOAT1350–360Shadow direction in degrees. 135 casts toward the lower-left.
shadow_bluroptFLOAT60–48Gaussian blur radius for the shadow mask.
shadow_opacityoptFLOAT0.350–1Shadow opacity.
shadow_color_roptFLOAT0.000–1Shadow red channel from 0 to 1.
shadow_color_goptFLOAT0.000–1Shadow green channel from 0 to 1.
shadow_color_boptFLOAT0.000–1Shadow blue channel from 0 to 1.
depth_scaled_shadowoptBOOLEANtrueScale shadow offset by layer depth for a stronger stacked-paper feel.
enable_outlineoptBOOLEANfalseDraw a colored edge around each paper layer.
outline_widthoptINT21–16Outline thickness in pixels.
outline_opacityoptFLOAT0.500–1Outline blend strength.
outline_color_roptFLOAT0.000–1Outline red channel from 0 to 1.
outline_color_goptFLOAT0.000–1Outline green channel from 0 to 1.
outline_color_boptFLOAT0.000–1Outline blue channel from 0 to 1.
enable_layer_offsetoptBOOLEANfalseShift layers by depth for a subtle parallax cutout effect.
offset_xoptFLOAT0-128–128Horizontal parallax strength in pixels.
offset_yoptFLOAT0-128–128Vertical parallax strength in pixels.

Outputs (5)

NameTypeDescription
layered_imagesIMAGELayer images: one batch entry per frame x layer, or the selected/debug image depending on output_mode.
layer_masksMASKLayer masks: alpha masks matching layered_images.
depth_quantizedIMAGEPosterized grayscale depth map showing the cut depth bands.
composited_imageIMAGEFinal stacked paper-cut composite when output_mode is composite.
debug_previewIMAGEFalse-color debug view of depth layer IDs.