Communitygithub.com

长视频关键帧

为已批准视频脚本的每个场景(片段)创建开始帧和结束帧图像。为每帧编写一个图像提示,使用包含场景编号和开始/结束的固定文件名,创建图像文件夹,并可利用可用的图像工具生成图像,或一次性或逐个将提示交给用户。在 long-video-director 之后使用,或当用户要求开始帧、结束帧、关键帧或场景图像时使用。

长视频关键帧 是什么?

长视频关键帧技能是长视频工作流的第5阶段,旨在为批准脚本的每个场景自动生成开始帧和结束帧的图像提示以及实际图像。它首先读取已批准的 `video-script.md`、`film-style.md`、`visual-bible.md` 和项目配置(如宽高比、分辨率、图像提供者等),并为每个镜头(场景)分配从 001 开始的唯一编号。然后,该技能为每帧编写自包含的图像提示,严格包含来自视觉圣经的风格块、负面术语、实体描述以及参考图片。提示被保存到 `frame-prompts/` 文件夹中的批处理文件中,并且一个 `frames/` 文件夹被创建以存放最终图像。该技能支持与用户协商工作流程:它可以仅提供提示、生成图像,或两者都做,并且提供一次性交付或逐个交付的选项。逐个生成时,它会在生成前先进行风格测试,检查角色外观,并在每个场景中先生成开始帧再生成结束帧。最终,它会更新状态文件并记录完成状态,然后提议进入下一阶段(如 `long-video-clips`)。该技能适用于 Cursor、Claude Code 和其他支持 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 的新对话。

文档

长视频关键帧 是做什么的?

长视频工作流的第5阶段。输出:每个场景开始帧和结束帧的图像提示,一个 frames/ 文件夹,以及可选的成品图像。

在此阶段,场景指脚本的一个片段(一个镜头,最多10秒)。场景在整个视频中按顺序编号。

开始之前

  1. 在 ~/.long-video/projects/<slug>/ 中找到项目。需要 video-script.md 且 status: approved。如果未批准,停止并运行 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 | 开始 | scene-001_start.png | done | |
| 001 | 结束 | 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.

相关技能