mudler/LocalAI · error · ValueError

audio is required for LongCat-Video-Avatar-1.5

Error message

audio is required for LongCat-Video-Avatar-1.5

What it means

ValueError from _generate_avatar(): LongCat-Video-Avatar-1.5 is an audio-driven avatar model — every generation request must carry an audio file. An empty/absent request.audio is rejected immediately (a follow-up check also requires the file to exist on disk). Maps to gRPC INVALID_ARGUMENT.

Source

Thrown at backend/python/longcat-video/backend.py:611

        else:
            width, height = validate_dimensions(request.width, request.height)
            output = self.pipeline.generate_t2v(
                prompt=request.prompt,
                negative_prompt=negative_prompt,
                height=height,
                width=width,
                num_frames=frames,
                num_inference_steps=steps,
                use_distill=use_distill,
                guidance_scale=guidance_scale,
                generator=generator,
            )[0]

        self._save_video(output, request.dst, fps)

    def _generate_avatar(self, request, params, context):
        if not request.audio:
            raise ValueError("audio is required for LongCat-Video-Avatar-1.5")
        if not os.path.isfile(request.audio):
            raise ValueError("audio input is not a readable staged file")

        use_distill = self.options["use_distill"]
        steps = (
            8
            if use_distill
            else require_int(
                request.step or 50,
                "step",
                minimum=1,
                maximum=200,
            )
        )
        text_guidance = (
            1.0
            if use_distill
            else require_float(

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Attach a staged audio file path via request.audio for every avatar generation
  2. If you want text/image-to-video without audio, load the LongCat-Video base model instead

Example fix

# before (avatar model loaded)
req = backend_pb2.VideoRequest(prompt="a sunset", dst=out_path)

# after
req = backend_pb2.VideoRequest(prompt="a sunset", dst=out_path, audio="/data/staged/voice.wav")
Defensive patterns

Strategy: validation

Validate before calling

def build_avatar_request(prompt: str, audio_path: str, dst: str):
    if not audio_path:
        raise ValueError("avatar generation requires an audio file")
    return backend_pb2.VideoRequest(prompt=prompt, audio=audio_path, dst=dst)

Try / catch

try:
    stub.GenerateVideo(req)
except grpc.RpcError as e:
    if "audio is required" in (e.details() or ""):
        raise UserError("Provide a voice track for avatar generation") from e
    raise

Prevention

When it happens

Trigger: Sending a VideoRequest with no audio field to a backend whose loaded model is Avatar-1.5; clearing audio but keeping prompt-only usage like the base model.

Common situations: Using one client code path for both base and avatar models; assuming prompt-only generation works on the avatar variant.

Related errors


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/2d9a0c38b2bbcb6c. Report an issue: GitHub.