From 1aec3a1351f7f5b7280553569a0dbef993b79e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Sepp=C3=A4nen?= <40791699+kijai@users.noreply.github.com> Date: Thu, 3 Sep 2026 22:51:47 +0300 Subject: [PATCH] MiniMax-H3: Make VAE optional, allow using text encoder only references (#16065) --- comfy_extras/nodes_minimax_h3.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/comfy_extras/nodes_minimax_h3.py b/comfy_extras/nodes_minimax_h3.py index 9ac827b0a..108dee13c 100644 --- a/comfy_extras/nodes_minimax_h3.py +++ b/comfy_extras/nodes_minimax_h3.py @@ -256,8 +256,8 @@ class MiniMaxH3ReferenceToVideo(io.ComfyNode): category="model/conditioning/minimax", inputs=[ io.Clip.Input("clip"), - io.Vae.Input("vae"), - io.Vae.Input("audio_vae"), + io.Vae.Input("vae", optional=True, tooltip="Video VAE. Without it reference images/videos only condition the text encoder."), + io.Vae.Input("audio_vae", optional=True, tooltip="Audio VAE. Without it reference audio only conditions the text encoder."), io.String.Input("prompt", multiline=True, dynamic_prompts=True), io.Int.Input("width", default=1344, min=32, max=nodes.MAX_RESOLUTION, step=32), io.Int.Input("height", default=768, min=32, max=nodes.MAX_RESOLUTION, step=32), @@ -285,7 +285,7 @@ class MiniMaxH3ReferenceToVideo(io.ComfyNode): ) @classmethod - def execute(cls, clip, vae, audio_vae, prompt, width, height, length, ref_image_size="match", + def execute(cls, clip, prompt, width, height, length, ref_image_size="match", vae=None, audio_vae=None, ref_images=None, ref_videos=None, ref_video_audios=None, ref_audios=None) -> io.NodeOutput: latent, frame_count = _empty_av_latent(width, height, length) @@ -304,9 +304,10 @@ class MiniMaxH3ReferenceToVideo(io.ComfyNode): tw = max(CANVAS_MULTIPLE, round(w * scale / CANVAS_MULTIPLE) * CANVAS_MULTIPLE) th = max(CANVAS_MULTIPLE, round(h * scale / CANVAS_MULTIPLE) * CANVAS_MULTIPLE) resized = _resize(img[:1], tw, th, "disabled") - z = vae.encode(resized) ref_items.append({"type": "image", "data": resized}) - ref_blocks.append({"kind": "image", "latent_h": th // 16, "latent_w": tw // 16, "latent": z}) + if vae is not None: + z = vae.encode(resized) + ref_blocks.append({"kind": "image", "latent_h": th // 16, "latent_w": tw // 16, "latent": z}) ref_video_audios = ref_video_audios or {} for name, video_frames in (ref_videos or {}).items(): @@ -328,10 +329,7 @@ class MiniMaxH3ReferenceToVideo(io.ComfyNode): while n % 17 != 5: n -= 1 frames = frames[:n] - z = vae.encode(frames) - audio_latent, ref_audio_t = (None, 0) if soundtrack is not None: - audio_latent, ref_audio_t = _encode_ref_audio(audio_vae, soundtrack) # the soundtrack gets its own