Nodes/Load GIF as Video/Save as Animated WebP
ComfyUI Node

Save as Animated WebP

Saves a VIDEO or an image batch as an animated WebP, lossless or lossy, with the same frame-dropping, scaling and tone controls as Save as GIF. The frames as written come back out as an IMAGE batch so the result can be inspected without opening the file.

By id-fa·Created 3 months ago·Updated a day ago· 2
Save as Animated WebP
  • video
  • images
  • images
  • info
◄filename_prefixComfyUI►
◄source_fps12.0►
◄fps12.0►
◄width0►
◄height0►
◄size_modepad►
◄resamplelanczos►
◄losslesstrue►
◄quality80►
◄method4►
◄loop_count0►
◄gamma1.00►
Categoryload-gif-as-video

Inputs (14)

NameTypeDefaultDescription
filename_prefixSTRINGComfyUIPrefix for the file written into the ComfyUI output directory.
source_fpsFLOAT12.00.1–240The rate an `images` batch is meant to play at. Ignored when `video` is connected — a VIDEO carries its own rate. This is only the description of the input; `fps` is what gets written.
fpsFLOAT12.00.1–60Frame rate of the WebP. Set it below the source rate to drop frames: the animation runs for the same length of time on fewer frames, which is the cheapest way to shrink the file. Raising it above the source rate does nothing.
widthINT00–8192Output width in pixels. 0 keeps the source width, or derives it from `height`. With both set, the frame is scaled to fit inside the box keeping its aspect ratio; `size_mode` decides what happens to the room left over.
heightINT00–8192Output height in pixels. 0 keeps the source height, or derives it from `width`.
size_modeCOMBOpadWhat `width` x `height` means when the source has a different aspect ratio. pad: the box is the canvas — the frame is centred and the leftover bars are written transparent, so the WebP is exactly the requested size. fit: the frame is scaled to the largest size that fits inside the box and written at that size, with no bars. Same thing whenever only one of width/height is set.
resampleCOMBOlanczosFilter used when scaling. lanczos is the sharpest downscale; box and hamming are softer and compress a little better; nearest keeps pixel art and hard-edged animation crisp instead of blurring it.
losslessBOOLEANtrueLossless WebP stores every pixel exactly, so the file decodes back to the `images` output bit for bit; `quality` then only trades encode time for file size. Off writes lossy WebP (VP8), where `quality` is the usual quality/size trade and is much smaller on photographic material.
qualityINT800–100Lossy: picture quality, 0 (smallest, ugliest) to 100 (largest, nearly lossless). Lossless: compression effort, 0 (fastest) to 100 (smallest) — the pixels are exact either way.
methodINT40–6How hard libwebp tries, 0 (fastest) to 6 (slowest, smallest). Never changes the picture at a given quality, only the time and the size; 6 can take several times as long as 4 for a few percent off the file.
loop_countINT00–1000How many times the animation plays. 0 loops forever.
gammaFLOAT1.000.1–10Tone correction applied to the frames before they are encoded. 1.0 leaves them alone; above it brightens the midtones, below it darkens them, and black and white stay put. The `images` output shows the corrected result.
videooptVIDEOThe video to save. Its frame rate is used as-is.
imagesoptIMAGEFrames to save, timed by the `source_fps` widget. Connect this or `video`, not both.

Outputs (2)

NameTypeDescription
imagesIMAGE—
infoSTRING—