
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>`。觸發關鍵字包括「影片編輯」、「編輯影片」、「重新風格化影片」、「替換影片背景」、「動作控制」、「影片服裝替換」,或任何明確要求轉換影片的指令。
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 | 最多功能、最高解析度 |
AI 代理會讀取此表格,分類使用者意圖,並選用下方對應的子章節。
前置需求
- RunComfy CLI —
npm i -g @runcomfy/cli - RunComfy 帳號 —
runcomfy login。 - CI/容器環境 — 設定
RUNCOMFY_TOKEN=<token>。 - 來源影片網址 — 格式與限制依所選路線而定。
路線 1:Wan 2.7 Edit-Video — 重新風格化/背景/包裝的預設選項
模型:wan-ai/wan-2-7/edit-video
欄位結構
| 欄位 | 型別 | 必填 | 預設值 | 備註 |
|---|---|---|---|---|
prompt |
string | 是 | — | 開頭先說明要保留的部分。每次呼叫只做一個編輯方向。 |
video |
string | 是 | — | MP4/MOV 網址,長度 2–10 秒,≤100MB。 |
reference_image |
string | 否 | — | 網址 — 僅用於直接設計/外觀轉移。 |
resolution |
enum | 否 | (輸入值) | 720p 或 1080p。 |
aspect_ratio |
enum | 否 | (輸入值) | 寬:高。預設為輸入值。 |
duration |
int | 否 | 0 | 0 = 與輸入相同;2–10 = 從開頭截斷。 |
audio_setting |
enum | 否 | auto |
auto 或 origin(保留來源音訊)。 |
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 會向 Model API 發送 POST 請求、輪詢請求狀態、取得結果,並將任何 .runcomfy.net/.runcomfy.com 網址下載至 --output-dir。按下 Ctrl-C 會在結束前取消遠端請求。
安全性與隱私
- Token 儲存:
runcomfy login會將 API token 寫入~/.config/runcomfy/token.json,權限設為 0600(僅擁有者可讀寫)。在 CI/容器環境中,可設定RUNCOMFY_TOKEN環境變數來完全繞過檔案。 - 輸入邊界:使用者提示詞以 JSON 字串形式透過
--input傳遞給 CLI。CLI 不會對提示詞進行 shell 展開;它會直接將 JSON 主體透過 HTTPS 傳送給 Model API。提示詞內容不會造成 shell 注入風險。 - 第三方內容:你傳入的圖片、遮罩、影片網址是由 RunComfy 模型伺服器擷取,而非你機器上的 CLI。請將外部網址視為不可信任;基於圖片的提示詞注入是任何圖片編輯/影片編輯模型已知的風險。
- 對外端點:僅
model-api.runcomfy.net(請求提交)和*.runcomfy.net/*.runcomfy.com(生成輸出的下載白名單)。無遙測、無回呼。 - 生成檔案大小上限:CLI 會中止任何大於 2 GiB 的單一下載,以防止惡意或失控的模型輸出導致磁碟空間耗盡。





