{"record":{"id":"4d1e05a996332cdf","repo":"Comfy-Org/ComfyUI","slug":"minimax-music3-generated-zero-audio-frames","errorCode":null,"errorMessage":"MiniMax Music3 generated zero audio frames","messagePattern":"MiniMax Music3 generated zero audio frames","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/minimax_music/ar.py","lineNumber":342,"sourceCode":"            feedback_codes = depth_io[\"codes\"]\n            depth_hidden = depth_io[\"depth_hidden\"]\n            frame_hidden = torch.cat((last_hidden[:1].detach(), depth_hidden), dim=-1)\n            if frame_index > 0:\n                pending_hidden = frame_hidden[0].clone()\n\n            feedback = self._embed_audio_frame(feedback_codes, execution_dtype)\n            output = self.model(None, embeds=feedback, past_key_values=past, dtype=execution_dtype)\n            last_hidden = output[0][:, -1]\n            past = output[2]\n\n        if pending_hidden is not None and len(hidden_frames) < decode_limit:\n            if pending_event is not None:\n                pending_event.synchronize()\n            if int(pending_code.item()) != stop_token:\n                hidden_frames.append(pending_hidden)\n\n        if not hidden_frames:\n            raise ValueError(\"MiniMax Music3 generated zero audio frames\")\n        return torch.stack(hidden_frames).to(device=\"cpu\")\n","sourceCodeStart":324,"sourceCodeEnd":344,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/minimax_music/ar.py#L324-L344","documentation":"Raised by MiniMax Music3's generation loop when it finishes without producing any audio frames — the stop token appeared before the first audio code was committed (or the pending first frame was a stop). It is a post-loop invariant check: the AR decoder emitted '<|audio_end|>' immediately, so there is nothing to decode into audio.","triggerScenarios":"The first sampled code equals the stop token, or generation is constrained (vocab_mask/cfg) so the model immediately ends audio; extremely high/low cfg_scale or a degenerate prompt can make the stop token the argmax.","commonSituations":"Malformed prompt templates (missing <|audio_start|>), cfg_scale far out of range, a different tokenizer/special-token mapping, or a prompt that is all padding/CFG tokens so the model ends audio instantly.","solutions":["Retry with a different seed and a moderate cfg_scale (near the default CFG_SCALE)","Verify the prompt template is well-formed (caption/lyrics sections and <|audio_start|> present)","Run validate_tokenizer on the tokenizer to confirm special token ids match what the model expects"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    frames = generate(...)\nexcept ValueError as e:\n    if 'zero audio frames' in str(e):\n        # degenerate stop: resample with a new seed and default cfg\n        frames = generate(..., seed=new_seed, cfg_scale=CFG_SCALE)\n    else:\n        raise","preventionTips":["Keep cfg_scale near the documented default","Run validate_tokenizer once at load so special-token ids are known-good","Verify prompt template structure before generation"],"tags":["minimax","music","audio-generation","inference"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}