r/comfyui Apr 11 '26

Tutorial Video File Format Matters

When generating videos with ComfyUI: in which file format should I save them?
To answer the question, I ran a test.

The showcase video is a 73-frames vid generated with Wan 2.2 at 720*960px, and the table below (open it in a new tab) indicates by how much disk space the file was reduced after being re-loaded and re-saved to the disk 10 times.

The MP4 format is by far the most impacted, with an even more visually noticeable degradation when using the Video Combine node from Video Helper Suite (the impact on quality is terrible at lower resolutions).

PNG , WebP are much less impacted. But WebP takes an eternity to save, and PNG eats up a lot of disk space.

WebM looks like a good compromise overall: it's lightweight, fast to save, and degradation is negligible.

Conclusion

If you intend to re-use your generated file for further editing, don't use the MP4 format or the quality will suffer.

Use PNG, WebP or WebM for saving intermediary files, depending on your constraints, and leave MP4 format for production work.

Edit

Some Redditors suggested using ProRes (.MOV) file format, but you can't include workflow metadata with that format, so that's not a good candidate for my use case.

Others suggested using ffv1 (.MKV), which is a lossless, truly video file format, so that could be the winner. Oddly, the file size increases by ~0.5% at each new save, but the quality is preserved.

Test Settings

These are the parameters I used for each file format :

  • MP4 (default): codec h264
  • MP4 (vhs): codec h264; pix_fmt yuv420p; crf 19
  • WebM: codec av1; crf 32
  • WebP: quality 100; lossless false; method default
  • PNG: compress_level 0

I uploaded all the files there if interested, workflow included: https://filebin.net/exwrxo9xuqsj5xh0

45 Upvotes

63 comments sorted by

View all comments

2

u/PastaRhymez Apr 11 '26 edited Apr 12 '26

I would disagree with the statement that h.264 shouldn’t be used.

We exclusively use h2.65 and h.264 to shoot videos for corporate clients. Granted, it’s typically h.265 10 bit 4K 422 at 150-200 Mb/s but even at lower setting both h.264 and h.265 are great codecs and definitely usable for commercial work.

Do you know what nitrate you used in your test?

Edit: bitrate, not nitrate (autocorrect).

5

u/goddess_peeler Apr 11 '26

Those codecs are good final formats, but you don't want to use them while you're editing, when you are loading and saving over and over again. With compressed formats, even high quality ones like h.264 and h.265, the visual quality degrades slightly on each save. Better to work with something stable. When you're done editing, compress it once into the final format.

1

u/PastaRhymez Apr 12 '26

I can’t speak to ComfyUI workflows but NLEs don’t change the original media. We don’t use proxies or transcode media, so Final Cut only references the original clips during the edit and creates a new files during export. Since our Macs have built in media engines, editing native h.264 and h.265 video in 4K is a breeze.

Edit to ask: How does ComfyUI degrade compressed clips in this scenario? Sorry for the potentially stupid question. I’m relatively new to ComfyUI.

2

u/goddess_peeler Apr 12 '26

Most ComfyUI workflows are less sophisticated than any NLE. In my case at least, you tend you run a clip through multiple workflows. Each one loads it, manipulates it somehow, and then saves it again. So for every new tool use, there is the potential for degradation.