Nodes/comfyui-gits-tracked-identity/GITS Final Artwork Overlay
ComfyUI Node

GITS Final Artwork Overlay

KSampler Can't Draw Your Logo. This Node Puts It Back.

By Niutonian·Created 2 months ago·Updated 2 months ago· 1
GITS Final Artwork Overlay
  • stylized_images
  • aligned_overlay_images
  • overlay_masks
  • face_occlusion_masks
  • final_images
  • final_masks
◄opacity1.00►
◄mask_expand_px0►
◄mask_feather_px0►
◄backplate_opacity0.00►
◄backplate_color463389►

Diffusion models are terrible at logos. Feed a clean ring graphic into KSampler and you'll get back the impression of a ring - wobbly ellipse, letters melted into suggestion, thin lines chewed to nothing. There's no fixing that with more steps. The only fix is to stop asking the sampler to draw your artwork at all.

That's the whole job of GITS Final Artwork Overlay. It runs after the VAE decode, takes the exact artwork the Advanced node already aligned to your faces, and pastes the real pixels back on top. The pack deliberately applies the overlay twice - once as a baked-in proxy before diffusion, once here as literal pixels - for exactly this reason.

What it does with the pixels

The math is a straight alpha composite: overlay * alpha + base * (1 - alpha), done in float, and it's the same composite every time. No blending modes, no surprises.

Before that it shapes the mask, and the "shaping" is where the useful knobs live:

  • mask_expand_px is a genuine dilation when positive (a max-pool) and an erosion when negative (a min-pool). People remember the grow direction and forget shrink exists; shrinking the matte is how you pull the artwork back off a face edge.
  • mask_feather_px is a box blur on the mask. Cheap and effective at 2–8px, mushy at 30.
  • opacity just multiplies the shaped mask, so it fades the whole overlay rather than softening its edge.

There's also an optional backplate. If you wire face_occlusion_masks from the Advanced node and push backplate_opacity above 0, the node first paints a flat plate in backplate_color under the artwork. That default, 463389, is packed RGB - it decodes to #07121D, the same near-black navy the Advanced node bakes into its guide images. It's off by default (backplate_opacity 0), which is right: turn it on only when you want the artwork sitting on solid color instead of on a re-rendered face.

The inputs that matter

Three of the eight required inputs are just wires, and two of them you should never hand-author:

  • stylized_images - whatever came out of your sampler, decoded.
  • aligned_overlay_images and overlay_masks - from GITS Face Tracking + Removal (Advanced). These are the track-aligned artwork and its matte. Make them yourself and you'll be the reason it drifts.
  • mask_expand_px and mask_feather_px - the two you'll actually adjust, usually to kill a halo around hair or a crisp 1px seam.

Two outputs: final_images, which goes to SaveImage or your video combine node, and final_masks - the overlay mask after expand/feather/opacity. That second output is more useful than it looks; it's a clean tracked matte you can reuse anywhere else in the graph.

Install

The pack goes in like any custom node, or just search GITS in ComfyUI Manager:

cd ComfyUI/custom_nodes
git clone https://github.com/Niutonian/ComfyUI-GITS-Tracked-Identity.git
cd ComfyUI-GITS-Tracked-Identity
python -m pip install -r requirements.txt

Restart ComfyUI. On Windows embedded installs, use the interpreter that actually starts ComfyUI:

..\..\python_embeded\python.exe -m pip install -r requirements.txt

This node itself loads no weights. It's pure tensor math, so none of the pack's models matter to it. The Advanced node that feeds it does need face_landmarker.task, face_detection_yunet_2023mar.onnx and big-lama.pt in ComfyUI/models/gits_tracking/, and scripts/download_face_landmarker.py fetches them.

Where people get burned

The compositor is picky in one specific way: batch, height and width must match across stylized_images, aligned_overlay_images and overlay_masks, and it will stop with an explicit error when they don't. That's almost always a resolution change between tracking and decode - an upscale pass after the VAE will do it every time. Match the sizes back up before this node, or run the overlay at the tracked resolution and upscale after.

Two smaller ones. Dropping opacity to 0.7 doesn't give you a gentler blend, it gives you a ghost - the artwork visible over the face and the face visible through the artwork. If you want a softer look, feather the mask instead. And if the whole frame looks recolored rather than just the face hole, that's not this node: the pack's older LaMa path had a global tint bug that the current builds fix by restoring original RGB outside the face mask. A tone difference inside the masked area is just Big-LaMa's guess at what was behind the face.

The packaged workflows/gits_core_image_batch.json wires Advanced straight into this node with nothing else in between - the fastest way to see what "exact pixels after decode" should look like.

CategoryGITS/Compositing

Inputs (9)

NameTypeDefaultDescription
stylized_imagesIMAGE—
aligned_overlay_imagesIMAGE—
overlay_masksMASK—
opacityFLOAT1.000–1—
mask_expand_pxINT0-128–128—
mask_feather_pxINT00–128—
backplate_opacityFLOAT0.000–1—
backplate_colorINT4633890–16777215—
face_occlusion_masksoptMASK—

Outputs (2)

NameTypeDescription
final_imagesIMAGE—
final_masksMASK—