Nodes/fxai-toolkit/凤希AI - 首尾帧生成器
ComfyUI Node

凤希AI - 首尾帧生成器

Build the first/last-frame pair that bridges two video segments

By fxai666·Created 4 months ago·Updated 3 days ago· 35
凤希AI - 首尾帧生成器
  • 图片序列
  • 首帧图
  • 尾帧图
文件夹路径
首帧索引0
尾帧索引1
启用转场true
输出宽度540
输出高度960

The seam between two generated video segments is where long videos fall apart - one segment ends with a face, the next opens with a different one, and the cut is an instant jump instead of a transition. The standard fix in segmented video pipelines is first/last frame conditioning: pin the segment's opening and closing frames so the model knows where it's starting and where it's headed. FxAiFrameGenerator (凤希AI - 首尾帧生成器) is the node that builds that pair - it pulls the first and last frame out of a folder of images (or a sequence you've already generated), normalizes them to your output size, and hands you both as ready-to-feed IMAGE anchors.

How it works

Give it a 文件夹路径 (folder path) full of image frames - say, one rendered keyframe per scene - and it sorts them and pulls out 首帧索引 (first frame index, default 0) and 尾帧索引 (last frame index, default 1). Both images are center-cropped and resized to 输出宽度 × 输出高度 (default 540×960, the portrait short-video shape) using LANCZOS, so the pair you feed the video model is guaranteed to match its expected resolution. The index handling is forgiving: indices are taken modulo the folder's total, so 尾帧索引 = 1 on a one-image folder just wraps to that image rather than erroring.

The 启用转场 (enable transition) toggle and the optional 图片序列 (image sequence) input are where it earns its keep in a loop:

  • 转场 on + sequence connected - the node uses the last frame of your previously generated sequence as the first frame, and the folder's tail frame as the last. That's a continuity bridge: the new segment starts exactly where the old one ended, so the model produces a transition instead of a jump cut.
  • 转场 on, no sequence - first frame from 首帧索引, last frame from 尾帧索引. The classic I2V "animate from this still to that still" pair.
  • 转场 off - both outputs are the first-frame image. No transition, effectively a static start frame.

Outputs

  • 首帧图 (first frame image) - the opening anchor.
  • 尾帧图 (last frame image) - the closing anchor.

Wire both into an image-to-video model that supports first/last-frame conditioning (the LTX and MiniMax paths in this pack's workflow templates use exactly this pattern) and your segments stop feeling like separate clips.

Install

Part of fxai-toolkit (凤希全能节点包), MIT-licensed, by 凤希AI. ComfyUI Manager (search "fxai") or:

cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
# restart ComfyUI

Pack auto-installs soundfile and psutil; no models. Pure PIL/torch - no ffmpeg dependency.

Gotchas

  • Image order = filename order, always. frame2.png sorts before frame10.png; zero-pad your keyframes (frame02.png) if order matters.
  • A missing or empty folder silently returns None for both frames rather than erroring - your video model then gets a dead input and fails downstream, so check the folder path first.
  • The portrait 540×960 default is a choice, not a rule. 16:9 workflows should set 960×540 or whatever your model's native size is; the node center-crops to fit, so aspect mismatch means you lose edges, not distortion.
  • When 图片序列 is connected with 转场 on, the first frame is not resized (it's assumed to already be model output), only the tail frame is. Keep the sequence at your output resolution to avoid a size mismatch between the two anchors.
  • Chinese labels: 首帧 = first frame, 尾帧 = last frame, 转场 = transition.
Category凤希AI/图片

Inputs (7)

NameTypeDefaultDescription
文件夹路径STRING
首帧索引INT0
尾帧索引INT1
启用转场BOOLEANtrue
输出宽度INT540
输出高度INT960
图片序列optIMAGE

Outputs (2)

NameTypeDescription
首帧图IMAGE
尾帧图IMAGE