Skip to main content
Glama

Generate Image

generate_image

Create one or more images from text prompts locally using ComfyUI and Qwen Image 2.1; queue jobs and retrieve results via prompt IDs. Supports seeds, exact sizes, aspect ratios, and batches.

Instructions

Generate one or more images locally using ComfyUI and Qwen Image 2.1. Queues the job(s) and returns immediately with prompt_ids and seeds; then call get_result with the prompt_ids to wait for and receive the image paths. The seed is a decimal string; pass that exact string back to reproduce the same generation. A seed does not edit an existing picture; use edit_image for that. Prefer width+height for exact sizes (icons ~256-512, UI ~1024, cinematic up to 2048). Values are rounded to multiples of 8. If width/height are omitted, aspect_ratio + megapixels are used instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoSeed as a decimal string. Reuse the exact seed from a previous result to reproduce that generation. When count is greater than 1, later images use seed+1, seed+2, and so on.
countNoNumber of images to generate, from 1 to 4
widthNoExact width in pixels (64-2048). Requires height. When set with height, bypasses aspect_ratio/megapixels.
heightNoExact height in pixels (64-2048). Requires width. When set with width, bypasses aspect_ratio/megapixels.
promptYesDetailed image description
megapixelsNoApproximate image resolution in megapixels (used when width/height are omitted; min 0.05, max 4)
aspect_ratioNoImage aspect ratio (used when width/height are omitted)1:1

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the whole burden and does well: it discloses asynchronous queue-and-return behavior, what comes back immediately (prompt_ids and seeds), and that dimensions are rounded to multiples of 8. It does not mention failure modes, timeouts, or local file locations beyond the eventual image paths, which keeps it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the verb and backend, then the async workflow, then sizing rules — each sentence adds distinct information. Minor redundancy: the 'seed is a decimal string, pass the exact string back' rule largely restates the seed parameter's own description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter tool with no annotations and no output schema, the description covers invocation flow, return pathway, seed reproduction, and resolution selection thoroughly. It leaves out error/timeout behavior and how long queued jobs persist, which an agent might want.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description still adds precedence logic not obvious from the schema ('prefer width+height for exact sizes', width/height bypass aspect_ratio + megapixels) and concrete magnitude anchors (icons ~256-512, UI ~1024, cinematic up to 2048). The rounding rule is meaningful behavior the schema's min/max alone does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Generate one or more images') plus the concrete backend ('locally using ComfyUI and Qwen Image 2.1'), and explicitly separates itself from edit_image (no editing) and get_result (retrieval). An agent can route correctly without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives the full call sequence: this tool queues and returns prompt_ids, then get_result must be called to wait for image paths. It also names the exclusion ('a seed does not edit an existing picture; use edit_image for that') and offers sizing guidance per use case (icons, UI, cinematic).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools