{
  "name": "gen-image",
  "toolName": "gen_image",
  "tier": "atomic",
  "category": "asset",
  "title": "AI Image Generation",
  "description": "AI image generation: produce an image from a text prompt. Supports the Seedream 5.0 family (Lite and a high-fidelity 'pro' variant), plus image-to-image with reference images.",
  "auth": "required",
  "joinsTake": true,
  "envVars": [
    "PRIV_TOKEN",
    "MM_API_BASE_URL",
    "AGENT_NAME",
    "MM_IMAGE_MODEL"
  ],
  "entry": {
    "type": "http",
    "handler": "gen-image"
  },
  "parameters": {
    "type": "object",
    "properties": {
      "prompt": {
        "type": "string",
        "description": "Image description (required)"
      },
      "model": {
        "type": "string",
        "description": "Model: 'seedream' (default, Seedream 5.0 Lite) or 'seedream-pro' (high fidelity, precise placement and on-image text; costs more per image)"
      },
      "size": {
        "type": "string",
        "description": "Aspect ratio or WxH, e.g. 1:1, 9:16"
      },
      "resolution": {
        "type": "string",
        "enum": [
          "1K",
          "2K",
          "4K"
        ],
        "description": "Output resolution tier. Currently inert: the only backend model that read it (Gemini) is not wired up, so this is ignored — use `size` for image dimensions."
      },
      "n": {
        "type": "number",
        "description": "Number of images, 1-4"
      },
      "reference": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Reference images for image-to-image: local file path, https URL, or data URI. Pass multiple to blend several references (seedream: max 14, seedream-pro: max 10 — over the limit fails before spending credits)."
      },
      "image_strength": {
        "type": "number",
        "description": "How strongly the reference images influence the result, 0-1 (Seedream family only). Omit to use the backend default."
      },
      "guidance_scale": {
        "type": "number",
        "description": "Prompt-adherence strength, where supported. Omit to use the backend default."
      },
      "negative_prompt": {
        "type": "string",
        "description": "Negative prompt — content to avoid"
      },
      "seed": {
        "type": "number",
        "description": "Random seed. Pass the same seed with the same prompt and model to make a run reproducible."
      },
      "watermark": {
        "type": "boolean",
        "description": "Add a watermark to the output. Only true has an effect; there is no opt-out override of the backend default."
      },
      "json_output": {
        "type": "boolean",
        "description": "Emit a JSON result ({ urls: [...] }) instead of human-readable output"
      }
    },
    "required": [
      "prompt"
    ]
  },
  "ui": {
    "primary": [
      "prompt",
      "reference",
      "model",
      "size",
      "n"
    ],
    "advanced": [
      "negative_prompt"
    ],
    "hidden": [
      "json_output",
      "watermark",
      "resolution",
      "seed",
      "guidance_scale",
      "image_strength"
    ]
  }
}
