Nodes/Face-Aligned Center/Face-Aligned Fine-Tune
ComfyUI Node

Face-Aligned Fine-Tune

The manual nudge your auto-alignment pipeline was missing

By serhiiyashyn-sf·Created 4 months ago·Updated 4 months ago· 0
Face-Aligned Fine-Tune
  • images
  • images
zoom1.00
dx0
dy0

Auto-alignment gets you 90% of the way. Then a character with an unusual silhouette - enormous hair, a staff, a pose that throws off the silhouette heuristic - lands slightly off-center, and the automatic nodes can't know it's wrong. Face-Aligned Fine-Tune is the manual override: it sits after Face-Aligned Center, shows you the result on an interactive canvas right in the node body, and lets you zoom and nudge until it's right, without re-running the queue for every click.

It's a preview-style node in the same spirit as rgthree's helpers - nothing here generates anything. It passes the image through, adjusted. The clever bit is that the adjustment is dead simple, the UI hides it, and the state management is genuinely thought through.

How it works

Under the hood it's three numeric widgets - zoom (a float, 1.0 default), dx and dy (integers in pixels) - hidden away and driven by a small custom JS widget. On the node body you get a square canvas with a + / zoom stack and a D-pad for nudging. Each button press updates the hidden widget values and re-renders the preview client-side, so iteration feels instant. When you're happy, the node applies the same zoom + translate to every image in the batch.

Two details make it usable in a real pipeline:

  • The grid overlay. A crosshair, diagonals, and a safe-box, toggleable via the grid button in the node. It's drawn in "multiply" mode so it never hides the image, and - importantly - it's view-only. The images output never gets the grid baked in. You verify alignment on the overlay, then use the clean output downstream.
  • Auto-reset on fresh input. The node hashes the first image of each incoming batch per node instance. When a new batch flows in, any stale zoom/nudge is dropped back to neutral. This is the "pipeline running many times never applies last character's adjustments to this character" guard - and it's the thing people expect to fight, until they realize it's exactly the behavior you want.

Edges that show after zooming out or translating are filled with the background color sampled from the corners, so it stays clean rather than black.

Inputs and outputs

The zoom / dx / dy inputs exist and are settable from the node graph (so you can drive them programmatically), but in practice you'll never touch them - they're hidden behind the buttons in the UI. The only real input is images, typically from Face-Aligned Center. The single output, also images, is the adjusted batch - wire it to a Save Image or straight into the rest of your workflow.

One structural thing: it's an output node. That means it'll trigger the queue when you press "run" and ComfyUI treats it as an endpoint. Don't chain generation through it expecting it to flow like a normal node - it's meant to be a preview-and-adjust waypoint, and its temp preview files live under ComfyUI's temp directory (the code deliberately names them per node ID so two Fine-Tune nodes in one workflow don't stomp each other's previews - a real bug it fixed).

Installing

Same as the rest of the pack - ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/serhiiyashyn-sf/comfyui-face-aligned-center
cd comfyui-face-aligned-center
pip install -r requirements.txt

Restart ComfyUI and it appears in the FaceAlignedCenter category. Note the dependency stack (numpy, torch, Pillow, opencv-python, ultralytics) comes from the pack's other nodes, not from this one - this node itself is nearly dependency-free.

Gotchas

  • The auto-reset can confuse you the first time: you nudge a character, re-run, and your adjustments are gone. That's by design, not a bug - stale offsets applied to a different character would be worse.
  • It's one zoom/translate for the whole batch, not per-image. If you need different nudges per frame, you'll want multiple Fine-Tune nodes - which is precisely why they bothered to make node IDs not collide.
  • The README is a touch optimistic calling the preview "no workflow queue per click" - the buttons do update widgets that can trigger a queue. The point is the preview renders instantly client-side; the heavy queue re-run only happens when you actually fire it.

It's a small, honest utility - the manual finishing pass on top of an automatic one. For anyone building repeatable character-sheet pipelines, that last 10% is where a workflow either gets adopted or dies, and this node quietly handles it.

CategoryFaceAlignedCenter

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
zoomFLOAT1.000.1–5
dxINT0-4096–4096
dyINT0-4096–4096

Outputs (1)

NameTypeDescription
imagesIMAGE