WebP to PNG Sequence
Load an Animated WebP Back Into ComfyUI as Real Frames
- image
- IMAGE
WebP is the sneakiest format in ComfyUI. Video Helper Suite happily writes animated WebP as a compact preview, Discord and GitHub issues love it as a preview format - but ComfyUI's core Load Image only reads the first frame of an animated file. So the moment someone hands you a .webp animation and says "do something with this," you're stuck with one static frame and no way forward. WebP to PNG Sequence is the two-line bridge across that gap: it reads an animated (or still) WebP from disk, dumps every frame as a numbered PNG, and hands the whole thing back to your graph as a proper batched IMAGE.
How it works
The mechanism is blessedly simple, which is why it just works. The node opens your WebP with Pillow, walks it with ImageSequence.Iterator, converts each frame to RGBA, and saves it as {prefix}{i:04d}.png inside your ComfyUI output folder. At the same time it stacks every frame into one tensor along the batch dimension and returns it - so what comes out of the IMAGE port behaves exactly like the batch you'd get from an AnimateDiff or a VHS video load. Wire that into a video encoder, an upscaler, or another AnimateDiff pass and you're working with the full animation, not a poster frame.
The inputs that matter
You only really touch three of the four inputs:
webp_file- the filesystem path to your WebP. It's a plain text field, no file picker, and there's no path magic: it callsos.path.exists()on whatever you type. Use an absolute path; a relative one resolves against the directory you launched ComfyUI from, not ComfyUI's root.output_dir- a subfolder underComfyUI/output/. The default is literally"output", so out of the box your PNGs land inComfyUI/output/output/frame_0000.png. It's not a bug, but you'll want to set something likewebp_framesor blank it out to avoid the nested folder.prefix- filename prefix, defaultframe_. Zero-padded to four digits:frame_0000.png,frame_0001.png, …
The fourth input, image, is the sneaky one. It's marked required, but it's really a fallback passthrough: if the file is missing or fails to open, the node prints an error to the console and returns this image untouched. You must wire something in to satisfy the port, but whatever you feed it only appears if the conversion fails.
The single output is IMAGE - the batched frame tensor, ready for whatever eats a video batch.
Install
ComfyUI Manager → search "ComfyUI-WebpToPNGSequence", or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/Sekiun/ComfyUI-WebpToPNGSequence
Then restart ComfyUI. There's no requirements.txt, no model download, nothing heavy - it only uses Pillow, numpy, and torch, all of which ship with ComfyUI already. This is about as frictionless as a custom node gets.
Where people get burned
- Silent failure. Point
webp_fileat a typo'd path and the graph doesn't error - you get your fallbackimageand a line in the console you probably didn't read. If the output looks like nothing happened, check the terminal first. - RGBA surprises. Frames come out as 4-channel RGBA tensors. Most nodes handle that fine, but if a downstream model or encoder complains about channels, route through a convert-to-RGB node first.
- It's not an output node, despite the name. It saves the PNGs and passes the frames on - don't let it be the last node in your graph if you wanted a preview, or you'll wonder where your video went.
It's a one-trick pack by a Japanese hobbyist dev, and the trick is exactly what it says on the tin. When your workflow touches animated WebP at all, this is the node you reach for.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| webp_file | STRING | — | |
| output_dir | STRING | output | — |
| prefix | STRING | frame_ | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |