Nodes/comfyui-OreX/OreX Image Merging V2
ComfyUI Node

OreX Image Merging V2

Stitch up to 20 images into one canvas — captions, borders, and a target resolution in a single pass

By orex2121·Created about a year ago·Updated 2 days ago· 35
OreX Image Merging V2
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • image7
  • image8
  • image9
  • image10
  • image11
  • image12
  • image13
  • image14
  • image15
  • image16
  • image17
  • image18
  • image19
  • image20
  • image
  • width
  • height
image_number2
merging_modehorizontal
main_resolution_image1
footer_height5.0
font_name
font_size4.0
mode
border_thickness2.0
upscale_methodlanczos
megapixels0.0
caption1
caption2
caption3
caption4
caption5
caption6
caption7
caption8
caption9
caption10
caption11
caption12
caption13
caption14
caption15
caption16
caption17
caption18
caption19
caption20

Before-and-after comparisons, style grids, contact sheets, "here's the whole batch at a glance" - that's the boring half of ComfyUI that nobody ships as a node. OrexImageMergingV2 is the boring half, done well. It takes 2 to 20 images, lays them out horizontally, vertically, or in a grid, adds captions under each one, borders around them, and even forces the whole thing to a target resolution. It's a pure Pillow compositor, so it's instant, uses zero VRAM, and needs no model downloads. You drop it in right before a Save Image node and stop babysitting image editors.

It's part of the comfyui-OreX pack by the Russian duo OreX and Pavel K., a grab-bag of load/save, LLM, and image-utility nodes that's actively developed. Fair warning: the pack's README is stale and only documents the image load/save nodes - it won't tell you this node exists. The code is fine, the docs just lag.

How it works

Everything is proportional to one reference image, which is the thing to understand first. main_resolution_image (default 1) picks which input sets the base width/height, and then all the sizing is relative to that. In horizontal mode every image is scaled to the same height as the main one; in vertical mode they all match its width. The grid modes scale by area instead. The +1 layouts ("grid 2 + 1", "grid 3 + 1") are the collage-style ones - small images stacked on the left, one big "hero" image spanning the right side.

The spacing knobs are all percentages of the base image's height, not pixels: footer_height (default 5), font_size (4), and border_thickness (2). Set the mode color and you get that as the background and border with an auto-picked contrasting text color. Captions only render when the caption string is non-empty and footer_height is above zero - the classic silent-failure combo.

megapixels is the sleeper feature. Leave it at 0 and you get whatever the layout math produces. Set it to, say, 2.0 and it scales the entire final canvas (border, footer, text included) so the total lands at 2 megapixels, re-rasterizing with your chosen upscale_method (lanczos by default). That's how you guarantee a sane output size without doing mental math about your source images.

Inputs and outputs that matter

  • image_number (2–20): how many image slots to expose. The node's frontend adds and removes the image/caption pins automatically when you change it, which is a genuinely nice touch.
  • main_resolution_image: the reference image everything scales from.
  • merging_mode: horizontal, vertical, grid 2/3/4, grid 2+1, grid 3+1.
  • megapixels: target total output size in MP; 0 = off.
  • Optional image1..image20 and caption1..caption20.

Outputs are image (feed straight into Save Image or the pack's own orex Save Image), plus width and height as INTs - handy if you want the filename or downstream math to know the result dimensions.

Install

Via ComfyUI Manager (search "comfyui-OreX"), or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/orex2121/comfyui-OreX

Restart ComfyUI. Dependencies are just Pillow plus soundfile (the latter is for the pack's audio node - the merging node only needs Pillow, which is already there). No models to download.

Common issues

  • Everything comes out tiny. You set main_resolution_image to a low-res input, so the whole layout inherits that scale. Point it at your highest-res image, or just use megapixels and stop worrying.
  • Grid needs all its slots filled. In "grid 3 + 1" with only three images wired, the node quietly outputs just the first image. If a layout looks wrong, check you're feeding everything you asked image_number for.
  • Captions don't appear. footer_height is 0, or the caption is empty. Both are required.
  • Update pain. The README's first line tells users to delete the old comfyui-OreX folder and reinstall when upgrading - stale files from an older version are the known cause of weird behavior.
  • Fonts missing from the font_name dropdown? They ship inside the pack, so a fresh clone fixes it.
CategoryOreX-nodes/Image Merging

Inputs (50)

NameTypeDefaultDescription
image_numberINT22–20
merging_modeCOMBOhorizontal7 options: horizontal, vertical, grid 2, grid 3, grid 4, grid 2 + 1, +1
main_resolution_imageINT11–20
footer_heightFLOAT5.00–100
font_nameCOMBO10 options: impact.ttf, YoungSerif-Regular.ttf, Oswald-Bold.ttf, PixelifySans-Bold.ttf, Caveat-VariableFont_wght.ttf, Roboto-Regular.ttf, +4
font_sizeFLOAT4.00–100
modeCOMBO14 options: white, black, crimson, coral, gold, emerald, +8
border_thicknessFLOAT2.00–100
upscale_methodCOMBOlanczos5 options: nearest-exact, bilinear, area, bicubic, lanczos
megapixelsFLOAT0.00–100
image1optIMAGE
caption1optSTRING
image2optIMAGE
caption2optSTRING
image3optIMAGE
caption3optSTRING
image4optIMAGE
caption4optSTRING
image5optIMAGE
caption5optSTRING
image6optIMAGE
caption6optSTRING
image7optIMAGE
caption7optSTRING
image8optIMAGE
caption8optSTRING
image9optIMAGE
caption9optSTRING
image10optIMAGE
caption10optSTRING
image11optIMAGE
caption11optSTRING
image12optIMAGE
caption12optSTRING
image13optIMAGE
caption13optSTRING
image14optIMAGE
caption14optSTRING
image15optIMAGE
caption15optSTRING
image16optIMAGE
caption16optSTRING
image17optIMAGE
caption17optSTRING
image18optIMAGE
caption18optSTRING
image19optIMAGE
caption19optSTRING
image20optIMAGE
caption20optSTRING

Outputs (3)

NameTypeDescription
imageIMAGE
widthINT
heightINT