video-face-image-replacement

Installation
SKILL.md

Video Face Image Replacement

Use this skill when video faces should be fully covered or replaced with supplied or generated image assets. This is the right workflow for non-human masks such as panda, red panda, horse, cow, giraffe, cat, robot, or avatar heads. Human identity swap models are a different workflow and should only be used with consent.

For multi-person animal masking, see references/multi-person-animal-masks.md for the deeper tracking design, source links, and MVP plan.

Core Rules

  • Use one source image when the user asks for one generated/reused asset. Do not call image generation again unless explicitly requested.
  • For multiple visible people, assign stable distinct animals by identity. Default order: panda, red_panda, horse, cow, giraffe; if more than five people appear, repeat with visible variants such as scarf/color/style.
  • Prefer image-overlay replacement for non-human faces. Human face-swap models such as inswapper_128, Roop, or FaceFusion assume human-to-human identity transfer and are usually wrong for a panda/avatar mask.
  • Preserve the original video and audio. Write a new output file; never overwrite the source.
  • Remove green, white, or other simple generated backgrounds locally and composite with alpha. Key only the background connected to the image border; do not globally remove all white pixels, because that can punch holes through a panda/animal/avatar face.
  • Use accurate face detection first, then tracking or detection reuse for speed. For multiple people, persist identity-to-animal assignments in identity_map.json and reuse that file for rerenders and section clips.
  • For difficult multi-person videos, use keyframe RGB identity masks as a bootstrap: color each person consistently on selected keyframes, parse the masks, then propagate IDs with video object segmentation, optical flow, feature matching, face embeddings, or person tracking.
  • Use user-provided or source-provided girl/boy labels only as style direction. If no label is provided, default to neutral styling or store automatic analysis only as a private style_hint with confidence; do not publish it as a factual gender claim.
  • Validate with sample frames before processing the full video. For multiple people, create a contact sheet showing representative crops, track_id, animal, and style before the final render.
  • For private videos, keep raw source media uncommitted and publish only intentional derived clips.
Installs
1
GitHub Stars
1
First Seen
Oct 19, 2026