Nodes/comfyUI_LLM/🖼️ 获取片段图片和音频
ComfyUI Node

🖼️ 获取片段图片和音频

Frames, audio, and frame count

By XieJunchen·Created about a year ago·Updated about a month ago· 2
🖼️ 获取片段图片和音频
  • clips
  • images
  • audio
  • num_frames
index0

SplitVideoByFrames chops a video into a list of clips - but a Python list isn't something you can wire around ComfyUI's canvas. This node is the bridge: give it the clips list and an index, and it hands you that one clip's frames as a real IMAGE tensor, its audio track, and how many frames are in it. "🖼️ 获取片段图片和音频". Think of it as the "unpack one chunk" step that makes the whole video-understanding pipeline work.

How it works

The clips input is the LIST that SplitVideoByFrames outputs - a list of dicts, each holding {"frames": tensor, "audio": dict}. This node just indexes into it: clips[index], then returns the pieces. frames comes out as a (T, H, W, C) IMAGE batch (T frames, ready for a video-aware model or per-frame processing), audio comes out as a standard ComfyUI AUDIO dict (the full clip soundtrack), and num_frames is the frame count for logic. It does bounds-checking and raises an IndexError if your index is out of range.

Inputs and outputs

  • index (INT, default 0) - which clip to pull. clips[0] is the first one.
  • clips (LIST) - the list from SplitVideoByFrames.
  • Outputs: images (IMAGE), audio (AUDIO), num_frames (INT).

The natural workflow

The full loop in this pack is a nice demonstration of how these nodes compose:

  1. SplitVideoByFrames - long video in, N clips out.
  2. GetVideoClipByIndex - pick clip #k, get its frames and audio.
  3. Process those frames however you like - img2img, a vision LLM, captioning.
  4. Optionally re-encode the result with CloudImagesToVideoAndUpload (pass the same audio back in) and push it to Qiniu.

That's a "video in, remixed video URL out" pipeline assembled from three nodes with no Python written. You drive the "which clip" choice manually by setting index, or wire it to a counter if you're iterating.

Installing it

Standard pack install - ComfyUI Manager → search comfyUI_LLM, or:

cd ComfyUI/custom_nodes
git clone https://github.com/XieJunchen/comfyUI_LLM
# restart ComfyUI

No extra dependencies beyond the pack's base requirements.

Where people get burned

  • clips is opaque on the canvas. You can't inspect a LIST the way you can inspect an IMAGE preview. You'll know the clip count from SplitVideoByFrames' num_clips output - wire that to a text display so you don't guess indices blind.
  • Index out of range → hard error. It raises rather than returning empty. Check num_clips first, especially if you're iterating with a changing video.
  • num_frames is per-clip, not total. Easy to misread if you're computing progress across the whole video.

For any workflow that splits a video to make it digestible, this is the node that makes the split usable. Small, no magic, and it does exactly what the name says.

Category云服务

Inputs (2)

NameTypeDefaultDescription
indexINT0
clipsLIST

Outputs (3)

NameTypeDescription
imagesIMAGE
audioAUDIO
num_framesINT