layer-vfx

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Layer VFX

Layer VFX

Overview

概述

An effect is not an illustration of magic. It is a short, isolated piece of motion that an engine layers over gameplay, so it has to arrive with nothing around it, on a background the engine can remove, timed so a player reads it in a fraction of a second. Most failed effects fail on one of those three, not on how they look.
The route is: design the effect as a still, animate the still into a short clip, then pull frames from the clip into a flipbook. Generation mechanics and the spend gate are in the
layer
skill; motion prompting is in
layer-video
.
pack_sprite_sheet
is named outright below because it is Layer's deterministic packing utility, a tool rather than a model, with no alternative to discover.
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.
特效并非魔法的静态插画。它是一段短小、孤立的运动素材,由引擎叠加在游戏内容之上。因此,交付时必须不带任何周边内容,背景必须能被引擎移除,并且时序要让玩家在几分之一秒内就能理解。大多数失败的特效都败在这三点之一,而不是败在外观上。
制作路线是:先将特效设计成静帧,再将该静帧动画化为短片,随后从短片中提取帧并制成 flipbook。生成机制和费用门槛写在
layer
skill 中;动态提示技巧见
layer-video
。
下面会直接指明
pack_sprite_sheet
,因为它是 Layer 的确定性打包工具,属于工具而非模型,没有其他方案可供查找。
如果这里提到的同级 skill 未包含在可用 skills 中,请提示用户安装它(
npx skills add layerai/skills --skill <name>
);在无人值守模式下,则根据 tool schemas 继续执行,并标记这一缺失。

Quick reference

快速参考

NeedDo this
Fire, magic, light, sparksSolid black background, for additive blending
Smoke, dust, debris, inkFlat key colour, then remove it per frame; these need real alpha
The look
text_to_image
still, one effect, centred, nothing else in frame
The motion
image_to_video
with the still as
first_frame
A looping effect
loop
capability, the same still as
first_frame
and
last_frame
A locked camera
video_effects: [{type: "STATIC"}]
where the model exposes it, and say it in the prompt
Frames out of the clipThe clip's
file_id
in an image slot with
video_frame_seconds
, one run per frame
The flipbook
pack_sprite_sheet
with the frames'
file_ids
in play order
需求操作
火焰、魔法、灯光、火花使用纯黑背景,以便进行 additive blending
烟雾、尘埃、碎片、墨迹使用纯色 key colour,然后逐帧移除;这些效果需要真实的 alpha
外观使用
text_to_image
生成静帧,只包含一个特效,居中,画面中没有其他内容
动态使用
image_to_video
,并将静帧作为
first_frame
循环特效使用
loop
capability,并将同一张静帧同时作为
first_frame
和
last_frame
固定摄像机在模型支持时使用
video_effects: [{type: "STATIC"}]
,并在提示词中明确说明
从片段中提取帧将片段的
file_id
放入图像槽位并设置
video_frame_seconds
,每帧执行一次运行
Flipbook使用
pack_sprite_sheet
,并按播放顺序传入各帧的
file_ids

Background decides the blend

背景决定混合方式

Engines composite effects one of two ways, and the background has to match.
  • Additive (fire, lightning, glows, magic trails, sparks): the engine adds the effect's colour to the scene, so pure black vanishes. Ask for "pure black background, no floor, no environment, no ground glow". Black here is a feature, not a placeholder, and removing it would destroy the glow falloff.
  • Alpha-blended (smoke, dust, rubble, water splashes, dark magic): these darken or occlude, so black cannot stand in for transparency. Generate on one flat key colour that does not appear in the effect, then remove it frame by frame with a
    background_removal
    model. Wispy edges suffer, so prefer dense, defined shapes for these effects.
Do not promise transparent video. Nothing in a video run's schema delivers an alpha channel, so transparency is made on the extracted frames, not on the clip.
引擎合成特效主要有两种方式,背景必须与之匹配。
  • Additive(火焰、闪电、辉光、魔法轨迹、火花):引擎会将特效颜色叠加到场景中,因此纯黑会消失。提示词应要求:“纯黑背景,不要地面,不要环境,不要地面辉光”。这里的黑色是一项必要特性,并非占位符;将其移除会破坏辉光的衰减效果。
  • Alpha-blended(烟雾、尘埃、瓦砾、水花、黑暗魔法):这些效果会让画面变暗或产生遮挡,因此黑色无法代替透明度。选择一种特效本身不会包含的纯色 key colour 进行生成,然后使用
    background_removal
    model 逐帧移除。纤细的边缘容易受损,因此应优先使用密集且边界清晰的形状。
