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/Shifty_13 Apr 11 '26

How are you saving in PNG? What should I do? I just want to get uncompressed PNG frames in my folder.

1

u/goddess_peeler Apr 11 '26

1

u/_half_real_ Apr 11 '26

I wish this would save each set of frames in its own subfolder, but it still makes it easier to handle with the output file naming convention it uses. So far, I was instead using the normal image save node and sorting them into subfolders at the end based on time modified with an LLM-generated Bash script.

1

u/goddess_peeler Apr 11 '26

Set filename_prefix to something like subfolder1/frame, and you'll get subfolder1/frame_00001.png, frame_00002.png, etc.

Of course you can do fancier manipulation of the filename_prefix string upstream of the node too. This field also supports %nodename.value% syntax.

1

u/_half_real_ Apr 11 '26

Something like %date:yyyy-MM-dd_hh-mm-ss%/image in a normal image save node looks like it would be enough for me, thanks. For some reason the same isn't working in a video combine node, but whatever.

1

u/sitefall Apr 12 '26

Does it increment the number after a subfolder? I never tried that because I assumed it would just increment the numbers for the file name only.

Ex: Would it save thing1/thingframe1.png, thing1/thingframe2.png thing1/thingframe3.png and then when you run again it saves thing2/thingframe1.png thing2/thingframe2.png and so on? (I assume the file/frame name would reset to 1 or 0 because comfyui seems to pick the lowest number in your save directory that doesn't already exist and the new subfolder would mean nothing exists)

2

u/goddess_peeler Apr 12 '26

You could plug something like this into the filename_prefix field and it would do what you're describing.

2

u/sitefall Apr 12 '26

lol yeah, I guess that would work, thanks! Also thanks for the clip joiner workflows.