Communitygithub.com

長影片關鍵影格

為已批准影片腳本的每個場景(片段)建立起始和結束影格圖片。為每個影格寫入一個圖片提示,檔案名稱固定並包含場景編號與起始或結束標記,建立圖片資料夾,並可透過可用的圖片工具生成圖片,或一次性或逐一將提示交給使用者。請在 `long-video-director` 之後,或使用者要求起始影格、結束影格、關鍵影格或場景圖片時使用。

長影片關鍵影格 是什麼?

這個技能是長影片工作流程的第五階段,專注於為已批准的影片腳本中的每個場景生成關鍵影格提示和圖片。它會自動為每個場景編號、撰寫包含風格、角色和環境描述的詳細圖片提示,並將它們儲存在結構化的檔案系統中。技能支援兩種交付模式:僅提供提示(讓使用者自行生成圖片)或直接生成圖片(透過內建工具或瀏覽器)。它會嚴格遵守視覺聖經和影片風格,確保一致性,並包含完整性檢查、重試機制和進度追蹤。此技能主要用於 Claude Code 和 Cursor 等具備檔案存取和圖片生成能力的 AI 代理平台,幫助影片製作團隊快速視覺化腳本。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/samanfirouzi/long-video-skill/tree/HEAD/skills/long-video-keyframes

在你喜歡的 AI 中提問

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

說明文件

長影片關鍵影格 是做什麼的?

長影片工作流程的第五階段。輸出:每個場景起始與結束影格的圖片提示、一個 frames/ 資料夾,以及選擇性的已完成圖片。

在此階段,場景是指腳本中的一個片段(一個鏡頭,最多 10 秒)。場景會依順序在整部影片中編號。

開始之前

  1. 在 ~/.long-video/projects/<slug>/ 中找到專案。需要有 status: approved 的 video-script.md。如果未批准,請停止並執行 long-video-director。
  2. 需要 film-style.md 和 visual-bible.md。它們包含了攝影機與燈光的外觀以及鎖定的美術風格。
  3. 載入專案設定:長寬比、解析度、圖片提供者、批准等級、預算。
  4. 檢查 images/ 中是否有來自 long-video-assets 的角色、環境和物體圖片。它們可作為參考。如果缺失,請說明。僅在使用者同意在沒有它們的情況下撰寫提示時才繼續。
  5. 如果 frames/ 或 frame-prompts/ 已存在,請詢問:繼續(列出已完成事項),或重新開始。

步驟 1:為場景編號

  1. 依序閱讀腳本。為每個鏡頭指定一個場景編號:1、2、3,依此類推,遍及整部影片。補零至 3 位數(scene-001),如果場景超過 999 個,則補零至 4 位數。
  2. 建立從場景編號到腳本鏡頭 ID 的對應表(例如,場景 7 是腳本鏡頭 2.3)。
  3. 標記連續片段(腳本中的 Continues:)。對於這些片段,起始影格是前一個場景的結束影格。不要撰寫新的起始提示。索引指向先前的結束圖片。
  4. 計算圖片數量:每個場景兩張,減去重複使用的起始影格。告知使用者總數。

步驟 2:撰寫影格提示

閱讀 references/frame-prompt-templates.md。為每個場景撰寫兩個提示(對於連續場景則寫一個)。

對於每個影格,根據腳本鏡頭推斷:

  • 起始影格。 片段第一個影格所顯示的內容:第一個攝影機位置、角色的起始姿勢和位置、該時刻的燈光。
  • 結束影格。 最後一個影格所顯示的內容:攝影機移動到的位置(例如,推進後更緊湊)、動作如何結束、燈光的任何變化。它必須能在鏡頭的持續時間內從起始影格到達。如果攝影機靜止且無任何移動,則結束影格應與起始影格構圖相同,但帶有一個小的自然變化(一個手勢、光線變化)。
  • 兩個影格都顯示相同的地點、角色和物體,且使用相同的攝影機設定,除非鏡頭移動了攝影機。

每個提示的規則:

  1. 自包含。 不使用「同上」。包含生成器所需的一切。
  2. 風格區塊逐字引用。 從 visual-bible.md 中精確複製風格區塊和負面詞彙。添加電影風格的「生成器提示行」。從鏡頭中添加攝影機、鏡頭和燈光資訊。
  3. 實體描述逐字引用。 從視覺聖經中逐字複製每個角色、環境和物體的描述。切勿改寫。
  4. 參考資料。 列出要附加的圖片檔案:角色圖片和圖表、環境圖片、物體。對於結束影格,請將該場景自己的起始影格列為第一個參考。使用確切的檔案名稱。
  5. 相同構圖。 在每個提示中使用設定檔中的長寬比。
  6. 圖片中無文字。 除非故事需要,否則沒有字幕、標題、標誌或帶有可讀文字的標示。
  7. 無真實人物姓名、商標或在世藝術家姓名。

將提示儲存在 frame-prompts/ 中,以每 20 個場景為一批的檔案:scenes-001-020.md、scenes-021-040.md,依此類推。同時撰寫 frame-prompts/index.md(格式參見範本)。

步驟 3:檔案名稱與資料夾

在專案資料夾中建立 frames/。切勿將圖片放在任何其他地方。

檔案名稱是固定的,並出現在每個提示的標頭中:

  • scene-<number>_start.png
  • scene-<number>_end.png

範例:scene-007_start.png、scene-007_end.png。任何副檔名皆可(png、jpg、webp),但基本名稱必須相符。名稱包含場景編號以及 start 或 end 字詞,以便每個影格可依名稱找到並排序。

步驟 4:詢問使用者需求

詢問:「您希望從這個階段得到什麼?」

  • 僅提示。 使用者使用自己的工具生成圖片。
  • 圖片。 Claude 生成圖片。
  • 兩者都要。 使用者取得提示,同時 Claude 也生成圖片。

提示檔案始終會儲存。此選項決定由誰來生成圖片。

然後詢問交付方式:一次全部給,或逐一給。

僅提示

  • 一次全部給。 顯示 frames/ 和 frame-prompts/ 的完整路徑。用一個範例說明檔案名稱的運作方式。使用者開啟批次檔案並逐一處理。提議稍後檢查資料夾。
  • 逐一給。 在聊天中顯示第一個提示及其檔案名稱和要附加的參考資料。等待使用者確認已儲存。檢查該檔案是否以正確名稱存在於 frames/ 中。然後顯示下一個提示。如果使用者說「跳過」或「停止」,則將進度儲存在 frames/status.md 中並停止。

每當使用者要求時,或在結束時檢查資料夾:將找到的檔案與索引進行比較,並列出缺失或命名錯誤的檔案。

圖片或兩者都要

閱讀 ../long-video-assets/references/image-generation.md 並遵循其步驟以尋找方法、處理瀏覽器選項、排序、檢查和狀態。使用設定檔中儲存的方法(如果有的話)。此階段的變更:

  • 計數與成本。 告知使用者需要多少張圖片以及大致的時間或成本。在開始大量批次前先詢問。提議從一個範圍開始,例如場景 1 到 10。
  • 風格測試。 先生成 scene-001_start。顯示它。詢問它是否符合鎖定的風格以及角色看起來是否正確。在繼續之前修正提示。
  • 排序。 對於每個場景:先起始影格,然後結束影格(當方法支援時,結束影格使用起始影格作為參考)。然後是下一個場景。
  • 參考資料。 附加提示中列出的角色、環境和物體圖片。如果方法只接受一個參考,請使用最重要的那個(影格中的主要角色)並說明。
  • 一次全部給或逐一給。 一次全部給:生成整個範圍,然後顯示結果。逐一給:顯示每一對,等待批准或重做請求,然後繼續。
  • 瀏覽器選項。 與資產階段相同的規則:明確確認數量、時間和下載資料夾。切勿輸入密碼或解決驗證碼。
  • 檢查。 在每張圖片之後,檢查主體、風格匹配、角色外觀與參考資料的對比,以及起始與結束影格之間的差異。最多重試 2 次,然後標記為 needs-manual。
  • 絕不覆蓋。 未經詢問,絕不覆蓋現有影格。

如果生成失敗或使用者拒絕,則對其餘場景回退到僅提示模式。

步驟 5:狀態與完成

  1. 保持 frames/status.md 為最新狀態:
| 場景 | 影格 | 檔案 | 狀態 | 備註 |
|-------|------|------|--------|------|
| 001 | start | scene-001_start.png | done | |
| 001 | end | scene-001_end.png | pending | |

狀態值:pending、done、needs-manual、skipped。

  1. 更新 project.json:提示儲存後設為 "stage": "frames-prompts-done",當所有影格都存在且使用者批准整套時設為 "stage": "frames-images-done"。
  2. 告知使用者 frames/ 和 frame-prompts/ 的路徑,以及仍然缺失的內容。
  3. 提議繼續進行 long-video-clips(從影格生成影片片段,或跳過它而僅使用圖片)。僅在使用者同意時才啟動它。除非使用者要求且該階段存在,否則不要啟動任何其他後續階段。

儲存提示前的自我檢查

  • 每個場景都有一個結束提示。每個非連續場景都有一個起始提示。
  • 每個提示的標頭中都有檔案名稱,符合命名規則。
  • 每個提示都包含逐字引用的風格區塊、負面詞彙和電影提示行。
  • 鏡頭中的每個角色、環境和物體都以其逐字描述和列出的參考檔案出現。
  • 一個場景的起始和結束影格在地點、角色和燈光方面保持一致,並以鏡頭規定的方式有所不同。
  • 提示數量與向使用者承諾的數量相符。

規則

  • 沒有批准的腳本絕不開始。
  • 在使用者選擇「圖片」或「兩者都要」之前,絕不生成圖片。
  • 提示獲得批准後,絕不重新命名圖片或提示檔案名稱。
  • 絕不要求在聊天中提供 API 金鑰。
  • 保持聊天訊息簡短。將完整的提示文字放在檔案中,僅顯示範例或當前提示。

Individual skills in this repo

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

long-video-assets

Video and animation skill. Build the visual foundation for a long video from an approved story. Extracts the recurring characters, environments and key objects, helps the user choose one art style from suggested options (10 at a time, more on request), then writes image generation prompts for every character (portrait plus character sheet), environment and object, all sharing one locked style. Can also generate the images (installed tool, API, MCP or browser) or hand the user a folder and file names to fill. Use after lon

long-video-director

Turn an approved story into a shot-by-shot video script, acting as the director. Asks whether the video uses a narrator or characters who speak (or both), suggests professional filming choices (camera type, lenses, camera movement, lighting, color, pacing), saves them as a separate film style file, then writes a script that matches the project config. Outputs film-style.md and video-script.md. Use after long-video-story (and long-video-assets) are done, or when the user asks for the video script, shot list, camera style or lighting plan.

long-video-render

Assemble the finished video and run the review loop. Builds the edit from the clips (or images with camera moves), voice, sound stems and captions, renders a low quality review version with scene numbers and time burned in so a client can review it, collects and applies changes (re-rendering reviews as often as needed), and when the user approves, renders the high quality final video. Uses a video editor with a CLI or MCP (FilmCraft, EffectCraft or another) if one is available and the user wants it, otherwise the bundled ffmpeg renderer. Use after long-video-sound, or when the user asks to render, assemble, export, preview or finalize the video.

long-video-sound

Video and animation skill. Create the sound effects, ambience and background music for the video and place them on the timeline. Plans the sound design from the approved script, sources or makes each sound (Openverse for openly licensed recordings and music, Earshot to make sounds from words and to listen to and judge sounds, Clipwing real-sfx to place real sounds on exact frames), records licences and credits, and mixes separate stems (effects, ambience, music) with the music ducked under speech. Or gives the user a fold

long-video-story

Agree on the story for a long video. The user either supplies a story or asks Claude to write one. When Claude writes, it first asks which story style to use (for example niche discovery, or a provocative-questions narration), runs that style's skill, and revises until the user approves. Use after long-video-setup, or when the user says "story for my video", "give me an idea", or wants to change an unapproved story. Ends only when the user explicitly approves the story.

long-video-voice

Create the spoken audio (narration and character voices) for the approved video script. First decides whether the video needs speech and asks the user to confirm. If yes, builds a voice cast (narrator plus each speaking character), makes a short sample of each voice with an available tool such as an ElevenLabs MCP and asks the user to approve the voices, then generates one audio file per spoken line with a name that holds the scene number and speaker. Or gives the user the lines, file names and folder to record or generate themselves. Use after long-video-clips (or long-video-keyframes), or when the user asks for narration, voiceover, voices or dialogue audio.

相關技能