Nodes/comfyui-fvmtools/K2 Region Combine
ComfyUI Node

K2 Region Combine

The merge node for region chains that grow in two places

By ping1979ping·Created 6 months ago·Updated about a month ago· 0
K2 Region Combine
  • regions_a
  • regions_b
  • regions_c
  • regions_d
  • regions

K2 Region Combine does one thing: it merges two (up to four) region chains into a single chain. In the K2 Lab suite of comfyui-FVMtools, region chains are linked lists - each K2 Region's regions output feeds the next one's regions input. That's fine when you build one linear layout, but it breaks down the moment regions come from different places: a couple of hand-drawn K2 Regions plus a few detector boxes from K2 Region from BBox, or a layout you imported as JSON. You can't splice two linked lists together by dragging wires, so this node is the splice.

How to use it

  • regions_a - required, the first chain.
  • regions_b, regions_c, regions_d - optional, additional chains. All four are just region chains; order doesn't change the result's content, only compile order is inherited from each chain's internal order.

The single regions output plugs straight into K2 Compose like any other chain. If you need to combine more than four chains, stack two Combine nodes.

When you actually need it

Two realistic cases. First, mixing manual and automatic boxes: you draw a subject box by hand, run a YOLO detector for a background object, and turn the detector output into regions with K2 Region from BBox - those are two separate chains that only meet at Combine. Second, project workflows: K2 Project Import produces regions, but you often want to add one more box on top without touching the imported layout, so you chain the imported regions through a Combine with your extra box.

There's no real gotcha here - it's a merge, not a blend, and it does exactly what it says. The one thing worth knowing is that regions carry a compile order, and where two chains have overlapping subject boxes, the order inside each chain (and priority on each region) decides which subject claims ambiguous tokens first.

Install

Same as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/ping1979ping/comfyui-FVMtools

Restart ComfyUI, find it under FVM Tools/K2. No extra dependencies, no model files beyond the usual Krea 2 stack.

If you've never merged a region chain, you probably don't need this node yet - the single-chain path of K2 Region → K2 Region → K2 Compose covers most first projects. Keep it in the back of your mind for the day your layout outgrows one chain, which it will.

CategoryFVM Tools/K2

Inputs (4)

NameTypeDefaultDescription
regions_aK2_REGIONFirst region chain.
regions_boptK2_REGIONSecond chain to merge.
regions_coptK2_REGIONThird chain to merge.
regions_doptK2_REGIONFourth chain to merge.

Outputs (1)

NameTypeDescription
regionsK2_REGION