{"record":{"id":"f98b39d39057e5c9","repo":"Comfy-Org/ComfyUI","slug":"provide-only-one-of-first-frame-or-first-frame-ass","errorCode":null,"errorMessage":"Provide only one of first_frame or first_frame_asset_id, not both.","messagePattern":"Provide only one of first_frame or first_frame_asset_id, not both\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":2499,"sourceCode":"    @classmethod\n    async def execute(\n        cls,\n        model: dict,\n        seed: int,\n        watermark: bool,\n        first_frame: Input.Image | None = None,\n        last_frame: Input.Image | None = None,\n        first_frame_asset_id: str = \"\",\n        last_frame_asset_id: str = \"\",\n    ) -> IO.NodeOutput:\n        validate_string(model[\"prompt\"], strip_whitespace=True, min_length=1)\n        model_id = SEEDANCE_MODELS[model[\"model\"]]\n\n        first_frame_asset_id = first_frame_asset_id.strip()\n        last_frame_asset_id = last_frame_asset_id.strip()\n\n        if first_frame is not None and first_frame_asset_id:\n            raise ValueError(\"Provide only one of first_frame or first_frame_asset_id, not both.\")\n        if first_frame is None and not first_frame_asset_id:\n            raise ValueError(\"Either first_frame or first_frame_asset_id is required.\")\n        if last_frame is not None and last_frame_asset_id:\n            raise ValueError(\"Provide only one of last_frame or last_frame_asset_id, not both.\")\n\n        if model_id == \"dreamina-seedance-2-5-260628\":\n            # 2.5 accepts ratio=\"adaptive\" only here and keeps the first frame's own aspect\n            # (a 1920x1088 frame yields 850x482, not a grid ratio), so pre-sizing the frames to a\n            # supported pixel pair would crop framing the model would otherwise have preserved.\n            request_ratio = \"adaptive\"\n            if first_frame is not None:\n                first_frame = _prepare_seedance_image(first_frame)\n            if last_frame is not None:\n                last_frame = _prepare_seedance_image(last_frame)\n        elif first_frame_asset_id or last_frame_asset_id:\n            request_ratio = model[\"ratio\"]\n            if first_frame is not None:\n                first_frame = _prepare_seedance_image(first_frame)","sourceCodeStart":2481,"sourceCodeEnd":2517,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L2481-L2517","documentation":"Validation in the first/last-frame (keyframe) Seedance node: the first frame can be supplied either as an image tensor (first_frame) or as a previously uploaded asset id string (first_frame_asset_id), but not both at once. Supplying both is ambiguous about which input wins, so the node rejects it before making any API call.","triggerScenarios":"Calling the keyframe node with both first_frame wired to an image AND a non-empty first_frame_asset_id string (after whitespace stripping).","commonSituations":"Workflows migrated from asset-id usage to direct image input where the old asset id string was left in the widget; copying node configurations between graphs.","solutions":["Clear the first_frame_asset_id widget (leave it empty) if you want to feed the image directly.","Or disconnect the first_frame image if you intend to reuse an uploaded asset id."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if first_frame is not None and first_frame_asset_id.strip():\n    raise ValueError(\"pass only one of first_frame / first_frame_asset_id\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat image input and asset-id widget as mutually exclusive alternatives.","Clear asset-id widgets when switching a workflow to direct image inputs."],"tags":["bytedance","seedance","validation","input-conflict","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}