🖼️ 获取片段图片和音频
Frames, audio, and frame count
- clips
- images
- audio
- num_frames
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 fromSplitVideoByFrames.- 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:
SplitVideoByFrames- long video in, N clips out.GetVideoClipByIndex- pick clip #k, get its frames and audio.- Process those frames however you like - img2img, a vision LLM, captioning.
- 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
clipsis opaque on the canvas. You can't inspect a LIST the way you can inspect an IMAGE preview. You'll know the clip count fromSplitVideoByFrames'num_clipsoutput - 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_clipsfirst, especially if you're iterating with a changing video. num_framesis 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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| index | INT | 0 | — |
| clips | LIST | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| audio | AUDIO | — |
| num_frames | INT | — |