Nodes/RC Image Compositor/RC Image Compositor (Complete)
ComfyUI Node

RC Image Compositor (Complete)

The whole Photoshop layer stack in one node

By kj863257·Created 11 months ago·Updated 10 months ago· 16
RC Image Compositor (Complete)
  • overlay
  • background
  • IMAGE
x_percent100
y_percent0
x_alignfrom_right
y_alignfrom_top
x_offset50
y_offset50
scale_moderelative_to_background_width
scale0.30
rotation0
opacity0.70
blend_modenormal
flip_hfalse
flip_vfalse
blend_if_data{"channel": "gray", "this_layer": {"black": [0.0, 0.0], "white": [1.0, 1.0]}, "underlying_layer": {"black": [0.0, 0.0], "white": [1.0, 1.0]}}

This is the node the whole pack is named after, and it's the one you'll actually build workflows around. RC Image Compositor (Complete) is a single node that does what a Photoshop layer stack does - position an overlay, scale it, rotate it, flip it, set its opacity, and blend it onto a background with any of 24 Photoshop-identical blend modes. If you've ever tried to place a logo or watermark in ComfyUI using a pile of padding, cropping, and arithmetic nodes, you already know why this exists.

The killer feature is the positioning system. ComfyUI's stock compositing nodes have a notorious negative-offset headache - place an element near the right edge and you're fighting pixel math. This node's x_align/y_align system (from_left/from_right, from_top/from_bottom) lets you anchor against an edge and push inward with a clean pixel offset. Right-edge tight fit is literally x_percent=100, x_align=from_right, x_offset=0. No negative numbers, no surprises.

How it works

The blend modes are the real deal - the readme claims they're mathematically identical to Photoshop's, and the HSL modes (hue, saturation, color, luminosity) are implemented with proper RGB↔HSL conversion rather than cheap approximations. All 24 are there: the darken family, lighten family, contrast family, comparative modes, and the four HSL modes.

Positioning is percentage + alignment + offset: x_percent/y_percent place you 0–100 across the canvas, x_align/y_align pick which edge you measure from, and x_offset/y_offset fine-tune in pixels. Scaling has three reference modes: relative to the overlay itself, or relative to the background's width or height - so scale=0.3 with relative_to_background_width always means "30% as wide as the background," regardless of input sizes.

The inputs that matter

  • overlay - the image you're placing.
  • background (optional) - if you leave it empty, the node creates a transparent canvas sized to the overlay, which is handy for effect-only passes.
  • x_percent / y_percent / x_align / y_align / x_offset / y_offset - the positioning stack above.
  • scale_mode / scale - sizing; use relative_to_background_width for predictable results.
  • rotation / opacity / flip_h / flip_v - the transforms.
  • blend_mode - all 24; normal is the default, multiply and screen are your daily drivers for text and light effects.
  • blend_if_data - a JSON string for Photoshop's Blend If, masking the overlay by channel luminance. Powerful, fiddly, and easy to ignore until you need it - the default JSON is a sensible no-op.

Output is a single IMAGE tensor, ready to feed a save or more processing.

How to install it

It's the flagship of the RC Image Compositor pack:

cd ComfyUI/custom_nodes
git clone https://github.com/kj863257/ComfyUI_RC_Image_Compositor
cd ComfyUI_RC_Image_Compositor
pip install -r requirements.txt

Restart ComfyUI, or search "RC Image Compositor" in ComfyUI Manager. Deps: pillow, numpy, opencv-python. Nothing to download, nothing to license.

Common issues

Three things bite people. First, blend_if_data is a JSON string and it will happily error if you mangle a bracket - if you're not actively using Blend If, leave the default alone. Second, the anchor-based positioning assumes you understand which edge you're measuring from; switching x_align after setting x_offset moves the element by that offset in the opposite direction, which confuses people until they internalize it. Third, if the overlay doesn't have an alpha channel, blend modes like multiply and screen still work but transparent-placed elements need an RGBA input - use the pack's RC Load Image (Alpha) for that.

For the record: this node is why you installed the pack. The Drop Shadow, Stroke, and Outer Glow nodes handle the layer styles, the adjustments handle the grade, and this one does the compositing itself.

CategoryRC/Image

Inputs (16)

NameTypeDefaultDescription
overlayIMAGE
x_percentINT1000–100Horizontal percentage (0=left, 50=center, 100=right)
y_percentINT00–100Vertical percentage (0=top, 50=center, 100=bottom)
x_alignCOMBOfrom_rightHorizontal alignment: - from_left: Calculate offset from left - from_right: Calculate offset from right (enables tight right alignment)
y_alignCOMBOfrom_topVertical alignment: - from_top: Calculate offset from top - from_bottom: Calculate offset from bottom (enables tight bottom alignment)
x_offsetINT50-10000–10000Horizontal offset pixels, can be negative (use with alignment)
y_offsetINT50-10000–10000Vertical offset pixels, can be negative (use with alignment)
scale_modeCOMBOrelative_to_background_widthScaling mode: - relative_to_overlay: scale by overlay's size - relative_to_background_width: width = scale × bg width - relative_to_background_height: height = scale × bg height
scaleFLOAT0.300.01–10Scale factor, reference depends on 'scale_mode'
rotationFLOAT0-180–180Rotation angle in degrees
opacityFLOAT0.700–1Opacity (0=transparent, 1=opaque)
blend_modeCOMBOnormalComplete Photoshop Blend Modes: normal: Normal - Direct overlay darken: Darken - Select darker pixels multiply: Multiply - Colors multiply to darken color_burn: Color Burn - Darken with increased contrast linear_burn: Linear Burn - Linear darkening lighten: Lighten - Select brighter pixels screen: Screen - Inverse multiply to lighten color_dodge: Color Dodge - Lighten with reduced contrast linear_dodge: Linear Dodge - Direct addition to lighten overlay: Overlay - Combines multiply and screen soft_light: Soft Light - Gentle contrast enhancement hard_light: Hard Light - Strong contrast enhancement vivid_light: Vivid Light - Extreme contrast effect linear_light: Linear Light - Linear contrast adjustment pin_light: Pin Light - Replace colors based on brightness hard_mix: Hard Mix - Creates solid color results difference: Difference - Absolute difference of colors exclusion: Exclusion - Softer difference effect subtract: Subtract - Direct color subtraction divide: Divide - Color division operation hue: Hue - Change only hue, keep saturation & lightness saturation: Saturation - Change only saturation color: Color - Change hue & saturation, keep lightness luminosity: Luminosity - Change only lightness
flip_hBOOLEANfalseFlip horizontally
flip_vBOOLEANfalseFlip vertically
blend_if_dataSTRING{"channel": "gray", "this_layer": {"black": [0.0, 0.0], "white": [1.0, 1.0]}, "underlying_layer": {"black": [0.0, 0.0], "white": [1.0, 1.0]}}Blend color band settings (JSON format)
backgroundoptIMAGEBackground image. If not provided, creates transparent background matching overlay size

Outputs (1)

NameTypeDescription
IMAGEIMAGE