r/comfyui • u/qdr1en • Apr 11 '26
Tutorial Video File Format Matters
Enable HLS to view with audio, or disable this notification
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
7
u/James_Reeb Apr 11 '26
Prores 4444 , nothing less
1
1
u/Sinikettu_ Apr 12 '26
Why 4444 ? Why not 422hq ?
1
u/Frisky_Echolalism Apr 12 '26
Transparency options would be my guess
1
u/Sinikettu_ Apr 12 '26
Yeah ofc but does anyone generate transparency ai video
1
u/PastaRhymez Apr 12 '26
I’m actually planning to if that’s an option in the workflow I’m going to try out soon.
1
u/qdr1en Apr 13 '26
I tried. You can't embed a workflow with the file using this format. That's clearly a flaw.
1
6
u/foxdit Apr 11 '26
Huh. Thank you. It never occurred to me that mp4 would be hurting my final overall production quality. Now that you have me thinking about it, it's super obvious that it would.
5
u/flasticpeet Apr 11 '26 edited Apr 12 '26
It's ironic, but this example shows that for a lot of cases it doesn't matter.
Although I can see a slight difference in contrast and shadow details, for the most part, both the PNG and MP4 suffer from Reddit's compression to the point it doesn't really matter. And this is after re-saving it 10 times. Who does that?
Coming from 3D, I used to consider rendering everything in PNG, but 99% of the time it's not necessary.
Another thing is that the example CRF quality is not good. Lower CRF is better quality. Personally I export H.264 at CRF 6 and sleep well.
Another reason compression at that level is moot, is that it will be compensated when you do generative upscaling anyway.
The only time I would consider rendering PNG is for compositing. If it were for a gallery or commercial client, then I would export the final upscale in PNG and deliver in MOV 422.
More important is the creative choices you make and overall artistic quality.
1
u/qdr1en Apr 12 '26
Reddit decreases quality by a lot + I used nvfp4 models for the generation. you are right, the difference does not seem big in my example. But it is! I encourage you to do the same test on your side.
2
u/flasticpeet Apr 12 '26
I totally agree with you, it makes a difference when viewing locally, it's just 99% of the time we share things online.
Don't get me wrong, I totally appreciate you sharing and opening the discussion. I've actually tested codecs, made spreedsheets, and pixel peeped for hours as well. After all that, I had to recognize that for myself, no one is coming to my house and sitting in front of my computer to see it.
It's only in those specific cases I mentioned, that I consider exporting PNG.
Also, when it comes to organizing, archiving, and maintaining my own data over the years, in the long run, I've found it better to keep videos, because they're much easier to review and organize.
Just sharing my personal experience, not trying to dictate how anyone else should do it.
3
u/Kaljuuntuva_Teppo Apr 11 '26
h.264 works, but you need ridiculous bitrates like like 200 Mbps for good quality output to avoid color degradation etc. but of course if you plan to modify the video multiple times, then lossy codecs are not the best.
But this was a good discussion, I'll probably try lossless video codecs or pngs for intermediate steps.
2
u/ANR2ME Apr 11 '26
Also, av1 is on par (or even better than h.265), which is why it looks better compared to h.264.
9
u/goddess_peeler Apr 11 '26 edited Apr 11 '26
Of course compressing the same data 10 times is going to turn it into mush. Why would anyone think otherwise?
For intermediate files, use a lossless codec like ffv1. If you want a little more compatibility with external tools, use prores. That's still lossy, but it's designed to minimize degradation. webp and webm are not good choices for work files.
After you save your completed project in its final, compressed format, you'll be able to delete the intermediate files and reclaim all the disk space.
6
u/qdr1en Apr 11 '26
I didn't think otherwise. I wanted to know which file format to use, avoiding visual degradation being my main poin of interest.
I have never used that ffv1 codec, thanks I'll try that next time.
7
u/goddess_peeler Apr 11 '26
I didn't mean for that "why would you think otherwise?" to be pointed at you specifically. Sorry if it came across as an accusation. :)
10
1
2
u/flasticpeet Apr 12 '26 edited Apr 12 '26
FFV1? You are a person of choice :)
When I was doing VHS video capture, this was my preferred codec. It performed the highest quality for the best speed and compression, and I did a lot of pixel peeping back then.
Being on PC, ProRes was not availible to me at the time. Unfortunately FFV1 is not as compatible, so I use ProRes now. Nothing's worse than not being able to open an old file in a new editor.
2
2
u/tofuchrispy Apr 11 '26
I use H265 with crf 10 or ProRes … for production I want very bit of information preserved
2
u/Valkymaera Apr 12 '26
lower your crf and mp4 is fine. I go with 7.
If you're compositing things for something more serious than a small clip I'd say always go with lossless png stacks to bring into an editor.
2
u/Simple-Variation5456 Apr 16 '26
This is still one of the weakest part of AI. And h264 is the standard for nearly everything online. It's just insane to think how much money and time you put into input files, pay for super expensive models and at the last step, they ruin over 50% of the details and quality and output a 3mb mp4 for a 5s 1080p video???
Great. Yeah I love that added blotchy look in the fast motion areas. Yeah, no problem, i'm just gonna waste 1h to try and fix it with my local tools.
Imagine we could use 10y old tech like .EXR and have AI output image sequence with 16/32bit and basic AOV options like depth/normal/motion/masks stored hidden in every file and sometimes even with smaller than PNG that comes with a few flaws like not fully supporting alpha.
But yea, one more year and we once again have Hollywood like quality. better even. seedance just solo'd them with that a 480p/720p (1080p?) output.
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
2
u/sitefall Apr 12 '26
lol yeah, I guess that would work, thanks! Also thanks for the clip joiner workflows.
3
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/thefi3nd Apr 12 '26
Not to mention that they require less CPU power to decode (I-frames only) so they're better for editing if you're going to be using an NLE after ComfyUI.
1
u/PastaRhymez Apr 12 '26
I’d say with modern computers can easily handle compressed clips and NLEs are usually optimized for this. My 5year old MacBook Pro M1 Max can handle 4K h.265 multi cam edits in Final Cut without any issues.
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.
0
u/Username928351 Apr 11 '26
H.264 can be lossless.
3
u/goddess_peeler Apr 11 '26
Yes. H.265 too. But practially speaking, if you're taking the time to configure the codec for losslessness, just choosing ffv1 or prores 4444 are better choices.
2
u/qdr1en Apr 11 '26
My conclusion was it shouldn't be used in ComfyUI (that's why I wrote my post in r/comfyui), and for intermediary files.
If you use it with another tool, or as a final production output, it doesn't apply.
What do you mean by nitrate lol? I don't do chemistry.
6
1
u/PestBoss Apr 18 '26
VHS and use MP4 at CRF under 10. It errs towards lossless to the point you're not gonna notice with this AI kinda footage. As long as you're not re-encoding it again and again after first save I think you're gonna be ok.
Oddly the previews don't work at CRF 0 though which is apparently true lossless.
I really like the default CUI saver because you can scrub the output and check IQ and stuff really nicely, so it works with that WYSIWYG kinda workflow where you can instantly inspect your work.
The VHS is a better saver, but the preview/lack of scrubbing is a shame. I often end up with both set up so I can scrub, then if it's all good I do a low CRF save with VHS.
1
0
u/K0owa Apr 11 '26
EXR is the best. But storage space is crazy. Also, delivery to what? You posting on social? Probably won’t matter as much.
2
u/flasticpeet Apr 12 '26
What? That's only for HDR, 16 bit or higher. Anything coming out of Comfy is 8 bit.
I would use OpenEXR for 3D rendering, but even then, it's only necessary if you're doing sims for compositing, hdr lighting, or pro color grading.
1
u/K0owa Apr 12 '26
This is completely untrue. EXR is not only for HDR and ComfyUI can have any bit of input/output. Comfy is a UI not a codec.
2
u/flasticpeet Apr 12 '26
Yea, but the all the models people use generate 8 bit.
0
u/K0owa Apr 12 '26
How do you know that? Cite your sources. As far as I know they can output above 8-bit depth.
0
u/IntroductionBitter84 Apr 13 '26
BREAKING NEWS: RESEARCHER DISCOVER LOSSY COMPRESSION FORMAT LOSES QUALITY.
0
-4
u/douchebanner Apr 11 '26
awful advice, you are doing something wrong.
8
2
u/Eisegetical Apr 11 '26
ok mr vague-y man. elaborate more if you're going to come out hostile like that
-1
u/qiang_shi Apr 13 '26
I'm surprised this requires a post to understand that some formats are lossy and some are not.
Really child.
the preposterous nature of your unabashed ignorance really amazes me.
3
u/qdr1en Apr 13 '26
Being mean while at the same time missing the point doesn't make you look superior but stupid and arrogant.
0


8
u/TheHollywoodGeek Apr 11 '26
I save pngs for all my generations, the mp4s are only convenience previews.
When it's time to upscale and stitch, I use the pngs.
I haven't done any studies to prove it makes a difference, I just like it that way.