Skip to main content
Glama

generate_image

Generate an image from a text prompt by automatically building a txt2img workflow with your configured defaults and auto-selected checkpoint.

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?

With no annotations, the description carries full burden. It discloses key behaviors: builds a txt2img workflow, fills unspecified params from defaults, auto-selects a local checkpoint, returns prompt_id immediately, and asset_id arrives via completion notification. This is transparent, though it omits details on error handling or state modifications.

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 concise (4 sentences), front-loaded with the core purpose, followed by behavioral details, return flow, and alternative. Every sentence adds value with no redundant information.

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 and no output schema, the description covers purpose, default handling, async nature (prompt_id vs asset_id), and alternative. It lacks details on return format beyond prompt_id and potential errors, but it is adequate for a generation tool with good schema coverage. The description compensates for missing output schema by explaining the notification mechanism.

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 adds value by explaining that unspecified parameters are filled from defaults and checkpoint is auto-selected if omitted. This context aids understanding beyond the schema, even though individual parameters are not elaborated. For a high-level entry point, this is sufficient.

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's purpose: 'Generate an image from a text prompt — the high-level entry point.' It distinguishes itself from siblings like 'create_workflow + enqueue_workflow' by offering a simpler alternative. The verb 'Generate' and resource 'image' are explicit.

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

Usage Guidelines4/5

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

The description provides guidance on when to use this tool versus alternatives: 'For full control over the node graph, use create_workflow + enqueue_workflow instead.' It also mentions default handling and auto-selection of checkpoints. However, it does not explicitly state when not to use it (e.g., for audio generation), but sibling tools cover those.

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/artokun/comfyui-mcp'

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