不要承诺输出透明视频。video run 的 schema 中没有任何内容可提供 alpha 通道,因此透明度是在提取出的帧上制作的,而不是在视频片段上制作。

Isolate and centre

隔离并居中

One effect per run, centred, fully inside the frame with margin on every side. A fireball that leaves the frame cannot be repositioned in an engine, and a second effect in frame has to be cut out by hand. Say it: "a single effect, centred, entirely within frame, nothing else in the image, no characters, no scenery".
Effects are seen small and fast: one bright core, one readable shape, one colour that says what the effect does.
每次运行只生成一个特效,居中,完全位于画面内,并且四周留有边距。超出画框的火球无法在引擎中重新定位,而画面中的第二个特效则必须手工抠出。提示词中应明确写出:“单个特效,居中,完全位于画面内,图像中无其他内容,不要角色,不要场景”。
特效往往以小尺寸快速呈现:一个明亮核心、一个清晰可辨的形状,以及一种能够传达其用途的颜色。

Timing reads

时序表达

A one-shot effect has three phases, and the prompt should name all of them with rough timings: anticipation (a gather or charge), burst (the peak, fast), dissipation (falloff to nothing). An effect that starts at full intensity reads as a glitch, and one that never fully fades leaves a ghost on its last frame. End one-shots on empty black.
Loops (auras, portals, torch flames) have no beginning or end: cyclical motion only, and the loop capability. See
layer-video
for why prompting "looping" alone produces a clip that jumps at the seam.
一次性特效包含三个阶段,提示词应使用大致时长点明确写出全部三个阶段:anticipation(聚拢或蓄力)、burst(峰值,快速爆发)、dissipation(逐渐衰减至消失)。一开始就达到全强度的特效看起来会像出现故障,而始终未完全淡出的特效会在最后一帧留下残影。一次性特效应以空黑色画面结束。
循环特效(光环、传送门、火炬火焰)没有起点或终点:只使用循环运动,并启用 loop capability。参见
layer-video
,了解为什么仅在提示词中写“looping”仍会生成在接缝处跳变的片段。

Frames out of the clip

从片段中提取帧

Any image slot (
init_image
,
reference_image
,
first_frame
,
last_frame
) accepts a video
file_id
and takes one frame of it, chosen by
video_frame
(
first
,
middle
,
last
) or by
video_frame_seconds
, which overrides it. Space the timestamps evenly across the clip: eight to twelve frames is a typical flipbook. Each frame is one run of whatever model receives it, so give the frame a run that does useful work anyway: background removal for alpha-blended effects, an upscale when the clip resolution is too low. Use
batch_size: 1
, since the default is four.
Some frame-extraction models take an
init_video
and a
frame_extraction_location
instead;
get_base_model
says which inputs a model requires.
Frames from one locked-camera clip are already registered, so
pack_sprite_sheet
keeps them aligned: it centres each frame at its own scale in one cell size. Do not trim frames individually first, or the effect will jitter.
任何图像槽位(
init_image
、
reference_image
、
first_frame
、
last_frame
)都可以接受 video
file_id
并从中截取一帧。可通过
video_frame
(
first
、
middle
、
last
)选择,也可通过
video_frame_seconds
指定,后者具有优先级。应在片段上均匀分布这些时间戳:八到十二帧是典型的 flipbook 帧数。每一帧都是将帧交给相应 model 执行的一次运行,因此仍应为每帧安排一次能够产生实际效果的运行:为 alpha-blended 特效进行背景移除,或在片段分辨率过低时进行放大。使用
batch_size: 1
,因为默认值是 4。
有些抽帧模型改为接收
init_video
和
frame_extraction_location
;
get_base_model
会说明模型需要哪些输入。
来自同一固定摄像机片段的帧已完成注册,因此
pack_sprite_sheet
会保持它们对齐:它会在统一的单元格尺寸中,按每帧自身的比例将其居中。不要先逐帧裁剪,否则特效会产生抖动。

Worked example

实战示例

"A fireball impact for our top-down RPG, as an 8-frame flipbook."
  1. list_base_models
    with
    filter.use_case: "text_to_image"
    , first result. Prompt: "Game VFX, a single fireball impact at the moment of burst, orange-white core, licking flames, flying embers, centred, entirely within frame, pure black background, no ground, no scenery, top-down view." Approve one.
  2. list_base_models
    with
    filter.use_case: "image_to_video"
    and
    filter.capabilities: {fixed_duration: true}
    ;
    get_base_model
    on the first result to see which frame slots and
    video_effects
    it takes.
  3. Motion prompt with phases: "A small ember gathers for a quarter second, bursts outward fast, then flames and embers dissipate to nothing by the end. Locked-off camera, black background throughout." Pass the approved still's
    file_id
    as
    first_frame
    ,
    video_effects: [{type: "STATIC"}]
    if supported, a short
    duration_seconds
    .
  4. Price the job as a whole: the video plus eight frame runs, each estimated as the run it will be. Over 20 CUs, ask and wait for an explicit yes.
  5. Execute, poll at
    poll_interval_seconds
    . Pull eight frames at evenly spaced
    video_frame_seconds
    , each into an upscaling run at
    batch_size: 1
    . Keep the black.
  6. pack_sprite_sheet
    with
    file_ids
    set to the eight frames in play order and
    columns: 4
    .
“为我们俯视角 RPG 制作一个火球命中特效,采用 8 帧 flipbook。”
  1. 使用
    list_base_models
    并设置
    filter.use_case: "text_to_image"
    ,取第一个结果。提示词:“游戏 VFX,单个火球在爆发瞬间的命中特效,橙白色核心,舔舐状火焰,飞散余烬,居中,完全位于画面内,纯黑背景,不要地面,不要场景,俯视角。”选择一个并批准。
  2. 使用
    list_base_models
    并设置
    filter.use_case: "image_to_video"
    和
    filter.capabilities: {fixed_duration: true}
    ;对第一个结果调用
    get_base_model
    ,查看它支持哪些帧槽位和
    video_effects
    。
  3. 使用包含各阶段的动态提示词:“一小簇余烬聚拢四分之一秒,迅速向外爆发,随后火焰与余烬在结束前逐渐消散至无。固定摄像机,全程保持黑色背景。”将已批准静帧的
    file_id
    作为
    first_frame
    传入;如果支持,再传入
    video_effects: [{type: "STATIC"}]
    ,并设置较短的
    duration_seconds
    。
  4. 将整个任务作为一个整体定价:包括视频和八次帧运行,每次按其实际对应运行估算。超过 20 CU 时,先询问并等待用户明确同意。
  5. 执行任务,按
    poll_interval_seconds
    轮询。使用均匀分布的
    video_frame_seconds
    提取八帧,每帧分别送入一次放大运行,并设置
    batch_size: 1
    。保留黑色背景。
  6. 使用
    pack_sprite_sheet
    ,将
    file_ids
    按播放顺序设置为这八帧,并设置
    columns: 4
    。

Common mistakes

常见错误

  • Removing the black background from an additive effect, which deletes the glow.
  • Using black as the background for smoke or dust, which then cannot occlude anything.
  • A scene, floor, or character in the frame around the effect.
  • An effect that clips the frame edge.
  • A one-shot with no anticipation, or one that never fully fades.
  • Promising a transparent video.
  • Trimming frames one by one before packing, so the flipbook jitters.
  • Leaving
    batch_size
    at four on per-frame runs and paying four times.
  • 移除 additive 特效的黑色背景,这会删除辉光。
  • 将烟雾或尘埃放在黑色背景上,导致它们无法遮挡任何内容。
  • 在特效周围放入场景、地面或角色。
  • 让特效超出画面边缘。
  • 一次性特效缺少 anticipation,或始终未完全淡出。
  • 承诺输出透明视频。
  • 打包前逐帧裁剪,导致 flipbook 抖动。
  • 逐帧运行时将
    batch_size
    保留为 4,从而支付四倍费用。