Nodes/ComfyUI-DragNUWA/Get First Image
ComfyUI Node

Get First Image

Get First Image

By chaojie·Created 3 years ago·Updated 2 years ago· 411
Get First Image
  • images
  • IMAGE

Get First Image is a tiny utility that takes an IMAGE batch and returns just the first frame as a single image. That's the whole job. You don't use it to look at things - you use it to feed loops.

In this pack's world, an "image" is often really a video in disguise: DragNUWA Run and DragNUWA Run MotionBrush output a batch of 14 frames as one IMAGE tensor. If you want to keep animating - feeding the result of one clip into the next - you need a way to peel a specific frame back out of that batch. Get First Image does it, and its sibling Get Last Image does the opposite. The pack's Loop/LoopStart_IMAGE/LoopEnd_IMAGE rig uses exactly this kind of frame extraction to chain clips together: take the last frame of a generation, make it the first frame of the next drag, and you've got an iterative animation rather than a one-shot 14 frames.

The one input, the one output

  • images - an IMAGE tensor, typically the frame batch coming off a DragNUWA run node.
  • Output: an IMAGE containing just the first frame of the batch.

Under the hood it's plain tensor indexing - the node pulls index 0 off the batch dimension. Nothing clever, nothing destructive; the source batch is untouched.

Why not just wire things directly?

Because ComfyUI's batch semantics are the thing that burns people. The moment two nodes disagree about whether they're passing one image or fourteen, you get dimension errors or - worse - silent multiplications where a frame batch flows into something expecting a single image and you get fourteen copies of the same drag. A batch isn't a loop, and every IMAGE port in this pack can secretly be a stack of frames. An explicit Get First Image makes the "I want exactly one frame here" intent visible in the graph, which is worth more than it sounds in a workflow you'll come back to in a week.

It's also useful outside DragNUWA - any video-to-images node that dumps a frame stack can be cut down to its first frame for a still preview or a conditioning input. If you find yourself typing "just give me the first frame" in your head, this is that.

A word of caution, since this pack ships a Loop family that's frankly hacky: don't confuse a utility node with the looping mechanism. Get First Image just extracts; whether the graph actually re-runs and feeds the extracted frame forward is a separate question, and the answer with the Loop nodes is "kind of, via a mutable attribute and a changed-check hack." More on that in the Loop articles. For the common case - start a chain, or inspect the head of a batch - this little node is all you need.

CategoryDragNUWA

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE