Abstract
Image edit models (restoration, colourisation, relighting, detailing) often return a region that should have stayed the same with its shape slightly changed: an eye a little higher, a jaw a little wider. On a face, a change well under one percent of its size can make the person look subtly different, yet it is too small to see side by side, and a difference image shows the texture the edit rewrote. This disclosure describes a method that (1) measures that change, called drift, by following several hundred points of a masked region from the original into the edit with dense optical flow, removing the region's overall move, scale and turn, and reporting what is left as a percentage of the region's size against a measured noise floor; (2) repairs it with a smoothed thin-plate-spline warp that fades to nothing outside the region; and (3) aligns a regenerated part of an image with the original before pasting it back, so the paste shows no doubled edges. It also describes why alignment on three or six points and facial landmark detectors cannot measure drift this small, a validation against warps of known size, variations of every step, and uses. Because the result is a number on a fixed scale, the uses include automated pipelines and AI agents that check, repair or regenerate edits without a person looking, and the screening of training data for image models. An open-source implementation is available as ComfyUI custom nodes.
Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 License.
Recommended Citation
fixed-42, fixed-42, "Measuring and repairing the shape change an image edit leaves in a chosen region, using dense optical flow, and aligning a regenerated region with its original before pasting it back", Technical Disclosure Commons, ()
https://www.tdcommons.org/dpubs_series/12997