calesthio/OpenMontage · error · ValueError
{name}={value!r} is not supported; choose one of {list(allow
Error message
{name}={value!r} is not supported; choose one of {list(allowed)} What it means
Raised by the static validator _validate_choice when a parameter restricted to a fixed tuple of allowed values (e.g. duration, aspect_ratio) receives a value outside it. Each model spec in VIDEO_MODELS defines allowed tuples; this guard enforces them before any network call.
Source
Thrown at tools/video/atlas_video.py:205
def _resolve_model(self, model: str, operation: str, variant: str | None = None) -> str:
if model not in VIDEO_MODELS:
raise ValueError(
f"Unsupported Atlas video model id {model!r}. Use get_info()['model_catalog'] for live routes."
)
spec = VIDEO_MODELS[model]
variant = variant or str(spec.get("variant", "standard"))
route_key = operation if variant == "standard" else f"{operation}_{variant}"
resolved = VIDEO_ROUTES.get(spec["family"], {}).get(route_key)
if not resolved:
raise ValueError(
f"{spec['family']} does not expose operation={operation!r}, variant={variant!r} on Atlas Cloud"
)
return resolved
@staticmethod
def _validate_choice(name: str, value: Any, allowed: tuple[Any, ...] | None) -> Any:
if allowed and value not in allowed:
raise ValueError(f"{name}={value!r} is not supported; choose one of {list(allowed)}")
return value
def _build_payload(self, inputs: dict[str, Any], model: str) -> dict[str, Any]:
spec = VIDEO_MODELS[model]
payload: dict[str, Any] = {"model": model, "prompt": inputs.get("prompt", "")}
if spec["operation"] != "video_edit":
duration = int(inputs.get("duration", 10))
payload["duration"] = self._validate_choice("duration", duration, spec["durations"])
ratio = inputs.get("aspect_ratio", spec["default_ratio"])
if ratio == "16:9" and spec["default_ratio"] == "adaptive" and spec["ratios"] == ("adaptive",):
ratio = "adaptive"
payload[spec["ratio_key"]] = self._validate_choice("aspect_ratio", ratio, spec["ratios"])
resolution = inputs.get("resolution", spec["default_resolution"])
payload["resolution"] = self._validate_choice("resolution", resolution, spec["resolutions"])
for field in spec.get("optional_fields", ()):View on GitHub (pinned to 95e1c3d0ab)
Solutions
- Read the error text: it lists the exact allowed values, e.g. duration=15 is not supported; choose one of [5, 10] — pick one of those
- Call get_info() and inspect the model spec's durations/ratios tuples before building inputs
- Parameterize your pipeline to read allowed values from the spec instead of hardcoding
Example fix
# before
inputs = {'model':'bytedance/seedance-2.0','prompt':'...','duration':15}
# after
inputs = {'model':'bytedance/seedance-2.0','prompt':'...','duration':10} # spec durations are (5, 10) Defensive patterns
Strategy: validation
Validate before calling
spec = atlas_video.get_info()['model_catalog'][model]
duration = int(inputs.get('duration', 10))
if spec['durations'] and duration not in spec['durations']:
inputs['duration'] = min(spec['durations'], key=lambda d: abs(d - duration))
ratio = inputs.get('aspect_ratio', spec['default_ratio'])
if spec['ratios'] and ratio not in spec['ratios']:
inputs['aspect_ratio'] = spec['default_ratio'] Type guard
def valid_choices(spec: dict, duration: int, ratio: str) -> bool:
return ((not spec['durations'] or int(duration) in spec['durations']) and
(not spec['ratios'] or ratio in spec['ratios'])) Try / catch
try:
result = atlas_video.run(inputs=inputs)
except ValueError as e:
if 'is not supported; choose one of' in str(e):
# message lists the allowed values; snap to one and retry once
allowed = ast.literal_eval(str(e).split('choose one of ')[1])
inputs['duration'] = allowed[0] # or map the offending param by name
result = atlas_video.run(inputs=inputs)
else:
raise Prevention
- Read allowed tuples from the spec at pipeline build time, not from memory
- Centralize parameter snapping (nearest duration, default ratio) in one helper
- Log the model spec once per run so parameter mismatches are visible early
When it happens
Trigger: Passing duration=15 to a model whose spec['durations'] is (5,10); passing aspect_ratio='4:3' when spec['ratios'] only allows ('16:9','9:16') or ('adaptive',). Note the special case: ratio '16:9' is auto-remapped to 'adaptive' only when the spec's default_ratio is 'adaptive' and ratios == ('adaptive',).
Common situations: Copy-pasting parameters between models with different capability tuples; assuming a duration every model supports; string vs int mismatch for duration (it is int()-coerced first, so '10' is fine but 'ten' raises earlier); new model specs tightening allowed values.
Related errors
- {spec['family']} does not expose operation={operation!r}, va
- image_to_video requires image_url, image_path, or reference_
- This Gemini route requires at least one reference image
- reference_to_video requires supported reference media for th
- {model} accepts at most {limits['images']} images, {limits['
AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15).
Data as JSON: /api/errors/cabc2f1364d3341c.
Report an issue: GitHub.