video-edit

video-edit

在 RunComfy 上編輯現有影片 — 此技能是一個智慧路由器,會根據使用者意圖匹配 RunComfy 目錄中合適的編輯模型。選擇 Wan 2.7 Edit-Video(一般重新風格化、背景替換、包裝替換,保留身份與動作)、Kling 2.6 Pro Motion Control(將參考影片的精確動作轉移到目標角色),或 Lucy Edit Restyle(輕量級身份穩定的重新風格化、服裝替換)。整合每個模型的文件化提示模式,讓技能獲得更好的編輯效果,避免在錯誤模型上浪費迭代次數。透過本機 RunComfy CLI 呼叫 `runcomfy run <vendor>/<model>/<endpoint>`。觸發關鍵字包括「video edit」、「edit video」、「restyle video」、「swap video background」、「motion control」、「outfit swap video」,或任何明確要求轉換影片的指令。

8星標
2分支
更新於 2026/5/18
SKILL.md
readonlyread-only
name
video-edit
description

Edit existing video on RunComfy — this skill is a smart router that matches the user's intent to the right edit model in the RunComfy catalog. Picks Wan 2.7 Edit-Video (general restyle / background swap / packaging swap, identity + motion preservation), Kling 2.6 Pro Motion Control (transfer precise motion from a reference video to a target character), or Lucy Edit Restyle (lightweight identity-stable restyle / outfit swap). Bundles each model's documented prompting patterns so the skill gets sharper edits without burning iterations on the wrong model. Calls `runcomfy run <vendor>/<model>/<endpoint>` through the local RunComfy CLI. Triggers on "video edit", "edit video", "restyle video", "swap video background", "motion control", "outfit swap video", or any explicit ask to transform a video.

Video Edit — Pro Pack on RunComfy

runcomfy.com · Wan 2.7 Edit-Video · Kling Motion-Control Pro · Lucy Edit Restyle · GitHub

影片編輯,意圖路由。 此技能不限定單一模型 — 它會根據使用者實際需求,從 RunComfy 目錄中選取合適的影片編輯模型:一般重新風格化、從參考片段轉移動作,或輕量級身份穩定的服裝/背景替換。

npx skills add agentspace-so/runcomfy-skills --skill video-edit -g

根據使用者意圖選擇正確模型

使用者意圖 模型 原因
重新風格化談話頭影片 — 保留臉部/姿勢/嘴唇動作 Wan 2.7 Edit-Video 強大的身份+動作保留;支援最高 1080p
替換產品背景,保留攝影機動作 Wan 2.7 Edit-Video 保留攝影機動作;單一方向編輯效果佳
使用參考圖片替換包裝設計 Wan 2.7 Edit-Video + reference_image 參考條件式設計轉移
套用電影級色調/商業質感 Wan 2.7 Edit-Video 擅長單一方向全域外觀改變
將參考影片的精確動作轉移到目標角色 Kling 2.6 Pro Motion Control 專為動作映射設計,保留身份
將目標角色的嘴唇動作與來源影片的嘴唇動作同步 Kling 2.6 Pro Motion Control 專為緊密時間一致性設計
輕量級服裝/戲服替換,保留身份 Lucy Edit Restyle 核心強項是局部身份穩定的編輯
身份穩定的重新風格化(「沙漠中的太空人」、「溫暖的黃金時刻光線」) Lucy Edit Restyle 專精於重新風格化的時間一致性
未指定時的預設值 Wan 2.7 Edit-Video 最多功能,最高解析度

代理會讀取此表格,分類使用者意圖,並選擇下方對應的子章節。

前置需求

  1. RunComfy CLInpm i -g @runcomfy/cli
  2. RunComfy 帳號runcomfy login
  3. CI / 容器 — 設定 RUNCOMFY_TOKEN=<token>
  4. 來源影片 URL — 格式與限制取決於所選路線。

路線 1:Wan 2.7 Edit-Video — 重新風格化/背景/包裝的預設選項

模型wan-ai/wan-2-7/edit-video

欄位結構

欄位 類型 必填 預設值 備註
prompt string 先說明保留目標。每次呼叫只做一個編輯方向。
video string MP4/MOV URL,2–10 秒,≤100MB。
reference_image string URL — 僅用於直接設計/外觀轉移。
resolution enum (輸入) 720p1080p
aspect_ratio enum (輸入) 寬:高。預設為輸入值。
duration int 0 0 = 與輸入相同;2–10 = 從開頭截斷。
audio_setting enum auto autoorigin(保留來源音訊)。
seed int 可重現性。

執行

背景替換,保留身份,保留音訊:

runcomfy run wan-ai/wan-2-7/edit-video \
  --input '{
    "prompt": "Preserve the speaker'\''s face, pose, and lip movement; change the background to a modern office with neutral lighting.",
    "video": "https://.../speaker.mp4",
    "audio_setting": "origin"
  }' \
  --output-dir <absolute/path>

使用參考圖片替換包裝:

runcomfy run wan-ai/wan-2-7/edit-video \
  --input '{
    "prompt": "Maintain the original framing and hand movement; replace the packaging design using the reference image.",
    "video": "https://.../hand-holding-package.mp4",
    "reference_image": "https://.../new-packaging.png",
    "audio_setting": "origin"
  }' \
  --output-dir <absolute/path>

提示技巧

  • 先說明保留目標"Preserve [face / pose / motion / framing / lip movement]; [then state the change]"
  • 每次呼叫只做一個編輯方向。複合編輯會導致動作偏移。
  • reference_image 僅在必要時使用(包裝替換、有目標視覺的服裝替換)。一般重新風格化不需要傳入參考。
  • audio_setting: "origin" 用於談話頭影片,避免重新生成音軌。
  • 來源影片限制:2–10 秒,≤100MB。

路線 2:Kling 2.6 Pro Motion Control — 當重點是從參考片段轉移動作時

模型kling/kling-2-6/motion-control-pro

當使用者想要將參考影片的動作轉移到目標角色(由圖片或另一部影片驅動)時使用。這不是重新風格化 — 而是保留身份的動作映射。

欄位結構

欄位 類型 必填 備註
prompt string 描述目標動作/風格。
image string 是(圖片導向) 角色/背景一致性的參考。
video string 動作參考。10–30 秒,取決於導向。
keep_original_sound bool 保留參考影片的音訊。
character_orientation enum image(最長 10 秒輸出)或 video(最長 30 秒輸出)。

執行

runcomfy run kling/kling-2-6/motion-control-pro \
  --input '{
    "prompt": "A young american woman dancing",
    "image": "https://.../target-character.jpg",
    "video": "https://.../motion-reference-dance.mp4",
    "character_orientation": "image",
    "keep_original_sound": true
  }' \
  --output-dir <absolute/path>

提示技巧

  • 主體在圖片參考中必須佔畫面 > 5%,才能乾淨保留身份。
  • 空間限制有幫助"character on left side, background motion right"
  • 簡化:如果結果在迭代間偏移,減少形容詞,保留核心動作描述。
  • character_orientation: "image" 限制輸出最長 10 秒;"video" 允許最長 30 秒。

路線 3:Lucy Edit Restyle — 輕量級身份穩定的重新風格化/服裝替換

模型decart/lucy-edit/restyle

當編輯是局部風格修改 — 服裝替換、場景重新打光、氛圍重新風格化 — 且身份保留至關重要時使用。比 Wan 2.7 Edit 更輕量;最高 720p。

欄位結構

欄位 類型 必填 預設值 備註
prompt string 自然語言編輯指令。
video_url string MP4/MOV/WEBM/GIF。
resolution enum 720p 此層級僅支援 720p

執行

服裝替換:

runcomfy run decart/lucy-edit/restyle \
  --input '{
    "prompt": "Change outfit to professional business attire; preserve face and motion.",
    "video_url": "https://.../subject-walking.mp4"
  }' \
  --output-dir <absolute/path>

氛圍重新風格化:

runcomfy run decart/lucy-edit/restyle \
  --input '{
    "prompt": "Make lighting warm and golden hour; preserve face, pose, and motion.",
    "video_url": "https://.../subject-portrait.mp4"
  }' \
  --output-dir <absolute/path>

提示技巧

  • 局部變化的措辭效果最佳。選擇「服裝」、「燈光」、「背景」其中一個類別。
  • 保留身份目標"preserve face and motion" 就足夠;不需要過度指定。
  • 避免完全替換(「太空中的太空人」可行;「將主體換成不同的人」不可行)。Lucy 專為局部風格修改設計,不適合完整角色替換。
  • 無長寬比控制 — 輸出與輸入相同。如果你沒有預先匹配,伺服器端會進行裁切。

限制

  • 每條路線繼承其模型的限制。 Wan 2.7 Edit:2–10 秒,最高 1080p。Kling:10 秒(圖片導向)或 30 秒(影片導向)。Lucy:最高 720p,無長寬比控制。
  • 無多路線混合。 此技能每次呼叫只選擇一個模型。
  • 品牌特定覆蓋 — 如果使用者指定了特定模型,請路由到對應的品牌技能(wan-2-7)以獲得更完整的處理。

退出碼

代碼 意義
0 成功
64 CLI 參數錯誤
65 輸入 JSON 錯誤/欄位結構不符
69 上游 5xx 錯誤
75 可重試:逾時 / 429
77 未登入或 token 被拒絕

完整參考:docs.runcomfy.com/cli/troubleshooting

運作方式

此技能根據使用者意圖選擇 Wan 2.7 Edit-Video / Kling 2.6 Pro Motion Control / Lucy Edit Restyle 其中之一,並使用對應的 JSON 主體執行 runcomfy run <model_id>。CLI 會 POST 到 Model API、輪詢請求、取得結果,並將任何 .runcomfy.net/.runcomfy.com URL 下載到 --output-dirCtrl-C 會在退出前取消遠端請求。

安全性與隱私

  • Token 儲存runcomfy login 將 API token 寫入 ~/.config/runcomfy/token.json,權限設為 0600(僅擁有者讀寫)。在 CI/容器中設定 RUNCOMFY_TOKEN 環境變數可完全繞過檔案。
  • 輸入邊界:使用者提示透過 --input 以 JSON 字串傳遞給 CLI。CLI 不會對提示進行 shell 展開;它直接透過 HTTPS 將 JSON 主體傳送給 Model API。提示內容不會造成 shell 注入風險。
  • 第三方內容:你傳入的圖片/遮罩/影片 URL 由 RunComfy 模型伺服器擷取,而非你機器上的 CLI。請將外部 URL 視為不可信任;基於圖片的提示注入是任何圖片編輯/影片編輯模型的已知風險。
  • 對外端點:僅 model-api.runcomfy.net(請求提交)和 *.runcomfy.net / *.runcomfy.com(生成輸出的下載白名單)。無遙測、無回呼。
  • 生成檔案大小上限:CLI 會中止任何超過 2 GiB 的單一下載,以防止惡意或失控模型輸出導致磁碟填滿。