Nodes/Loop Strip/Loop Strip — Face-Aligned Center
ComfyUI Node

Loop Strip — Face-Aligned Center

One consistent zoom for the whole character sheet

By serhiiyashyn-sf·Created 5 months ago·Updated 4 months ago· 0
Loop Strip — Face-Aligned Center
  • images
  • mask
  • images
  • masks
  • info
canvas_size1024
face_fill0.18
face_y0.35
use_face_detectionfalse
yolo_modelface_yolov8m.pt
confidence0.35

This is the pack's most ambitious node and the one with the fiddliest settings, so it earns a moment of your attention. Where Center Character centers a single image, Face-Aligned Center takes a whole character sheet - typically all 8 angles of a turnaround, as a batch - and scales every view to the same character size, then pins the face to the same spot on every canvas.

That uniform size is the whole game. A turnaround where the front view is huge and the back view is tiny is useless; this node's core idea is a single batch-wide scale applied to every image, so each angle is physically the same size. Same value of face_fill across calls = same face size across different characters, too.

How it works

Two modes, and the default is the smart one:

Silhouette mode (default, use_face_detection OFF). Assumes a white/plain background. It trims the body silhouette by row density (so stray pixels don't inflate the box), finds the head's horizontal center from the longest contiguous run in the top 30% of the body - robust against swords and sceptres creating separate skinny runs - and derives one scale for the whole batch from the median body height, treating the face as roughly 21% of body height. Every view gets that same scale. Clean results on chibi characters with white backgrounds, zero extra dependencies.

Face-detection mode (use_face_detection ON). This is where it gets heavy. It loads a YOLO face model via ultralytics, runs it on every image, takes the median face height across the batch as the scale reference, and only falls back to silhouette head-cx for views where the face isn't visible (backs, back-3/4s). You get true face-pinned alignment. The catch: ultralytics is not in the pack's requirements, and you must supply a model file - face_yolov8m.pt, face_yolov8s.pt, or face_yolov8n.pt in ComfyUI/models/ultralytics/ (or the bbox/ subfolder). The author's tooltip is honest: only turn it on after you've verified YOLO works well on your character style.

Outputs are images (the aligned sheet), masks, and an info STRING that reports what it detected per view and which scale it used - wire that into a text display and you can audit every decision.

Inputs that matter

  • canvas_size (default 1024) - square output.
  • face_fill (default 0.18) - the zoom knob. Lower = zoom out, higher = zoom in. Keep it constant across runs for consistent sheet-to-sheet sizing.
  • face_y (default 0.35) - where the face sits vertically; 0.35 puts it in the upper third, the usual game-sprite framing.
  • use_face_detection, yolo_model, confidence - the optional YOLO path described above.

Install

Manager → search "Loop Strip" → install, or:

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

Restart. For the default silhouette mode you need nothing beyond the pack's standard requirements (opencv-python, numpy, torch, scipy, requests). Only if you flip on use_face_detection do you additionally pip install ultralytics and drop a face_yolov8*.pt model into the model folder.

The honest warning

Don't turn on face detection just because it sounds better. The default silhouette path is dependency-free and battle-tested for clean-background sheets; YOLO adds install steps, a model download, and a failure mode (a model that doesn't recognize your art style) for what is often no visible gain. Start OFF, and if back views come out misaligned or confidence is low, then experiment with ON and a lower confidence threshold. That's the order that keeps you productive.

CategoryLoopStrip

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE
canvas_sizeINT102464–8192Square output size (pixels).
face_fillFLOAT0.180.02–0.9Zoom knob. Face height as a fraction of the canvas. LOWER = zoom out (smaller character, more empty space). HIGHER = zoom in. Same value across every call = same face size for every character sheet.
face_yFLOAT0.350–1Vertical position of the face center on the canvas (0=top, 1=bottom). 0.35 puts the face in the upper-third.
use_face_detectionBOOLEANfalseOFF (default): always use the silhouette algorithm — head-cx detection from the top of the trimmed body, batch-consistent size. Produces clean results on chibi characters with white BG. ON: also try YOLO face detection where available; batch-median face height drives scale, silhouette head-cx is used as fallback for back views. Only turn on if you've verified face YOLO works well on your character style.
yolo_modelCOMBOface_yolov8m.ptFace-detection model (only used when use_face_detection is ON). Looked up in ComfyUI/models/ultralytics/{,bbox}/...
confidenceFLOAT0.350.05–0.95YOLO confidence threshold (only used when use_face_detection is ON). Lower if sides/3-4 angles aren't being detected.
maskoptMASKOptional foreground mask; overrides white-threshold detection.

Outputs (3)

NameTypeDescription
imagesIMAGE
masksMASK
infoSTRING