{"record":{"id":"39cf8709ec7e2561","repo":"Comfy-Org/ComfyUI","slug":"anchoring-guide-audio-needs-the-audio-vae-input","errorCode":null,"errorMessage":"anchoring guide audio needs the audio_vae input","messagePattern":"anchoring guide audio needs the audio_vae input","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_minimax_h3.py","lineNumber":223,"sourceCode":"            else:\n                while guide_frames % 17 != 5:\n                    guide_frames -= 1\n\n        resolved_frame_index = frame_idx if frame_idx >= 0 else frame_count + frame_idx\n        if resolved_frame_index < 0 or resolved_frame_index + guide_frames > frame_count:\n            if guide_frames == 1:\n                raise ValueError(\"frame_idx {} is outside the video's {} frames\".format(frame_idx, frame_count))\n            raise ValueError(\"a {} frame guide clip at frame_idx {} does not fit in the video's {} frames\".format(\n                guide_frames, frame_idx, frame_count))\n\n        keyframe = {\"resolved_frame_index\": resolved_frame_index}\n        if image is not None:\n            frames = _resize(image[:guide_frames], width, height, \"center\")\n            keyframe[\"latent\"] = vae.encode(frames)\n\n        if audio is not None:\n            if audio_vae is None:\n                raise ValueError(\"anchoring guide audio needs the audio_vae input\")\n            audio_latent, audio_rt = _encode_ref_audio(audio_vae, audio)\n            # the streams share one time axis: FRAME_RESCALE per pixel frame, 1.0 per audio latent frame\n            max_rt = math.floor(samples.tensors[1].shape[-1] - FRAME_RESCALE * resolved_frame_index)\n            if max_rt < 1:\n                raise ValueError(\"frame_idx {} is past the end of the video's audio track\".format(frame_idx))\n            if audio_rt > max_rt:\n                audio_latent = audio_latent[..., :max_rt].clone()\n            keyframe[\"audio_latent\"] = audio_latent\n\n        keyframes = list(positive[0][1].get(\"minimax_keyframes\", []))\n        keyframes.append(keyframe)\n        positive = node_helpers.conditioning_set_values(positive, {\"minimax_keyframes\": keyframes})\n        return io.NodeOutput(positive)\n\n\nclass MiniMaxH3ReferenceToVideo(io.ComfyNode):\n    \"\"\"ref2va: prompt + reference images / videos / audio -> conditioning + AV latent.\n","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_minimax_h3.py#L205-L241","documentation":"When audio is supplied to MiniMaxH3AddGuide it must be encoded with the audio VAE, so the audio_vae input is mandatory on that path. It is optional only for image-only usage; audio without audio_vae fails fast before _encode_ref_audio would crash on None.","triggerScenarios":"Connecting audio while audio_vae is unconnected; or plugging the video VAE into the wrong socket and leaving audio_vae empty.","commonSituations":"Porting an image-only H3 workflow and adding a soundtrack without the audio VAE loader; swapping vae/audio_vae connections in a crowded graph.","solutions":["Connect the MiniMax H3 audio VAE to the audio_vae input.","Verify socket order: vae for image frames, audio_vae for the soundtrack.","If audio was connected unintentionally, disconnect it to use the image-only path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if audio is not None and audio_vae is None:\n    raise UserFacingError('connect the H3 audio VAE to anchor guide audio')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Connect the audio VAE whenever audio is used.","Do not cross vae and audio_vae sockets."],"tags":["minimax-h3","audio-vae","required-input","wiring"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}