Nodes/ComfyUI_RaykoStudio/๐ŸฆŠ RS Last Frame
ComfyUI Node

๐ŸฆŠ RS Last Frame

Grab the final frame of any video input โ€” no VHS required

By RaykosanยทCreated about a year agoยทUpdated 5 days agoยท 79
๐ŸฆŠ RS Last Frame
  • video_frames
  • IMAGE

Video pipelines are where ComfyUI workflows get genuinely unwieldy, and one of the recurring chores is ripping a single frame out of a video to feed something that expects an image. ๐ŸฆŠ RS Last Frame (RS_Last_Frame) does exactly one thing: takes any video-ish input and hands you back the last frame as a normal IMAGE tensor. Last-frame specifically, not first - which makes it the natural fit for image-to-video loops where the previous output's ending becomes the next input's start.

How it works

The clever bit is the input handling. The node declares its input as the universal * type, then at runtime figures out what it actually received. The source walks through the possibilities in order: if it's already a torch.Tensor, great; if it's a VideoFromFile-style object (the thing ComfyUI's native Load Video node produces), it calls get_components() and digs the frame tensor out of a tuple, dict, or attribute; if it's a plain dict, it looks for frames, images, or video keys.

Then it normalizes shapes. A 5D [B, F, H, W, C] tensor loses the batch dim, a channel-first 4D tensor gets permuted to [F, H, W, C], and anything it can't make sense of raises a clear error telling you what it got and which methods were available. Finally it takes frames[-1] and returns it as [1, H, W, C] - one image, ready for VAEEncode, a preview, or any image processor.

The one input

  • video_frames - universal. Plug in anything from the native video loader, a VHS video tensor, an image batch, or a dict you built yourself. A single-frame video just passes through unchanged.

Output: IMAGE - the last frame, as a single-image tensor.

How to install

It's part of ComfyUI_RaykoStudio, so the pack install gets you there:

cd ComfyUI/custom_nodes
git clone https://github.com/Raykosan/ComfyUI_RaykoStudio.git

Restart ComfyUI, or install via ComfyUI Manager (search "ComfyUI_RaykoStudio"). The README is explicit that nodes need no additional Python packages beyond the pack's own requirements, and this one has zero external dependencies by design.

Common issues

  • "Failed to extract frames" error. The input was something the node doesn't recognize - not a tensor, not a get_components() object, not a dict. The error message lists the input type and available methods, which is genuinely useful for figuring out what your custom video node is actually handing over.
  • Wrong frame count. Some loaders hand you a batch of stills, not a video. If your "last frame" is actually the last of a batch of unrelated images, check which node is feeding it.

The honest bottom line: if you use ComfyUI's native Load Video, or VHS, or Image Batch, this is a dead-simple utility that removes a fiddly step - and because it accepts *, it's surprisingly robust across video extensions. It won't change your life, but it'll quietly unblock a dozen image-to-video workflows.

Category๐ŸฆŠ RaykoStudio

Inputs (1)

NameTypeDefaultDescription
video_frames*โ€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEโ€”