calesthio/OpenMontage · error · ValueError
Kling identify-face response contained no faces
Error message
Kling identify-face response contained no faces
What it means
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.
Source
Thrown at tools/avatar/kling_lip_sync.py:275
def _identify_faces(self, client: KlingClient, inputs: dict[str, Any]) -> dict[str, Any]:
request = self._build_identify_request(inputs)
data = client.post(request["path"], request["payload"])
payload = data.get("data") or {}
session_id = payload.get("session_id")
if not session_id:
raise ValueError(f"Kling identify-face response missing data.session_id: {data}")
faces = (
payload.get("face_data")
or payload.get("faces")
or payload.get("face_list")
or payload.get("face_infos")
or payload.get("faces_info")
or []
)
if not isinstance(faces, list):
raise ValueError("Kling identify-face response face list is not a list")
if not faces:
raise ValueError("Kling identify-face response contained no faces")
return {
"session_id": str(session_id),
"faces": faces,
"raw_response": data,
"request": request,
}
def _identify_result(self, inputs: dict[str, Any], identify: dict[str, Any], start: float) -> ToolResult:
artifact_path = self._write_faces_artifact(inputs, identify)
return ToolResult(
success=True,
data={
"provider": self.provider,
"model": "kling-official-lip-sync",
"operation": "identify_face",
"session_id": identify["session_id"],
"faces": identify["faces"],
"face_count": len(identify["faces"]),View on GitHub (pinned to 95e1c3d0ab)
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.
Defensive patterns
Strategy: validation
Try / catch
try:
identify = tool._identify_faces(client, inputs)
except ValueError as e:
if "contained no faces" in str(e):
# content issue: swap in a clip with a clearly visible human face
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: Wrong video passed (b-roll instead of the talking-head clip); low-resolution uploads; side profiles or heavy occlusion; cartoon avatars.
Related errors
- Cannot select face without face_id/id: {face}
- Unsupported Kling lip-sync operation: {operation}
- Kling identify-face response missing data.session_id: {data}
- Kling identify-face response face list is not a list
- Kling identify_face requires video_url or video_id; local vi
AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15).
Data as JSON: /api/errors/96e5fe0d0bfaa357.
Report an issue: GitHub.