calesthio/OpenMontage · error · ValueError

MiniMax image generation requires 'prompt'.

Error message

MiniMax image generation requires 'prompt'.

What it means

Raised by MiniMaxImage._build_payload when 'prompt' is absent, not a string (e.g. None, a list, a number), or an empty string. The MiniMax image endpoint requires a textual prompt, so the tool rejects the call client-side. Note it also rejects non-string truthy values, unlike some sibling tools.

Source

Thrown at tools/graphics/minimax_image.py:180

        path = Path(output_path or "minimax_image.png")
        if not path.suffix:
            path = path.with_suffix(".png")
        if count == 1:
            return [path]
        return [
            path.with_name(f"{path.stem}_{index}{path.suffix}")
            for index in range(1, count + 1)
        ]

    @staticmethod
    def _build_payload(inputs: dict[str, Any]) -> dict[str, Any]:
        model = inputs.get("model", DEFAULT_MODEL)
        if model not in MODELS:
            raise ValueError(f"Unsupported MiniMax image model '{model}'.")

        prompt = inputs.get("prompt")
        if not isinstance(prompt, str) or not prompt:
            raise ValueError("MiniMax image generation requires 'prompt'.")
        if len(prompt) > 1500:
            raise ValueError("MiniMax image prompt must not exceed 1500 characters.")

        width = inputs.get("width")
        height = inputs.get("height")
        if (width is None) != (height is None):
            raise ValueError("MiniMax image width and height must be set together.")

        payload: dict[str, Any] = {
            "model": model,
            "prompt": prompt,
            "response_format": inputs.get("response_format", "url"),
            "n": inputs.get("n", 1),
            "prompt_optimizer": inputs.get("prompt_optimizer", False),
        }
        for field in (
            "subject_reference",
            "aspect_ratio",

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Pass a non-empty prompt string
  2. Coerce upstream values to str and default to a fallback description when empty
  3. Add a pre-call isinstance(prompt, str) and prompt.strip() check in pipeline code

Example fix

# before
inputs = {"prompt": None, "aspect_ratio": "16:9"}
# after
inputs = {"prompt": "minimal product shot on marble", "aspect_ratio": "16:9"}
Defensive patterns

Strategy: validation

Validate before calling

prompt = inputs.get("prompt")
if not isinstance(prompt, str) or not prompt.strip():
    raise ValueError("'prompt' must be a non-empty string")

Type guard

def is_valid_prompt(value: Any) -> bool:
    return isinstance(value, str) and bool(value.strip())

Prevention

When it happens

Trigger: Omitting prompt; passing prompt=None when a template produced nothing; passing a list of prompt strings or a dict by mistake.

Common situations: Prompt built from optional upstream metadata (product name, scene description) that was empty; passing structured prompt objects accepted by other tools.

Related errors


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