Comfy-Org/ComfyUI · error · ValueError

HeyGen did not return a video_id: {created}

Error message

HeyGen did not return a video_id: {created}

What it means

Thrown after POSTing to HeyGen's /v3/videos endpoint when the response JSON has no data.video_id. This is a protocol/contract failure or an error payload rather than a normal creation: the node cannot poll a job without an id, so it surfaces the entire response body for diagnosis.

Source

Thrown at comfy_api_nodes/nodes_heygen.py:78

        if voice_id:
            payload["voice_id"] = voice_id
        elif require_voice:
            raise ValueError("A voice is required when driving the video with a text script.")
        speed = speech.get("voice_speed", 1.0)
        if speed != 1.0:
            payload["voice_settings"] = {"speed": round(speed, 2)}


async def _create_and_poll_video(cls: type[IO.ComfyNode], payload: dict) -> dict:
    """POST a /v3/videos payload, poll until terminal, and return the final video data."""
    created = await sync_op_raw(
        cls,
        ApiEndpoint(path=_VIDEOS_PATH, method="POST", headers={"Idempotency-Key": uuid.uuid4().hex}),
        data=payload,
    )
    video_id = (created.get("data") or {}).get("video_id")
    if not video_id:
        raise ValueError(f"HeyGen did not return a video_id: {created}")
    final = await poll_op_raw(
        cls,
        ApiEndpoint(path=f"{_VIDEOS_PATH}/{video_id}"),
        status_extractor=lambda r: (r.get("data") or {}).get("status"),
        queued_statuses=["pending", "waiting"],
        poll_interval=5.0,
    )
    data = final["data"]
    if not data.get("video_url"):
        raise ValueError(f"HeyGen returned no video_url for video {video_id}.")
    return data


async def _resolve_avatar(
    cls: type[IO.ComfyNode], avatar_label: str, custom_avatar_id: str, engine_choice: str
) -> tuple[str, str | None]:
    """Resolve (avatar_id, engine_type) from the combo/override + engine widgets."""
    custom_avatar_id = custom_avatar_id.strip()

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Read the embedded response in the message; it usually contains HeyGen's actual error (e.g. 401/402/invalid avatar)
  2. Verify HeyGen account status and credits in the ComfyAPI partner settings
  3. Confirm the avatar_id/voice_id used exist in your HeyGen workspace
  4. If the payload looks correct and credentials are valid, report as an upstream API contract change
Defensive patterns

Strategy: try-catch

Try / catch

try:
    data = await _create_and_poll_video(cls, payload)
except ValueError as e:
    if 'did not return a video_id' in str(e):
        # inspect embedded response: auth/quota/avatar errors land here
        raise

Prevention

When it happens

Trigger: HeyGen returns an error object (auth failure, quota exceeded, invalid avatar_id, malformed payload) instead of a creation response; or an API version change moved/renamed video_id in the response schema.

Common situations: Expired/invalid HeyGen API credentials, out-of-credit account, deleted or wrong avatar_id, or upstream API schema changes after a HeyGen release.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/44e2096f1ed43892. Report an issue: GitHub.