// 04 RESTRICTED
spotdiff
A spot-the-difference puzzle generator. YOLO26 finds the objects in a picture, SAM 3.1 cuts an exact mask of each, and five of them (by default) are changed, by a hue rotation inside the mask or by a Qwen-Image 2.1 Turbo edit that recolors, swaps or removes the object. The two images are pixel-identical outside the changed regions, so the answer key is exact, not judged by eye. Scenes come from the image model itself or from your own photos.
How a difference is made
The hue rotation happens in OKLab and needs no diffusion model: seconds per puzzle, and nothing outside the mask moves. Grey and white objects are skipped, since they have no hue to rotate. A model edit works on a padded crop scaled to 768 pixels. A recolor goes back through the object's own mask, so any color the model spilled onto the table stays behind; a swap or a removal changes the outline, so it goes back as a feathered box.
A model edit too faint to find (a mean pixel change under 14 of 255) gets one more try. An object that still yields nothing is passed over for one of the spares picked with it, and a puzzle that ends up short of differences is thrown away. People are never edited, and an object touching one may only be recolored inside its own outline. It runs locally against ComfyUI, with no repository, README or tests yet.