{"record":{"id":"11d8dbc6dc85c81f","repo":"Comfy-Org/ComfyUI","slug":"minimaxh3addguide-needs-an-image-or-an-audio-to-an","errorCode":null,"errorMessage":"MiniMaxH3AddGuide needs an image or an audio to anchor","messagePattern":"MiniMaxH3AddGuide needs an image or an audio to anchor","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_minimax_h3.py","lineNumber":192,"sourceCode":"                io.Vae.Input(\"vae\", optional=True, tooltip=\"Video VAE, needed when an image is connected.\"),\n                io.Vae.Input(\"audio_vae\", optional=True, tooltip=\"Audio VAE, needed when an audio is connected.\"),\n                io.Latent.Input(\"latent\"),\n                io.Image.Input(\"image\", optional=True, tooltip=\"Image or video frames to anchor. Multi-frame batches are anchored as a clip and cropped down to the model's valid clip lengths: 5, 22, 39... (17k + 5) frames. Batches shorter than 5 frames use only the first image.\"),\n                io.Audio.Input(\"audio\", optional=True,\n                               tooltip=\"Soundtrack to anchor starting at the same frame index, cropped to the video's remaining duration.\"),\n                io.Int.Input(\"frame_idx\", default=0, min=-9999, max=9999,\n                             tooltip=\"Frame index to anchor the image or the clip's first frame at. Negative values are counted from the end of the video.\"),\n            ],\n            outputs=[io.Conditioning.Output(display_name=\"positive\")],\n        )\n\n    @classmethod\n    def execute(cls, positive, latent, frame_idx, vae=None, audio_vae=None, image=None, audio=None) -> io.NodeOutput:\n        samples = latent[\"samples\"]\n        if not samples.is_nested or len(samples.tensors) != 2 or samples.tensors[0].ndim != 5 or samples.tensors[0].shape[1] != 24:\n            raise ValueError(\"MiniMaxH3AddGuide expects a MiniMax H3 AV latent\")\n        if image is None and audio is None:\n            raise ValueError(\"MiniMaxH3AddGuide needs an image or an audio to anchor\")\n        video = samples.tensors[0]\n        height = video.shape[3] * 16\n        width = video.shape[4] * 16\n        frame_count = sum(FRAME_PER_TOKEN[k % 5] for k in range(video.shape[2]))\n\n        guide_frames = 1\n        if image is not None:\n            if vae is None:\n                raise ValueError(\"anchoring guide frames needs the vae input\")\n            guide_frames = image.shape[0]\n            if guide_frames < 5:\n                guide_frames = 1\n            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:","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_minimax_h3.py#L174-L210","documentation":"MiniMaxH3AddGuide requires at least one anchor medium: an image (guide frame / first-frame clip) or an audio track. Both inputs are optional individually, but leaving both unconnected makes the node a no-op, so it fails fast instead of silently returning unchanged conditioning.","triggerScenarios":"Calling execute with image=None and audio=None, typically by leaving both optional sockets unconnected in the graph.","commonSituations":"Building the graph incrementally and previewing before wiring the guide; misreading 'optional' as 'not required at all'; a switch/mux node that returns None on the inactive branch.","solutions":["Connect an image batch or an audio clip to the corresponding input.","If you only want to pass conditioning through unchanged, remove the node from the chain.","If a conditional branch may supply neither, gate the node with a bypass/switch so it never executes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if image is None and audio is None:\n    raise UserFacingError('connect an image or an audio to MiniMaxH3AddGuide')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wire at least one anchor medium before queueing.","Bypass the node when neither input is connected.","Watch mux/switch nodes that can return None."],"tags":["minimax-h3","required-input","wiring"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}