From 9d47049f98fcb9fef8846095ef2eff0942ded972 Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Tue, 22 Apr 2025 20:39:11 +0100 Subject: [PATCH] Replace aom-av1 with svt-av1 Use yuv420p10le for av1 --- comfy_extras/nodes_video.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/comfy_extras/nodes_video.py b/comfy_extras/nodes_video.py index 331f1b651..a9e244ebe 100644 --- a/comfy_extras/nodes_video.py +++ b/comfy_extras/nodes_video.py @@ -20,10 +20,9 @@ class SaveWEBM: return {"required": {"images": ("IMAGE", ), "filename_prefix": ("STRING", {"default": "ComfyUI"}), - "codec": (["vp9", "av1", "svt-av1"],), + "codec": (["vp9", "av1"],), "fps": ("FLOAT", {"default": 24.0, "min": 0.01, "max": 1000.0, "step": 0.01}), "crf": ("FLOAT", {"default": 32.0, "min": 0, "max": 63.0, "step": 1, "tooltip": "Higher crf means lower quality with a smaller file size, lower crf means higher quality higher filesize."}), - "pixel_format": (["yuv420p", "yuv420p10le"],), }, "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"}, } @@ -37,7 +36,7 @@ class SaveWEBM: EXPERIMENTAL = True - def save_images(self, images, codec, fps, filename_prefix, crf, pixel_format="yuv420p", prompt=None, extra_pnginfo=None): + def save_images(self, images, codec, fps, filename_prefix, crf, prompt=None, extra_pnginfo=None): filename_prefix += self.prefix_append full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0]) @@ -51,14 +50,14 @@ class SaveWEBM: for x in extra_pnginfo: container.metadata[x] = json.dumps(extra_pnginfo[x]) - codec_map = {"vp9": "libvpx-vp9", "av1": "libaom-av1", "svt-av1": "libsvtav1"} + codec_map = {"vp9": "libvpx-vp9", "av1": "libsvtav1"} stream = container.add_stream(codec_map[codec], rate=Fraction(round(fps * 1000), 1000)) stream.width = images.shape[-2] stream.height = images.shape[-3] - stream.pix_fmt = pixel_format + stream.pix_fmt = "yuv420p10le" if codec == "av1" else "yuv420p" stream.bit_rate = 0 stream.options = {'crf': str(crf)} - if codec == "svt-av1": + if codec == "av1": stream.options["preset"] = "6" for frame in images: