# AI Image alignment solution for Qwen Image 2.1 Edits — retained record

> Retained reddit record from reddit:StableDiffusion.

Canonical: https://highsignal.app/data/records/b27ce30e48376ea7

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:StableDiffusion)  published 2026-10-12 03:20 ingested 2026-10-13 02:40

[original source ↗](https://www.reddit.com/r/StableDiffusion/comments/1x3r7yp/ai_image_alignment_solution_for_qwen_image_21/)

## retained text



```
I designed a node to align any pair of images trying to correct the pixel drift on Qwen Image 2.1

[https://github.com/zuanfilm/Qalign](https://github.com/zuanfilm/Qalign)

[workflow](https://github.com/zuanfilm/Qalign/tree/main/workflows)

This node don't need any model or text encoder

Qalign is a node for geometrically aligning an enhanced or generated image to a reference image while preserving the source image's appearance, so can be used for align Qwen Image 2.1 Edits

I know there are other nodes solving this but with my approach you can basically align images with crazy differences in position , rotation and warp with automatic estimation when images share enough recognizable structures

I implemented an automatic mode but if you feel adventurous you can change all the parameters

You can find my recommended parameters for normal Qwen Edits in the last image posted

In the first stage I use automatic global estimation: ORB, ratio test, and RANSAC

In computer vision, ORB, ratio test, and RANSAC form a foundational, three-step pipeline used to match two different images of the same object or scene (such as for panorama stitching, object tracking, or 3D mapping)

ORB (Oriented FAST and Rotated BRIEF) detects keypoints and computes compact binary descriptors. QAlign requests up to 10,000 keypoints.

RANSAC (Random Sample Consensus) affine estimation estimates a global affine transform while rejecting correspondences inconsistent with the dominant transformation.

Qalign uses a 3-pixel reprojection threshold, up to 5,000 iterations, 0.995 confidence, and 20 refinement iterations.

Hybrid and Affine paths use phase correlation to obtain an initial translation estimate and then refine the transformation with multi-scale ECC (Enhanced Correlation Coefficient) image alignment

And to ensure success on complex alignments I implemented Anisotropic X/Y scale and optional local correction with Farneback dense optical flow
```



document fetched 2026-10-13 00:33 · canonical https://reddit.com/r/StableDiffusion/comments/1x3r7yp/ai_image_alignment_solution_for_qwen_image_21
