ComfyUI Node
Align to Reference (AKAZE)
Auto-aligns a moving image to a reference image using AKAZE feature matching + RANSAC. Corrects the scale + translation (and optional rotation) drift introduced by Qwen-Image-Edit's internal resizing, so the output overlays the source pixel-perfectly. Ideal for line-art / edge-map alignment.
Align to Reference (AKAZE)
- reference
- moving
- aligned
- debug
◄transform_modesimilarity►
◄max_features5000►
◄ratio_threshold0.75►
◄ransac_threshold3.0►
◄edge_preprocessnone►
◄output_debugfalse►
Categoryimage/transform
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| reference | IMAGE | Fixed image (e.g. the colour original the user wants to keep). | |
| moving | IMAGE | Image to align (e.g. the Qwen-generated line-art). | |
| transform_mode | COMBO | similarity | translation = shift only; rigid = shift + rotation; similarity = shift + scale + rotation (recommended); affine = full affine (most flexible, least stable). |
| max_features | FLOAT | 5000500–20000 | Max AKAZE features to detect. Higher = more candidates, slower. |
| ratio_threshold | FLOAT | 0.750.5–0.95 | Lowe ratio test threshold. Lower = stricter matches. |
| ransac_threshold | FLOAT | 3.00.5–20 | RANSAC inlier distance in pixels. Lower = stricter fit. |
| edge_preprocess | COMBO | none | Pre-filter both images to edges before matching. canny/sobel helps a lot when the moving image is line-art and the reference is colour (very different intensities). |
| output_debug | BOOLEAN | false | Also return a side-by-side match visualisation image. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| aligned | IMAGE | The moving image warped onto the reference coordinate system. |
| debug | IMAGE | Optional match visualisation (only when output_debug is on). |