Anatomy Fix: fix fingers, limbs, eyes and teeth by hand
Version 0.2.0. New: Soft edges, and a Draft node for ComfyUI (both suggested in the comments). Feedback and bug reports are very welcome.
ADetailer finds an area by itself and regenerates it, and the redrawn hand often has a different mistake: six fingers become four. Anatomy Fix does the opposite: you mark the spot and say what should be there. The tool draws a rough draft into the mask (five tapered fingers where you drew five strokes, an iris where you placed it, a copy of the good earring where the bad one is), and the checkpoint you already have loaded blends it in with an inpainting pass. No detectors, no extra models.
One download, two hosts: an extension for AUTOMATIC1111, Forge and reForge, and a custom node for ComfyUI.
What it fixes
Extra, fused or missing fingers and toes
Extra or twisted limbs
Mismatched eyes, crooked teeth
Paired details of clothing and gear that do not match: buttons, straps, earrings
Tools
Bones: one stroke per finger, toe or limb (with a joint). Tapered drafts in the color and light of the skin or sleeve next to them. The count and the positions come from your strokes. Fan makes the five bones of a hand or a foot from one line.
Erase: a small area is painted over with the surface around it; a large one (an extra arm) gets a background pass of its own, with hands and people kept out of it.
Split: a crease between fused fingers.
Donor: a good fragment of the same image (a finger, an eye, a button, an earring) put in place of the bad one, matching size and tilt, mirrored or not, as many copies as you need.
Templates: an eye from its corners and the iris, with a gaze handle for both eyes; teeth from the corners of the mouth and the lips.
Guide: the same marks as a ControlNet guide: depth, skeleton (OpenPose style) or outline.
3D hand and foot: built and rasterized by the extension itself, with poses (open, relaxed, fist, point, peace, thumbs up, grip), a bend for each finger, turn and tilt; drawn as the draft and as its guide.
Variants: several seeds per run, ranked by fingertip count, the symmetry of two eyes or the likeness of copies. A hint, not a judge.
Soft edges: the pass repaints each pixel as strongly as the strength map says, so the drawn parts fade into the picture instead of ending at the edge of a patch (soft inpainting in A1111 1.8+, Forge and reForge; Differential Diffusion in ComfyUI).
The draft shows live in the editor before the model runs, and the editor is the same in both hosts.
How to use
Generate an image and press the hand icon in the row of tools under Generate (or the ✋ button under the gallery). The editor opens over the page with the image.
Paint the mask over the bad spot.
Pick a tool and draw: a bone stroke for each finger that should be there, a donor from the good earring to the bad one, the corners of an eye.
Press Run, pick the best variant and press To gallery or Save.
ComfyUI
Add the Anatomy Fix node (image/postprocessing) after VAE Decode and connect the image, the checkpoint's model, CLIP and VAE, the prompt the picture was made with, and, for a Guide, a ControlNet. Queue the workflow once so the node has the image, then press Open editor on the node, mark what to fix and close it. Everything is kept in the node: queue again and it runs the passes. It returns the variants best first, the draft and the mask; turn on differential_diffusion for soft edges.
For an inpaint model or a detailer of your own, use the Anatomy Fix Draft node instead: the same editor, no pass. It returns the draft, the mask and the strength map, which works as the mask of a Differential Diffusion pass at a denoise of 1.0.
Requirements
AUTOMATIC1111, Forge or reForge, or ComfyUI
Nothing extra to install: numpy, opencv and Pillow already ship with both hosts
No models needed: the passes use the checkpoint you have loaded. The Guide uses the ControlNet built into Forge and reForge (or ComfyUI's); a union model (xinsir promax) covers depth, skeleton and outline
Installation
WebUI (A1111, Forge, reForge): open Extensions, then Install from URL, paste https://github.com/KazeKaze93/sd-anatomy-fix and click Install. Restart the UI.
ComfyUI: clone https://github.com/KazeKaze93/sd-anatomy-fix into ComfyUI/custom_nodes and restart ComfyUI, or install Anatomy Fix from the Comfy Registry.
To update, run git pull in the sd-anatomy-fix folder, restart the host and refresh the browser page.
Limits
No guarantee: it raises the odds of a good result, it is not a deterministic edit. Pick among the variants.
Limbs are the riskiest part: the place where the old arm lay is filled from the background prompt, and next to a person that pass can still draw something. Mask only the arm and name what lies behind it.
Very small areas (tens of pixels) fix poorly with any approach.
Erase leaves a flat patch on a busy background (a tree in bloom, a pattern): there, redraw the group of fingers with Bones in a tight mask instead of erasing one. Over sky or a plain wall it works.
Mirror for eyes works front-facing only; use the eye Template in three-quarter views.
Guide needs Forge, reForge or ComfyUI for now, and earns its keep at high strength.
The 3D model has one set of proportions; the open hand comes through best, bent fingers hold only partly.
Checked on reForge and ComfyUI with anime pictures; AUTOMATIC1111 and Forge are expected to work but are not tested yet.
More
The complete guide, every tool step by step: Anatomy Fix: the complete guide.
Full documentation, the roadmap and the source: github.com/KazeKaze93/sd-anatomy-fix. Found a bug or want a feature? Open an issue on GitHub or leave a comment here.
The code is AGPL-3.0. Images you fix with this tool are yours.
Description
Soft edges. The pass can repaint each pixel as strongly as the strength map says, so the drawn parts fade into the picture instead of ending at the edge of a patch. In AUTOMATIC1111 1.8+, Forge and reForge it uses the host's soft inpainting (the Soft edges switch under Model pass); in ComfyUI, Differential Diffusion (the differential_diffusion switch on the node).
Anatomy Fix Draft node for ComfyUI: the same editor, no pass. It returns the draft, the mask and the strength map, for an inpaint model or a detailer you already trust; the strength map works as the mask of a Differential Diffusion pass at a denoise of 1.0.
Both were suggested in the comments: thank you.


