Skip to content

puntorigen/avatar-skills / video-bg-replace

video-bg-replace

Verified

Replace the background of a talking-head clip by matting the speaker (Robust Video Matting on Replicate) and compositing them over a NEW background — a generated/animated B-roll clip, a provided video, or a still image. The speaker layer gets a temporally-stable alpha matte, then ffmpeg lays it over the new background (alpha-mask + original RGB, or green-screen + chromakey), with optional edge feather, grounding drop-shadow and a unifying color grade, while preserving the speaker's original audio. Use when the user wants to swap/replace a video background, put an avatar over a different scene, place an animated video behind a person, key out / matte a talking head, or composite a presenter onto generated B-roll.

FileKindSize
SKILL.mdskill md7.3 KB
scripts/_common.pyscript9.3 KB
scripts/replace_bg.pyscript14.8 KB
scripts/requirements.txtmanifest18 B
scripts/setup_key.pyscript1.6 KB

scripts/setup_key.py

View on GitHub
#!/usr/bin/env python3
"""Store the Replicate API token for the video-bg-replace skill.

Usage:
    python3 setup_key.py YOUR_REPLICATE_API_TOKEN
    python3 setup_key.py --show

The token is shared with the other Replicate-based skills. If a sibling skill
(broll-generator, avatar-talking-video, voice-clone, gpt-image-2, ...) already
has a valid token configured, this skill discovers it automatically and you do
not need to run this. Run it only to set or refresh the token.
"""

import json
import sys
from pathlib import Path

CONFIG_FILE = Path(__file__).resolve().parent.parent / "config.json"


def load():
    if CONFIG_FILE.exists():
        try:
            return json.loads(CONFIG_FILE.read_text(encoding="utf-8"))
        except json.JSONDecodeError:
            return {}
    return {}


def save(config):
    CONFIG_FILE.write_text(json.dumps(config, indent=2) + "\n", encoding="utf-8")


def main():
    if len(sys.argv) < 2:
        print(__doc__)
        sys.exit(1)

    if sys.argv[1] == "--show":
        config = load()
        tok = config.get("replicate_api_token", "")
        if tok:
            print(f"replicate_api_token: {tok[:6]}...{tok[-3:]} (len {len(tok)})")
        else:
            print("No token stored in this skill's config (it may be inherited from a sibling skill).")
        return

    token = sys.argv[1].strip()
    if not token.startswith("r8_"):
        print("Warning: Replicate tokens usually start with 'r8_'. Proceeding anyway.", file=sys.stderr)

    config = load()
    config["replicate_api_token"] = token
    save(config)
    print(f"Replicate API token saved to {CONFIG_FILE}")


if __name__ == "__main__":
    main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall