layer-video-fixes

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Layer Video Fixes

Layer 视频修复

Overview

概述

A clip that is 90 percent right is worth more than a fresh roll. Rerolling throws away the motion, the timing and the performance that already work, and buys a new set of problems. Layer exposes a use case for most single defects, so the job is to name the defect, pick the use case that fixes only that, and leave everything else as it was.
Generating a clip from scratch is
layer-video
; cutting finished clips together is
layer-video-timeline
. The loop, the spend gate and polling are in the
layer
skill.
If a sibling skill named here is missing from your available skills, ask the user to install it (
npx skills add layerai/skills --skill <name>
); unattended, proceed from tool schemas and flag the gap.
一个完成度已达 90% 的片段,远比重新生成的结果更有价值。重新生成会丢弃已经奏效的动作、节奏和表演,却换来的只是一批新问题。Layer 针对大多数单一缺陷都提供相应的 use case,因此关键是准确指出缺陷,选择只修复该缺陷的 use case,并让其他部分保持原样。
从零生成片段使用
layer-video
;将完成的片段剪辑在一起使用
layer-video-timeline
。循环、支出控制和轮询逻辑位于
layer
skill 中。
如果此处提到的某个同级 skill 不在可用 skill 列表中,请让用户安装(
npx skills add layerai/skills --skill <name>
);在无人值守模式下,则依据 tool schema 继续执行,并标记这一缺失。

Quick reference

快速参考

Each route is
list_base_models
with
filter.use_case
set as below; take the first result.
Symptom
use_case
Clip ends too soon, action is cut off
video_extend
A moment is missing in the middle
insert_video
One element is wrong (colour, prop, background)
video_editing
The wrong object is in shot
video_object_swap
The wrong character, or an off-model one
video_character_swap
Right performance, wrong subject
motion_transfer
Lighting fights the scene it is cut into
relight_video
Motion stutters, or the shot needs slow motion
video_interpolation
Too small for delivery
upscaling
Grain or compression noise
denoise_video
Soft or motion-blurred
deblur_video
Standard range master needed as HDR
sdr_to_hdr_video
每条修复路径都是调用
list_base_models
,并将
filter.use_case
设为下表所示的值;取第一个结果。
症状
use_case
片段结束得太早,动作被截断
video_extend
中间缺少某个时刻
insert_video
某个元素有误(颜色、道具、背景)
video_editing
镜头中的物体错误
video_object_swap
角色错误,或出现了偏离设定的角色
video_character_swap
表演正确,但主体错误
motion_transfer
光照与所在场景不协调
relight_video
动作卡顿,或镜头需要制作慢动作
video_interpolation
尺寸太小,无法交付
upscaling
存在颗粒或压缩噪声
denoise_video
画面偏糊或因运动产生模糊
deblur_video
需要将标准动态范围母版转换为 HDR
sdr_to_hdr_video

Read the model before the first call

首次调用前读取模型

These models disagree about inputs more than generation models do. The schema does not fix which guidance slot a repair model reads the source clip from (
init_video
or
reference_video
), nor where a replacement subject goes (
reference_image
,
face
, or an
element_*
type). Call
get_base_model
on the chosen model and use the slots it lists; never assume one because another model took it. When a fix needs two inputs at once, narrow the search with
filter.guidance_file_types
, for example
["init_video", "reference_image"]
, which keeps only models that accept both.
Guidance files are
{file_id, type}
objects in
guidance_files
. A clip from an earlier run already has a
file_id
; pass it directly. Upload only footage that is local, with
request_file_upload_url
.
这些模型对输入的约定比生成模型之间差异更大。schema 并不能确定修复模型会从哪个 guidance 槽位读取源片段(
init_video
或
reference_video
),也不能确定替换主体应放在哪个槽位(
reference_image
、
face
或某种
element_*
类型)。对选定模型调用
get_base_model
,并使用其中列出的槽位;绝不能因为另一个模型接受某种输入,就假定当前模型也接受。修复需要同时使用两种输入时,通过
filter.guidance_file_types
收窄搜索范围,例如
["init_video", "reference_image"]
,这样只会保留同时接受两种输入的模型。
guidance_files
中的 guidance 文件是
{file_id, type}
对象。先前运行生成的片段已经有
file_id
,直接传入即可。仅上传本地素材,并使用
request_file_upload_url
。

Repair from the original

基于原始素材进行修复

Every pass through a model costs detail. Three fixes chained on each other look worse than three fixes each made from the source, and the losses compound in faces and fine texture first. Keep the original
file_id
as the master, apply each fix to the master where the fixes are independent, and chain only when a later fix genuinely needs the earlier result (upscale last, after the content is settled, since an upscale of a clip you then edit is wasted).
To fix only part of a clip (slow motion on the last two seconds), cut that span out first with a
render_video_timeline
edit (
start_from_in_seconds
and
duration_in_frames
,
layer-video-timeline
), then repair the cut file.
每次让模型处理一遍都会损失细节。让三个修复相互串联的结果,比分别从源片段完成三次修复更差;损失会首先在人脸和精细纹理上不断累积。保留原始
file_id
作为母版;如果各项修复彼此独立,应分别基于母版应用。只有后一项修复确实需要前一项结果时才串联(放大必须放在最后,在内容确定后进行,因为先放大、之后再编辑会白做)。
如果只需修复片段的一部分(例如最后两秒制作慢动作),先用
render_video_timeline
编辑功能裁出该片段(
start_from_in_seconds
和
duration_in_frames
,
layer-video-timeline
),然后修复裁剪后的文件。

Sound, length and frame rate

声音、时长和帧率

  • Sound. Set
    keep_audio: true
    to carry the source's audio through a fix. Without it, assume the output may be silent, and check before delivering.
  • Length. Extensions, inserts and interpolation change a clip's duration, and some swaps do too. Report the new length to the user, especially when the clip sits in an edit cut to music. An interpolated slow-motion shot is longer by design; a swap that came back shorter is a defect.
  • Frame rate.
    fps
    is honoured only by the models that take it (
    get_base_model
    says so). Ask for interpolation to reach a target rate rather than generating at one the model ignores.
  • Size. For a reframe, pass both
    width
    and
    height
    . With either one missing and a source attached, the output geometry is taken from the source file.
For an upscale,
upscale_ratio
sets the factor (2.0, 4.0).
creativity
and
resemblance
trade invented detail against fidelity; keep resemblance high on footage with faces or text.
  • 声音。 设置
    keep_audio: true
    ,让源音频在修复后继续保留。如果不设置,应假定输出可能没有声音,并在交付前检查。
  • 时长。 扩展、插入和插帧会改变片段时长,部分替换操作也会改变时长。将新时长告知用户,尤其是在片段位于按音乐剪辑的成片中时。经过插帧的慢动作镜头按设计会更长;替换后的片段如果变短,则属于缺陷。
  • 帧率。 只有接受
    fps
    参数的模型才会遵循该设置(
    get_base_model
    会注明)。如果需要达到目标帧率,应要求进行 interpolation,而不要直接按模型会忽略的帧率生成。
  • 尺寸。 进行 reframe 时,同时传入
    width
    和
    height
    。如果缺少其中任何一个参数且已附加源文件,则输出画幅取自源文件。
对于放大操作,
upscale_ratio
设置放大倍数(2.0、4.0)。
creativity
和
resemblance
用于在凭空生成的细节与保真度之间取舍;对于包含人脸或文字的素材,应保持较高的
resemblance
。

Pricing

定价

The forge guide prices a video edit by its source's length and an upscale by its source's dimensions. An estimate without the source attached prices a different run, so pass
estimate_forge_price
exactly the inputs
execute_forge
will get. Several fixes on clips of different lengths are several estimates, never the first one multiplied. Sum the job and ask before spending above 20 CUs.
forge 定价指南会根据源片段的时长为视频编辑定价,并根据源片段的尺寸为放大操作定价。如果未附加源文件,估价对应的是另一次运行,因此应向
estimate_forge_price
传入与
execute_forge
完全相同的输入。对时长不同的片段进行多项修复,需要分别估价,绝不能将第一次估价直接乘以修复次数。汇总任务费用;预计支出超过 20 CUs 时,先征得用户同意。

Worked example

实例

"The hero's 6-second clip is perfect except the sword turned into a staff halfway through. Also make it 4K for the trailer."
  1. The clip is a previous run's output, so it has a
    file_id
    . Keep it as the master.
  2. Defect one is a wrong object:
    list_base_models
    with
    filter.use_case: "video_object_swap"
    . Take the first result and call
    get_base_model
    for its source slot and replacement slot.
  3. Defect two is size:
    list_base_models
    with
    filter.use_case: "upscaling"
    and
    filter.modality: "video"
    ;
    get_base_model
    for its slot and ratio limits.
  4. Price both before running either:
    estimate_forge_price
    for the swap with the master attached in its listed slot, the approved sword still as the replacement,
    keep_audio: true
    , and a prompt naming only the change: "Replace the staff in the hero's right hand with the approved longsword. Keep the motion, the timing and everything else unchanged." Then estimate the upscale with
    upscale_ratio: 2.0
    against a 6-second source. Present the total; above 20 CUs wait for a yes.
  5. execute_forge
    the swap; poll
    get_forge_run
    at
    poll_interval_seconds
    . Check the length is still 6 seconds and the sword holds across every frame.
  6. Upscale the swap's output (
    file_id
    from step 5), the one fix that must come last. Poll, then report both
    file_id
    values and any change in length.
“主角的 6 秒片段除了中途剑变成了法杖之外,其他部分都很完美。另外还要为预告片把它做成 4K。”
  1. 该片段是先前运行的输出,因此已经有
    file_id
    。将其保留为母版。
  2. 第一个缺陷是物体错误:调用
    list_base_models
    ,并设置
    filter.use_case: "video_object_swap"
    。取第一个结果,再调用
    get_base_model
    查看其源片段槽位和替换内容槽位。
  3. 第二个缺陷是尺寸:调用
    list_base_models
    ,并设置
    filter.use_case: "upscaling"
    和
    filter.modality: "video"
    ;再调用
    get_base_model
    查看其槽位和倍数限制。
  4. 在运行任一修复前,先分别定价:调用
    estimate_forge_price
    估算对象替换,将母版放入模型列出的源片段槽位,以已批准的剑作为替换内容,设置
    keep_audio: true
    ,并提供一条只描述改动内容的 prompt:“将主角右手中的法杖替换为已批准的长剑。保持动作、时间点及其他一切不变。”然后针对 6 秒源片段,以
    upscale_ratio: 2.0
    估算放大费用。给出总费用;超过 20 CUs 时,等待用户确认。
  5. 调用
    execute_forge
    执行替换;按
    poll_interval_seconds
    轮询
    get_forge_run
    。检查时长是否仍为 6 秒,以及剑是否在所有帧中都保持正确形态。
  6. 对替换结果(步骤 5 中的
    file_id
    )进行放大;这是唯一必须最后执行的修复。轮询完成后,报告两个
    file_id
    以及任何时长变化。

Common mistakes

常见错误

  • Rerolling a clip whose only defect a single use case could fix.
  • Assuming the source slot instead of reading it from
    get_base_model
    .
  • Chaining independent fixes off each other instead of each off the master.
  • Upscaling first, then editing the upscaled clip.
  • Losing the soundtrack by leaving
    keep_audio
    unset.
  • Delivering a fixed clip without saying its length changed.
  • Pricing several fixes from one estimate when their sources differ in length or size.
  • Prompting a repair with a full scene description instead of only the change.
  • 重新生成一个仅存在某种单一 use case 可修复缺陷的片段。
  • 不读取
    get_base_model
    ,而是想当然地假定源片段槽位。
  • 让彼此独立的修复相互串联,而不是分别基于母版执行。
  • 先放大,再编辑已放大的片段。
  • 未设置
    keep_audio
    ,导致音轨丢失。
  • 交付修复后的片段,却未说明其时长已变化。
  • 当各项修复所用源片段的时长或尺寸不同时,仍使用一次估价为所有修复定价。
  • 用完整场景描述来提示修复,而不是只描述改动。