sgl-project/sglang · error · RuntimeError

Warmup image path is required for image-input model

Error message

Warmup image path is required for image-input model

What it means

Raised by build_warmup_reqs when the model is an image-input model (include_warmup_image is true) but no warmup_input_path was supplied. The warmup request for such models must include an image, so the builder refuses to proceed without a path.

Source

Thrown at python/sglang/multimodal_gen/runtime/warmup_request_builder.py:406

    for width, height in resolutions:
        req_kwargs = dict(
            data_type=task_type.data_type(),
            width=width,
            height=height,
            prompt=DEFAULT_PLACEHOLDER_PROMPT,
        )
        req_kwargs["sampling_params"] = copy(sampling_defaults)
        req_kwargs.update(
            negative_prompt=negative_prompt,
            guidance_scale=sampling_defaults.guidance_scale,
            guidance_scale_2=sampling_defaults.guidance_scale_2,
            true_cfg_scale=sampling_defaults.true_cfg_scale,
            num_inference_steps=sampling_defaults.num_inference_steps,
            num_frames=warmup_num_frames,
        )
        if include_warmup_image:
            if warmup_input_path is None:
                raise RuntimeError(
                    "Warmup image path is required for image-input model"
                )
            req_kwargs["prompt"] = DEFAULT_PLACEHOLDER_PROMPT
            req_kwargs["image_path"] = [warmup_input_path]
        if server_args.enable_cfg_parallel:
            if not req_kwargs.get("negative_prompt"):
                req_kwargs["negative_prompt"] = DEFAULT_PLACEHOLDER_PROMPT
            req_kwargs["do_classifier_free_guidance"] = True
        elif negative_prompt is not None and cfg_scale is not None and cfg_scale > 1.0:
            req_kwargs["do_classifier_free_guidance"] = True

        run_real_path_prewarm = server_based_warmup and server_args.enable_torch_compile
        prompts = (
            (DEFAULT_PLACEHOLDER_PROMPT,) + TORCH_COMPILE_REAL_PATH_PREWARM_PROMPTS
            if run_real_path_prewarm
            else (DEFAULT_PLACEHOLDER_PROMPT,)
        )
        for prompt_idx, prompt in enumerate(prompts):

View on GitHub (pinned to 0132848349)

Solutions

  1. Pass a valid warmup_input_path pointing to a small image to build_warmup_reqs
  2. Ship/point to a default warmup image asset for image-input models in server config
  3. If the model truly takes no image input, fix the include_warmup_image flag / model classification

Example fix

# before
reqs = build_warmup_reqs(server_args, model_config, warmup_input_path=None)
# after
reqs = build_warmup_reqs(server_args, model_config, warmup_input_path="assets/warmup.jpg")
Defensive patterns

Strategy: validation

Validate before calling

if include_warmup_image and not warmup_input_path:
    raise ValueError("image-input model requires warmup_input_path")
reqs = build_warmup_reqs(server_args, model_config, warmup_input_path=warmup_input_path)

Try / catch

try:
    reqs = build_warmup_reqs(...)
except RuntimeError as e:
    if "Warmup image path" in str(e):
        reqs = build_warmup_reqs(..., warmup_input_path=DEFAULT_WARMUP_IMAGE)
    else:
        raise

Prevention

When it happens

Trigger: Calling build_warmup_reqs / build_client_warmup_reqs with an image-input model config and warmup_input_path=None (or omitting it).

Common situations: Server startup warmup for image-input diffusion models without a bundled warmup image; adding a new image-input model without wiring a default warmup asset; test config omitting the path.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/45635e24fcde6a86. Report an issue: GitHub.