Skip to main content
Glama

generate_image

Generate an image from a text prompt. Builds a txt2img workflow, fills unspecified parameters from defaults, and returns the prompt_id immediately for later retrieval.

Instructions

Generate an image from a text prompt — the high-level entry point. Builds a txt2img workflow, filling any unspecified parameter from your configured defaults (set_defaults / COMFYUI_DEFAULT_* / config file), auto-selecting a local checkpoint when none is given. Returns the prompt_id immediately; the resulting asset_id arrives in the completion notification and can be passed to view_image or regenerate. For full control over the node graph, use create_workflow + enqueue_workflow instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cfgNoCFG scale
seedNoSeed (omit to randomize)
stepsNoSampling steps
widthNoImage width
heightNoImage height
promptYesPositive text prompt
samplerNoSampler name (e.g. euler, dpmpp_2m)
schedulerNoScheduler (e.g. normal, karras)
batch_sizeNoNumber of images to generate
checkpointNoCheckpoint filename; auto-selected from local models if omitted
negative_promptNoNegative prompt (default: empty / from defaults)
Behavior4/5

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

Describes building a txt2img workflow, filling unspecified parameters from defaults, auto-selecting checkpoint, and async return of prompt_id with later notification of asset_id. No annotations provided, so description carries full burden. Missing details on error handling or rate limits, but sufficient for typical usage.

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

Conciseness5/5

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

The description is a single paragraph of four sentences, each adding value: purpose, behavioral details, return value handling, and alternative for more control. No redundant or unnecessary words.

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?

Given 11 parameters, no output schema, and no annotations, the description explains the async flow and how to get results. It covers defaults, checkpoint auto-selection, and ties to other tools. Could be slightly more detailed on potential failures, but sufficient for a high-level entry point tool.

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

Parameters3/5

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

Schema coverage is 100% with all parameters documented. The description adds minimal new parameter info beyond noting auto-selection of checkpoint and use of defaults, which is already in schema descriptions. Baseline 3 is appropriate.

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?

The description clearly states the tool generates an image from a text prompt as the high-level entry point. It specifies the verb 'generate' and resource 'image from text prompt', and differentiates from siblings like create_workflow + enqueue_workflow for full control.

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?

Explicitly tells when to use this tool (high-level entry point) and when not (for full node graph control use create_workflow + enqueue_workflow). Also mentions return behavior and how to use completion notification with view_image or regenerate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sandyup/comfyui-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server