π Unstitch Images
The other half of the stitch-edit-unstitch workflow
- unstitch
- image
- IMAGE
If StitchImages is the "put them together" half of the high-res edit workflow, this node is the "take them apart" half - and it's the one that makes the whole pattern actually work. You stitch two images, edit the composite, and then this node slices the edited composite back along the exact seam that was recorded, so you get the edited version of one half to paste over your original.
The trick that makes it robust: it doesn't re-derive anything from the pixels. It consumes the UNSTITCH metadata that StitchImages emitted, which stores the direction, the original shapes, and any spacing. That's why it can cut the composite apart correctly even after a model has completely redrawn the middle of it - the seam coordinates came from before the edit, not after.
How it works
You feed it the unstitch metadata, the (possibly edited) stitched image, and a selection - "1" for the first image or "2" for the second. It computes the slice ranges from the recorded direction and original sizes, accounts for any spacing block between the halves, and returns the chosen slice as an IMAGE.
Direction matters for the math: for right/down joins the first image occupies the start of the composite; for left/up joins it's flipped, with the second image leading. The node handles that from the metadata, so you don't have to think about it.
Inputs
- unstitch - the metadata output from
StitchImages(orStitchImagesAndMask). - image - the stitched composite, ideally after your edit.
- selection -
"1"or"2", which half you want back.
Output is a single IMAGE.
Install
ComfyUI Manager (search "YarvixPA") or
cd ComfyUI/custom_nodes
git clone https://github.com/YarvixPA/ComfyUI-YarvixPA
restart. Under ComfyUI-YarvixPA/Image/Stitch.
The typical flow
Load a source image, stitch it next to a target or a crop region, run the composite through an inpaint or face-swap model, unstitch the result, and composite the edited half back over the original with your own mask or the pack's mask variant. The one rule that saves you pain: only unstitch a composite that came from a stitch. The metadata is pack-specific, so mixing with another pack's stitch output won't work - and if you ever see a nonsense slice, the first suspect is a missing or rewired unstitch input, because the node will happily compute garbage from wrong metadata rather than error out.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| unstitch | UNSTITCH | β | |
| image | IMAGE | β | |
| selection | COMBO | 2 | Choose which image to output: 1=first, 2=second |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |