Communitygithub.com

FilippTrigub/abra

透過 Wan2.1-VACE 修復,使用文字提示編輯影片的特定區域。支援兩種模式:背景(透過 rembg 自動分割)或區域(以分數定義的矩形)。需要至少 8 GB 可用 VRAM 的 CUDA GPU。

abra 是什麼?

此技能利用 Wan2.1-VACE-1.3B 擴散模型,根據文字提示編輯影片每一幀的遮罩區域。使用者可以描述期望的編輯結果,模型會修復遮罩區域,同時保持其餘部分不變,並保留原始音訊。它支援兩種遮罩模式:「背景」模式會自動偵測並替換影片主體的背景;「區域」模式則允許使用者指定一個矩形區域(使用分數座標)進行編輯。此技能需要 CUDA GPU 且至少 8 GB 可用 VRAM,並在首次執行時從 HuggingFace 下載模型權重(約 3 GB)。它適合用於替換談話性影片的背景、編輯影片中的特定矩形區域(如天空、標誌、螢幕),或在不影響主體的情況下改變環境細節。工作流程包括引導使用者提供提示、選擇遮罩模式、調整強度等參數,然後執行編輯並報告結果。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/FilippTrigub/abra/tree/HEAD/skills/video-editor

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

cutlab — AI 影片區域編輯

使用 Wan2.1-VACE-1.3B 擴散模型編輯影片每一幀的遮罩區域。在文字提示中描述期望的結果;模型會修復遮罩區域,同時保持其餘部分不變。音訊會被保留。

技能目錄(此 SKILL.md 所在位置)以下稱為 $SKILL_DIR。

需要 GPU。 需要至少 8 GB 可用 VRAM 的 CUDA GPU。 執行前請暫停 LLM 上下文以釋放 VRAM。


使用時機

當使用者想要以下情況時使用此技能:

  • 替換談話性影片的背景為不同的場景
  • 編輯影片的矩形區域(天空、標誌、螢幕等)
  • 在保留主體的同時改變環境細節

設置(僅首次執行)

cd "$SKILL_DIR" && uv sync

Wan2.1-VACE-1.3B 模型權重會在首次執行時從 HuggingFace 下載(約 3 GB)。rembg 模型權重也會在首次執行背景模式時下載。


代理工作流程

1. 詢問使用者

在我編輯影片前,我需要知道:

💬 提示詞(必要)
   描述編輯後的區域應看起來如何,例如:
   "現代辦公室,有落地窗和城市景觀"

🎭 遮罩模式
  - background  — 自動偵測並替換背景  [預設]
  - region      — 編輯矩形區域(x1,y1,x2,y2 作為 0.0–1.0 的分數)

📐 如果模式=region:mask_region
   格式:"x1,y1,x2,y2",例如 "0.0,0.0,1.0,0.3" 表示畫面上方 30% 的區域

⚙️ 強度(0.0–1.0,預設 0.85)
   編輯應用的強度。數值越低,越忠於原始畫面。

📁 輸入/輸出目錄(預設:./input 和 ./output)

等待使用者回應後再繼續。

2. 編輯 config.json

根據使用者的選擇,寫入或更新 $SKILL_DIR/config.json。

3. 執行

cd "$SKILL_DIR" && uv run python scripts/vace.py --config config.json

4. 回報結果

告知使用者輸出的檔案路徑、使用的遮罩模式以及應用的提示詞。


設定參考

Key值預設值說明
input_dir路徑./input包含輸入影片的資料夾
output_dir路徑./output目標資料夾
prompt字串(必要)期望編輯區域的描述
negative_prompt字串"worst quality, blurry, distorted"要避免的內容
maskbackground, regionbackground遮罩策略
mask_region"x1,y1,x2,y2"(如果 region 則為必要)以分數表示的矩形
strength浮點數 (0, 1]0.85修復強度
num_inference_steps整數30擴散步數
guidance_scale浮點數5.0提示詞遵循度
batch_size整數8每次推理批次處理的影格數(較低值可減少 VRAM 使用)
max_proc_dim整數384修復前的最大影格尺寸(較低值可減少 VRAM 使用)
modelHuggingFace IDWan-AI/Wan2.1-VACE-1.3B-diffusers要使用的模型

常用指令

# 自動替換背景
cd "$SKILL_DIR" && uv run python scripts/vace.py \
  --prompt "serene mountain lake at sunset"

# 編輯矩形區域(上方三分之一 = 天空替換)
cd "$SKILL_DIR" && uv run python scripts/vace.py \
  --mask region --mask-region "0.0,0.0,1.0,0.33" \
  --prompt "clear blue sky with scattered clouds"

# 較輕的編輯(保留更多原始細節)
cd "$SKILL_DIR" && uv run python scripts/vace.py \
  --prompt "cosy home office" --strength 0.6

# 自訂目錄
cd "$SKILL_DIR" && uv run python scripts/vace.py \
  --input /path/to/videos --output /path/to/edited \
  --prompt "futuristic cityscape"

輸出

每個輸入影片會在 output_dir 中產生一個同名的 .mp4 檔案。原始音訊會被重新封裝回去。


錯誤處理

  • VRAM 不足 → 顯示所需與可用的 GB 數,提供釋放 VRAM 的建議,然後退出
  • 沒有 CUDA GPU → 顯示清楚的錯誤訊息,然後退出
  • input_dir 中沒有影片 → 顯示清晰的訊息,然後退出
  • 無效的 mask_region 格式 → 顯示包含預期格式的清楚錯誤訊息,然後退出
  • 個別影片錯誤 → 記錄錯誤;其他影片繼續處理

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

FilippTrigub/abra

>- Animate a still image into a short video clip using fal.ai's LTX-2.3 Fast image-to-video model in the cloud. No GPU required - runs entirely on fal.ai serverless infrastructure.

FilippTrigub/abra

>- Auto-describe and caption images using a local vision-language model. Writes a JSON sidecar per image containing a one-sentence description, a suggested Instagram caption with hashtags, and detected content tags.

FilippTrigub/abra

>- Animated caption pipeline. Use this skill when the user wants to burn word-by-word animated captions into videos — using Whisper for transcription and pycaps for rendering. Supports default minimalist style or a futuristic CSS theme with alternating gold/magenta glowing words.

FilippTrigub/abra

>- Cut videos into segments, rearrange them, and produce an output video with a specific cuts-per-second rate. Uses MoviePy for video manipulation. Prioritizes audio transcription for timestamped cutting, falls back to adaptive scene detection.

FilippTrigub/abra

>- Video enhancement pipeline. Use this skill when the user wants to sharpen, colour grade, warm, or normalise the audio of videos — including presets for natural, cinematic, or vivid looks.

FilippTrigub/abra

Generate videos from text or images using Higgsfield's multi-model cloud platform. Supports kling, seedance, dop, and dop-preview models. Uses a small preset layer for common creative styles. Auto-detects text-to-video or image-to-video based on input. No GPU required.

FilippTrigub/abra

>- Remove the background from every frame of a video using AI (BiRefNet-general via rembg). Outputs transparent-background video or composites onto a solid colour or image. Requires a CUDA GPU with at least 3 GB free VRAM.

相關技能