{"record":{"id":"17a4976cb0dc05c7","repo":"sgl-project/sglang","slug":"ref2va-requires-at-least-one-of-reference-image-r","errorCode":null,"errorMessage":"ref2va requires at least one of reference_image, reference_video, or reference_audio","messagePattern":"ref2va requires at least one of reference_image, reference_video, or reference_audio","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/nodes.py","lineNumber":744,"sourceCode":"                    \"uri\": self._material_uri(reference_video),\n                    \"role\": \"reference\",\n                }\n            )\n        if reference_audio:\n            conditions.append(\n                {\n                    \"type\": \"audio\",\n                    \"uri\": self._material_uri(reference_audio),\n                    \"role\": \"reference\",\n                }\n            )\n\n        # 2. reject wiring the server would reject anyway, but name the input\n        #    the user has to change\n        if task == \"fl2va\" and not (first_frame is not None or last_frame is not None):\n            raise ValueError(\"fl2va requires first_frame, last_frame, or both\")\n        if task == \"ref2va\" and not conditions:\n            raise ValueError(\n                \"ref2va requires at least one of reference_image, \"\n                \"reference_video, or reference_audio\"\n            )\n        if task == \"t2va\" and conditions:\n            raise ValueError(\"t2va takes no conditioning inputs; pick another task\")\n\n        # 3. `target` resolves the aligned canvas and frame count; the `size`\n        #    the server API always sends is unused by H3\n        extra_fields = {\n            \"task\": task,\n            \"conditions\": conditions,\n            \"target\": {\n                \"short_edge\": short_edge,\n                \"aspect_ratio\": aspect_ratio,\n                \"duration_seconds\": duration_seconds,\n            },\n            \"flow_shift\": flow_shift,\n            \"audio_flow_shift\": audio_flow_shift,","sourceCodeStart":726,"sourceCodeEnd":762,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/nodes.py#L726-L762","documentation":"Raised by the ComfyUI SGLDiffusion MiniMax-H3 node when task='ref2va' (reference-to-video) but no reference_image, reference_video, or reference_audio is provided. It mirrors server-side validation locally so the user knows which input to wire.","triggerScenarios":"Calling generate() with task='ref2va' and all of reference_image, reference_video, reference_audio unset (empty conditions).","commonSituations":"Choosing ref2va in ComfyUI without attaching any reference nodes; assuming the prompt alone is enough after switching tasks.","solutions":["Wire at least one of reference_image, reference_video, or reference_audio","If you have no references, use task 't2va' (text-only)","If you only have start/end frames, use task 'fl2va'"],"exampleFix":"// before\ntask='ref2va', no reference inputs connected\n// after\ntask='ref2va', reference_image=load_image_output","handlingStrategy":"validation","validationCode":"required = ['reference_image','reference_video','reference_audio']\nif task == 'ref2va' and not any(globals()[k] is not None for k in required):\n    raise UserError('ref2va needs a reference input')","typeGuard":null,"tryCatchPattern":"try: node.generate(...) except ValueError as e: show_user(str(e))","preventionTips":["Pre-validate ref2va wiring before queueing the ComfyUI graph","Disable irrelevant task options in the UI per connected inputs"],"tags":["comfyui","sgldiffusion","minimax-h3","input-validation"],"backgroundTag":"missing-required-input","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}