sgl-project/sglang · error · ValueError
task {plan.task!r} cannot carry image.target_canvas material
Error message
task {plan.task!r} cannot carry image.target_canvas materials What it means
image.target_canvas materials (keyframes) are only legal for fl2va/ref2va tasks. For any other plan.task carrying them, _encode_from_plan raises this ValueError, catching task/material mismatches before they reach the encoder.
Source
Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/text_encoding.py:269
"""
from sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.minimax_h3.presentation import (
minimax_h3_text_only_ids,
)
prompt = plan.prompt
keyframes = [
m for m in plan.materials if m.material_chain == "image.target_canvas"
]
if plan.task in {"fl2va", "ref2va"} and keyframes:
frame_indices = tuple(material.frame_index for material in keyframes)
if frame_indices not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES:
raise ValueError(
"MiniMax H3 text encoding requires an ordered keyframe signature "
f"in {MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got "
f"{frame_indices!r}"
)
elif keyframes:
raise ValueError(
f"task {plan.task!r} cannot carry image.target_canvas materials"
)
if MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY in batch.extra:
return
if self.text_encoder is None:
raise ValueError(
"MiniMaxH3TextEncodingStage direct encode requires a text_encoder "
"component"
)
encode_ids = getattr(self.text_encoder, "encode_ids", None)
if not callable(encode_ids):
raise TypeError(
"MiniMax H3 text_encoder component must expose callable "
"encode_ids(...) for direct encode (MiniMaxH3Qwen3VLEncoder)"
)
if self.tokenizer is None:
raise ValueError(
"MiniMaxH3TextEncodingStage direct encode requires a tokenizer component"View on GitHub (pinned to 0132848349)
Solutions
- Remove image.target_canvas materials from the plan or change plan.task to fl2va/ref2va so they are consistent
- Validate the task/material combination in the request builder before submitting
- Check for task string typos (exact match required)
Defensive patterns
Strategy: validation
Validate before calling
has_kf = any(m.material_chain == "image.target_canvas" for m in plan.materials)
assert not has_kf or plan.task in {"fl2va", "ref2va"}, f"task {plan.task} cannot carry keyframes" Type guard
def task_materials_consistent(plan) -> bool:
has_kf = any(m.material_chain == "image.target_canvas" for m in plan.materials)
return not has_kf or plan.task in {"fl2va", "ref2va"} Prevention
- Don't attach keyframe images to t2va requests
- Double-check task strings for typos before submitting
When it happens
Trigger: A plan whose task is e.g. 't2va' or any non-fl2va/ref2va value while plan.materials contains entries with material_chain == 'image.target_canvas'.
Common situations: Request builders attaching keyframe images to text-to-video requests, plan templates copied between tasks, or task field typos ('fl2va ' vs 'fl2va').
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- ref2va keyframes require at least one reference condition; u
- {profile.task} ResolvedPlan requires one or two ordered imag
- MiniMax H3 latent preparation requires pre-queue resolved_v2
- MiniMax H3 latent preparation requires pre-queue resolved te
- MiniMax H3 text encoding requires an ordered keyframe signat
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/4d76d851b2dd996e.
Report an issue: GitHub.