Nodes/ComfyUI-WJNodes/Composite Global adv
ComfyUI Node

Composite Global adv

Swap which layer is on top without rewiring your graph

By 807502278·Created 2 years ago·Updated 11 months ago· 21
Composite Global adv
  • Options
  • Composite_Basic
Switch_imagefalse
Switch_optionsfalse

The smallest and most single-purpose node in WJNodes' options-chain family for its ImageCompositeMask_adv compositor (see Composite_Basic for how the chain pattern works overall). Composite_Global_adv does exactly two things, both about swapping - and it's genuinely useful for a specific, annoying kind of iteration: "wait, what if the other image were on top instead?"

How it works

Normally, changing which image is the background and which is the surface means rewiring two connections at the compositor node itself. This node lets you flip that from inside the settings chain instead - toggle a checkbox rather than dragging two wires.

Switch_image swaps which image the compositor treats as back and which it treats as surface, without you touching the actual image connections upstream. Switch_options is the companion flip: it swaps which set of edit parameters (position, scale, blend settings, etc., accumulated by the rest of the chain) applies to back versus surface. You'll usually want both on together if you're doing a genuine top/bottom swap - flipping just the images while leaving the parameter assignment as-is will apply the wrong settings to the wrong layer.

The inputs and outputs that matter

  • Switch_image (BOOLEAN, default false) - swap which image is back and which is surface.
  • Switch_options (BOOLEAN, default false) - swap which edit parameters apply to back versus surface.
  • Options (optional) - the chain to extend.
  • Composite_Basic (output) - the updated chain.

Installing it

Via ComfyUI Manager: search ComfyUI-WJNodes, install, restart. Or:

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

Nothing extra needed for this node.

Common issues & troubleshooting

Images swapped but the effect looks wrong (opacity, position, blend mode all seem misapplied). You almost certainly toggled Switch_image without also toggling Switch_options. The two are independent on purpose, but for a straightforward "flip which layer is on top" swap you generally want them moving together.

Nothing visibly changes when you toggle these. Confirm this node's Composite_Basic output is actually part of the chain feeding the compositor - like the rest of this family, it configures a setting rather than doing anything on its own, so a disconnected output means the toggle has no effect regardless of its value.

Only want to test the swap temporarily. That's exactly what this node is for - leave the rest of your chain untouched and just flip these two booleans back and forth to A/B which layer looks better on top, instead of rewiring image connections every time you want to compare.

CategoryWJNode/ImageBlend/options_adv

Inputs (3)

NameTypeDefaultDescription
Switch_imageBOOLEANfalse
Switch_optionsBOOLEANfalse
OptionsoptComposite_Basic

Outputs (1)

NameTypeDescription
Composite_BasicComposite_Basic