{"record":{"id":"96ff7b1954584c16","repo":"sgl-project/sglang","slug":"fl2va-requires-first-frame-last-frame-or-both","errorCode":null,"errorMessage":"fl2va requires first_frame, last_frame, or both","messagePattern":"fl2va requires first_frame, last_frame, or both","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/nodes.py","lineNumber":742,"sourceCode":"                {\n                    \"type\": \"video\",\n                    \"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            },","sourceCodeStart":724,"sourceCodeEnd":760,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/nodes.py#L724-L760","documentation":"Raised by the ComfyUI SGLDiffusion MiniMax-H3 generate node when the task is 'fl2va' (frame-to-video) but neither first_frame nor last_frame is connected. The node pre-validates wiring the server would reject anyway, so the user is told exactly which input to fix.","triggerScenarios":"Calling the ComfyUI node generate() with task='fl2va' while first_frame=None and last_frame=None (both IMAGE inputs left unconnected).","commonSituations":"Selecting the fl2va task in the ComfyUI dropdown but forgetting to wire a start/end frame; switching tasks from t2va to fl2va without updating the graph inputs.","solutions":["Connect at least one of first_frame or last_frame to an image node","If you only have text, switch task to 't2va'","If you have references instead of frames, use task 'ref2va' and wire reference inputs"],"exampleFix":"// before\ntask='fl2va', first_frame=None, last_frame=None\n// after\ntask='fl2va', first_frame=load_image_node_output, last_frame=None","handlingStrategy":"validation","validationCode":"if task == 'fl2va' and first_frame is None and last_frame is None:\n    raise UserError('wire first_frame or last_frame for fl2va')","typeGuard":null,"tryCatchPattern":"try: node.generate(...) except ValueError as e: show_user(str(e))","preventionTips":["Validate task/input pairs before executing the workflow","Build task->required-inputs lookup table in your graph loader"],"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"}