calesthio/OpenMontage · error · ValueError

{family} does not expose generation_mode={operation!r} on At

Error message

{family} does not expose generation_mode={operation!r} on Atlas Cloud

What it means

ValueError raised by _resolve_model when the model's family exists in IMAGE_ROUTES but has no route for the requested generation_mode (operation). Each family supports only specific operations (generate, edit, etc.); asking an edit-only model to generate (or vice versa) fails here even though the model id itself is valid.

Source

Thrown at tools/graphics/atlas_image.py:139

                str(inputs.get("model", _DEFAULT_MODEL)),
                str(inputs.get("generation_mode", "generate")),
            )
        except ValueError:
            return _DEFAULT_COST
        return float(IMAGE_MODELS[model]["cost_per_image"])

    def estimate_runtime(self, inputs: dict[str, Any]) -> float:
        return 30.0

    def _resolve_model(self, model: str, operation: str) -> str:
        if model not in IMAGE_MODELS:
            raise ValueError(
                f"Unsupported Atlas image model id {model!r}. Use get_info()['model_catalog'] for live routes."
            )
        family = IMAGE_MODELS[model]["family"]
        route = IMAGE_ROUTES.get(family, {}).get(operation)
        if not route:
            raise ValueError(f"{family} does not expose generation_mode={operation!r} on Atlas Cloud")
        return route

    def _build_payload(self, inputs: dict[str, Any], model: str) -> dict[str, Any]:
        spec = IMAGE_MODELS[model]
        payload: dict[str, Any] = {"model": model, "prompt": inputs.get("prompt", "")}
        width = int(inputs.get("width", 2048))
        height = int(inputs.get("height", 2048))
        style = spec["size_style"]

        if style == "star":
            payload["size"] = f"{width}*{height}"
        elif style == "x":
            payload["size"] = f"{width}x{height}"
        elif style == "ratio":
            payload["aspect_ratio"] = inputs.get("aspect_ratio") or atlas_client.aspect_ratio_from_size(
                width, height, _COMMON_RATIOS
            )
        elif style == "tier":

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Check the family's supported modes in the tool's get_info() output / IMAGE_ROUTES table and set generation_mode accordingly.
  2. Switch to a model in a family that supports the operation you need (e.g. an edit-capable model for image editing).
  3. For edit operations remember most require source images as well (see the image-count validations).
  4. Build a small wrapper that maps desired operation -> allowed models so callers cannot mismatch.

Example fix

# before
inputs = {"model": "<t2i-only-id>", "generation_mode": "edit", "image_urls": [u]}  # -> ValueError

# after
inputs = {"model": "<edit-capable-id>", "generation_mode": "edit", "image_urls": [u]}
Defensive patterns

Strategy: validation

Validate before calling

family = IMAGE_MODELS[inputs["model"]]["family"]
supported_ops = set(IMAGE_ROUTES.get(family, {}))
assert inputs.get("generation_mode", "generate") in supported_ops

Type guard

def supports_mode(family_routes: dict, family: str, mode: str) -> bool:
    return family in family_routes and mode in family_routes[family]

Try / catch

try:
    result = tool.run(inputs)
except ValueError as e:
    if "does not expose generation_mode" in str(e):
        inputs["model"] = pick_model_for_mode(IMAGE_ROUTES, inputs["generation_mode"])
        result = tool.run(inputs)
    else:
        raise

Prevention

When it happens

Trigger: Passing generation_mode='edit' with a text-to-image-only model, or generation_mode='generate' with an image-to-image/edit model — i.e. any (family, operation) pair absent from IMAGE_ROUTES.

Common situations: Copy-pasting parameter sets between models ('this worked for seedream, use the same for nano-banana'), assuming all models support edit/variation/inpaint, or defaulting generation_mode incorrectly per model.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/9eebb613f5b35163. Report an issue: GitHub.