凤希AI - 图片拼接
Before-and-after side by side, without leaving ComfyUI
- image1
- image2
- IMAGE
What it's for
You upscaled something and you want to see whether it actually got better. Or you generated four variations and want one contact sheet instead of four Preview nodes. Or you're building a comparison post and want the original on the left, the fix on the right.
FxAiImageConcat (凤希AI - 图片拼接) glues two IMAGE tensors together along one edge. That's all it does, and that's why it's useful - it's a two-node answer in a graph where the alternative is exporting to an image editor and back.
How it works
It's tensor concatenation with a resize path bolted on. With direction on right or left it cats along the width axis; down and up cat along height. Which one goes first is decided by direction, not by order: right and down put image1 first, left and up put image2 first. That looks trivial until you notice it means your comparison layout is a dropdown change rather than a re-wire.
Two details worth knowing because they're where this node differs from the naive version:
match_image_size scales image2 proportionally to image1's height (horizontal joins) or width (vertical joins), using LANCZOS. It doesn't pad and it doesn't crop - the aspect ratio is preserved, so a portrait next to a landscape keeps its proportions and the joined image is simply wider. The author's tooltip is direct about when you need it: sizes differ, turn it on.
Batches get aligned by repeating. If image1 arrives as a batch of 1 and image2 as a batch of 4, the smaller one is repeated to fill and then trimmed to the larger count. So comparing one original against a four-up grid doesn't error, it repeats the original four times.
Inputs and outputs
image1(IMAGE, required)image2(IMAGE, required)direction-right,down,left,up. Defaults toright.match_image_size(BOOLEAN, default off)
Output: one IMAGE, the joined batch. Wire it into Preview Image, Save Image, or further processing.
One quiet nicety: if either input arrives as None (a bypassed upstream node, typically), the node returns the other one unchanged instead of exploding. Handy when you're iterating and something in one branch is muted.
The pattern you'll actually use
Original into image1, upscaled result into image2, direction: right, match_image_size: on, then a Preview. Ten seconds of wiring and you have a permanent A/B panel in your workflow, which beats dragging files around a file manager when you're comparing three upscale settings.
It also pairs well with a batch: run your whole set through both branches, concat, and save one image per pair - one file per comparison instead of two folders you have to cross-reference.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
Restart ComfyUI, or install from ComfyUI Manager by searching fxai-toolkit (publisher fxai). The pack pip-installs soundfile and psutil at import. This node needs no model files - it runs on PIL and torch, both already there.
Where it bites
Mismatched sizes throw, loudly. If heights differ on a horizontal join with match_image_size off, you get a ValueError naming the two heights and telling you to turn the option on. That error message is genuinely good - read it rather than assuming the node is broken.
The batch alignment is silent. Repeating a 1-image batch up to 4 is the right default far more often than not, but if your concat output suddenly has four identical originals next to four results, that's this, not a bug in the sampler.
No padding, no letterboxing. match_image_size preserves aspect ratio, so a 9:16 clip next to a 16:9 frame produces a wide image with a tall thing in it, not two equal panels with black bars. If you want equal canvases, resize both first with FxAiImageScaleDown and concat with match_image_size off.
Node missing after install. This pack registers each node separately and logs ❌[凤希AI] 节点加载失败 for any that fail to import, so a single broken module hides one node without breaking the pack. Check the console, restart, then reinstall.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — | |
| image2 | IMAGE | — | |
| direction | COMBO | right | 4 options: right, down, left, up |
| match_image_size | BOOLEAN | false | 两张图尺寸不同时必须开:把 image2 等比缩到与 image1 同高/同宽后再拼。 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |