Skip to main content
Glama

generate_image

Generate images offline on a local GPU from an optimized English prompt, returning absolute file paths and the seed for reproduction.

Instructions

Generate images with the LOCAL LocModel / stable-diffusion.cpp engine (offline, no cloud cost). Pass an already-optimised English prompt; the tool returns absolute image paths plus the seed used for reproduction. Sizing: when the tool picks the size: 576k-pixel minimum area, long edge <= 1536px, multiple of 8. An explicit width/height is honoured as requested -- only the engine's hard limits (64-4096px per edge) can shrink it, and big canvases come back with a VRAM warning instead of being resized. One 1024x1024 image takes roughly 20-60 s on a mid-range GPU.

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
cfgNoGuidance / CFG scale for this call. Same as params.cfg.
seedNo-1 for random; a fixed seed reproduces an image.
countNoNumber of images (1-4 recommended).
guardNoKeep the automatic size guard (area floor, VRAM-aware long edge) for a size the tool picks itself. Set false to submit exactly the size given. Explicit width/height is honoured either way; only the engine's hard limits still apply.
modelNoModel override for multi-model engines.
stepsNoSampling steps. Defaults to the engine's own default.
widthNoPixel width. Used exactly as given (multiples of 8 are cleanest); only the engine's own limit (64-4096 per edge) can change it. Omitted = the engine default.
aspectNoAspect preset used when width/height are omitted; the tool then sizes the image itself and applies its VRAM-aware long edge.
heightNoPixel height. Same contract as width. Omitted = the engine default.
paramsNoAny workflow parameter, applied to THIS call only. Names: cfg, img_cfg, steps, sampler, scheduler, flow_shift, shifted_timestep, eta, distilled_guidance, slg_scale, clip_skip, strength, seed, count. Folded groups: slg_layers/slg_layer_start/slg_layer_end, hires_enabled/hires_upscaler/hires_target_width/hires_target_height/hires_steps/hires_denoising_strength/hires_upscale_tile_size/hires_scale/hires_custom_sigmas (upscaler names are engine spellings, e.g. 'Latent (nearest)'), vae_tiling/vae_tile_size_w/vae_tile_size_h/vae_rel_size_w/vae_rel_size_h/vae_target_overlap/vae_temporal_tiling/vae_extra_tiling_args, output_format (png/jpeg/webp)/output_compression, high_noise_steps/high_noise_cfg/high_noise_sampler, custom_sigmas/extra_sample_args/lora. Values travel in the HTTP payload only -- nothing is written to LocModel's config.
promptYesPositive prompt. English is strongly recommended; include subject, environment, lighting, camera/lens and style.
dry_runNoValidate and build the payload, return it with the size notes and the live engine limits, submit nothing. Use it to confirm how a parameter or size will land.
samplerNoSampler name, e.g. euler / dpm++2m.
timeout_sNoJob timeout in seconds.
output_dirNoAbsolute directory for the image files. Omit to use the working directory's ./output folder.
filename_prefixNoSemantic filename prefix, e.g. architecture_court.
negative_promptNoWhat to avoid. A quality-oriented default is applied when omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv3.2.0
    • changedInput schema / properties / aspect / description
      Previous value: -"Aspect preset used when width/height are omitted."New value: +"Aspect preset used when width/height are omitted; the tool then sizes the image itself and applies its VRAM-aware long edge."
    • addedInput schema / properties / cfg
      Added value: +{
      +  "description": "Guidance / CFG scale for this call. Same as params.cfg.",
      +  "type": "number"
      +}
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "Validate and build the payload, return it with the size notes and the live engine limits, submit nothing. Use it to confirm how a parameter or size will land.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / guard
      Added value: +{
      +  "description": "Keep the automatic size guard (area floor, VRAM-aware long edge) for a size the tool picks itself. Set false to submit exactly the size given. Explicit width/height is honoured either way; only the engine's hard limits still apply.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / height / description
      Previous value: -"Pixel height. Defaults to the engine's own default."New value: +"Pixel height. Same contract as width. Omitted = the engine default."
    • changedInput schema / properties / output_dir / description
      Previous value: -"Absolute directory for the PNG files. Omit to use the working directory's ./output folder."New value: +"Absolute directory for the image files. Omit to use the working directory's ./output folder."
    • addedInput schema / properties / params
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Any workflow parameter, applied to THIS call only. Names: cfg, img_cfg, steps, sampler, scheduler, flow_shift, shifted_timestep, eta, distilled_guidance, slg_scale, clip_skip, strength, seed, count. Folded groups: slg_layers/slg_layer_start/slg_layer_end, hires_enabled/hires_upscaler/hires_target_width/hires_target_height/hires_steps/hires_denoising_strength/hires_upscale_tile_size/hires_scale/hires_custom_sigmas (upscaler names are engine spellings, e.g. 'Latent (nearest)'), vae_tiling/vae_tile_size_w/vae_tile_size_h/vae_rel_size_w/vae_rel_size_h/vae_target_overlap/vae_temporal_tiling/vae_extra_tiling_args, output_format (png/jpeg/webp)/output_compression, high_noise_steps/high_noise_cfg/high_noise_sampler, custom_sigmas/extra_sample_args/lora. Values travel in the HTTP payload only -- nothing is written to LocModel's config.",
      +  "type": "object"
      +}
    • changedInput schema / properties / width / description
      Previous value: -"Pixel width. Defaults to the engine's own default."New value: +"Pixel width. Used exactly as given (multiples of 8 are cleanest); only the engine's own limit (64-4096 per edge) can change it. Omitted = the engine default."
  2. First observedv3.0.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the return shape ('absolute image paths plus the seed used for reproduction'), runtime ('roughly 20-60 s on a mid-range GPU'), and that oversized canvases yield 'a VRAM warning instead of being resized'. Gaps remain around failure modes, queuing/concurrency behavior, and what happens when no model is loaded.

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?

Purpose and cost model are front-loaded, and every paragraph addresses a real decision (prompt quality, sizing, timing). The 'Sizing: when the tool picks the size: ...' construction is awkwardly punctuated and repeats what the width/height/guard schema entries already say.

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 17-parameter tool with a free-form nested params object and no output schema, the description compensates well by describing the return payload, timing, and sizing semantics. It stops short of explaining model selection or how the nested params groups interact with the same top-level parameters (e.g. cfg vs params.cfg).

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%, so the baseline is 3; the description mostly restates the width/height contract already documented in the schema (hard limits 64-4096px, multiple of 8). It does add value on prompt content ('subject, environment, lighting, camera/lens and style') and seed reproducibility, but the sizing rules are duplicated rather than extended.

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

Purpose4/5

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

Opens with a specific verb+resource+engine: 'Generate images with the LOCAL LocModel / stable-diffusion.cpp engine', plus the key differentiator '(offline, no cloud cost)'. It never names edit_image/redraw_image, so an agent must infer from the verb alone that this is text-to-image rather than image-to-image editing.

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

Usage Guidelines3/5

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

It gives real operational guidance: 'Pass an already-optimised English prompt', and describes dry_run's purpose ('Use it to confirm how a parameter or size will land'). It does not say when to prefer this over edit_image/redraw_image, nor any prerequisite about a loaded model, so the when-vs-alternative decision is left implicit.

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