{"record":{"id":"96e5fe0d0bfaa357","repo":"calesthio/OpenMontage","slug":"kling-identify-face-response-contained-no-faces","errorCode":null,"errorMessage":"Kling identify-face response contained no faces","messagePattern":"Kling identify-face response contained no faces","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/avatar/kling_lip_sync.py","lineNumber":275,"sourceCode":"    def _identify_faces(self, client: KlingClient, inputs: dict[str, Any]) -> dict[str, Any]:\n        request = self._build_identify_request(inputs)\n        data = client.post(request[\"path\"], request[\"payload\"])\n        payload = data.get(\"data\") or {}\n        session_id = payload.get(\"session_id\")\n        if not session_id:\n            raise ValueError(f\"Kling identify-face response missing data.session_id: {data}\")\n        faces = (\n            payload.get(\"face_data\")\n            or payload.get(\"faces\")\n            or payload.get(\"face_list\")\n            or payload.get(\"face_infos\")\n            or payload.get(\"faces_info\")\n            or []\n        )\n        if not isinstance(faces, list):\n            raise ValueError(\"Kling identify-face response face list is not a list\")\n        if not faces:\n            raise ValueError(\"Kling identify-face response contained no faces\")\n        return {\n            \"session_id\": str(session_id),\n            \"faces\": faces,\n            \"raw_response\": data,\n            \"request\": request,\n        }\n\n    def _identify_result(self, inputs: dict[str, Any], identify: dict[str, Any], start: float) -> ToolResult:\n        artifact_path = self._write_faces_artifact(inputs, identify)\n        return ToolResult(\n            success=True,\n            data={\n                \"provider\": self.provider,\n                \"model\": \"kling-official-lip-sync\",\n                \"operation\": \"identify_face\",\n                \"session_id\": identify[\"session_id\"],\n                \"faces\": identify[\"faces\"],\n                \"face_count\": len(identify[\"faces\"]),","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/avatar/kling_lip_sync.py#L257-L293","documentation":"ValueError from _identify_faces when the response parsed cleanly (session_id present, face list is a list) but the list is empty. Kling analyzed the video and found zero human faces, so there is nothing to lip-sync. This is a content problem: the video does not contain a detectable face.","triggerScenarios":"Running identify_face on a video with no people (landscape, screen recording, text-only frames); a face too small/obscured/back-lit for the detector; an animated/illustrated character the detector does not recognize.","commonSituations":"Wrong video passed (b-roll instead of the talking-head clip); low-resolution uploads; side profiles or heavy occlusion; cartoon avatars.","solutions":["Confirm you passed the intended video (video_url/video_id) — check for a mix-up with b-roll.","Use a clip with a clearly visible, front-facing, reasonably sized human face.","Re-upload at higher resolution if the source was heavily compressed or small.","For animated characters, use a different pipeline — face identification is tuned for real humans."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    identify = tool._identify_faces(client, inputs)\nexcept ValueError as e:\n    if \"contained no faces\" in str(e):\n        # content issue: swap in a clip with a clearly visible human face\n        raise","preventionTips":["Pre-check videos contain a visible front-facing face before running the lip-sync flow","Use high-resolution talking-head footage; avoid animated characters for this endpoint"],"tags":["kling","lip-sync","face-detection","content-validation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}