Skip to main content
Glama

generate_image

Generate AI images or inpaint selected regions as new Krita layers in one undo step from text prompts, references, or control guides.

Instructions

Generate pixels with an image model and place them as NEW layers (one undo step). mode: auto (inpaint if there is a selection, else txt2img), txt2img, img2img (rework the region; strength 0..1 = how much changes), inpaint (regenerate only the selected pixels; soft edges blend). The region is the selection's bounds + padding (or x/y/width/height, or region='canvas'); results are cut to the selection, so nothing outside it changes. count 1-8 = variations in a group plus a numbered comparison sheet (choose with pick_variation). backend: comfyui, a1111, openai, gemini, stability, replicate, fal (default: KRITA_MCP_IMAGE_BACKEND or the first available - see ai_backends). model = checkpoint / model id (Replicate 'owner/name', fal 'fal-ai/...'). size = longest side to generate at (default 1024). workflow = a ComfyUI API-format graph saved as /workflows/NAME.json using {{prompt}} {{negative}} {{seed}} {{image}} {{mask}} {{width}} {{height}} {{strength}} placeholders (ControlNet, IP-Adapter, Flux, ... anything ComfyUI can do). extra = provider-specific inputs. control = guide the composition with a layer, e.g. [{"layer": "Sketch", "type": "lineart", "strength": 0.8}] - paint a sketch / pose / depth layer and the model follows it. type: lineart, scribble, canny, softedge, depth, openpose, normal, seg, tile, ...; model = ControlNet model (default: the first installed whose name contains the type); preprocess = A1111 preprocessor (e.g. depth_midas when the layer is a photo); start/end 0..1; layer omitted = the whole picture. Real ControlNet on comfyui / a1111 (several guides at once; in workflows use {{control}} / {{control_1}}...); stability uses its sketch / structure control; openai and gemini receive the guide as the image to follow. style = a look recipe added to the prompt (with a matching negative prompt): photo, cinematic, portrait, product, fashion, street, landscape, macro, food, architecture, drone (realistic) or concept_art, illustration, anime, watercolor, oil_painting, 3d_render, pixel_art, comic, sketch.

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
cfgNo
modeNoauto
nameNo
seedNo
sizeNo
countNo
extraNo
modelNo
stepsNo
styleNo
widthNo
heightNo
promptYes
regionNoauto
backendNo
controlNo
paddingNo
samplerNo
strengthNo
workflowNo
schedulerNo
negative_promptNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

There are no annotations, so the description carries the full burden, and it discloses substantial behavior: results are new layers in one undo step, generation is clipped to the selection so nothing outside it changes, count>1 produces a group plus a numbered comparison sheet, and backend resolution falls back to KRITA_MCP_IMAGE_BACKEND or the first available backend. Control-guide handling is explicitly differentiated per provider (real ControlNet on comfyui/a1111, sketch/structure on stability, image-to-follow on openai/gemini). It still omits failure modes, credential/API-key requirements, and speed or cost characteristics of the remote backends.

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?

The text is a single dense block, but it is telegraphic rather than padded — nearly every clause conveys a distinct fact (a default, a range, a fallback rule, a provider caveat). The purpose leads the paragraph and the mode rules come next, so the most decision-relevant content is front-loaded, though the wall-of-text layout makes scanning harder than it needs to be for a tool this complex.

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 24-parameter tool with no annotations, no output schema, and zero schema descriptions, the definition is unusually complete: it explains mode routing, region geometry, variation grouping, backend fallbacks, workflow templating, and control-guide semantics. The remaining shortfall is the undocumented sampling knobs (cfg, steps, sampler, scheduler, seed) and the name parameter, which an agent must guess at.

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 description coverage is 0% across 24 parameters, so the description must compensate and largely does: mode, region/x/y/width/height, padding, count, backend, model (with per-provider id formats), size, strength, workflow (file path plus the placeholder list), extra, control (object keys, types, defaults, start/end), and style presets are all explained. Gaps remain for cfg, steps, sampler, scheduler, seed, and name, which are never mentioned, though several are conventional diffusion settings an agent can infer.

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 first sentence states a concrete verb and object — generate pixels with an image model and place them as NEW layers — and adds the side-effect detail (one undo step). It is clearly distinguishable from sibling tools such as upscale_image, outpaint, create_artwork, and generate_video.

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 mode enumeration gives real decision guidance: auto picks inpaint when a selection exists and otherwise txt2img; img2img 'rework the region' with strength controlling how much changes; inpaint regenerates only selected pixels with soft-edge blending. The count section even routes the agent to pick_variation for choosing a result. However, it never says when to prefer this tool over its close siblings (outpaint for extending the canvas, upscale_image, create_artwork), so the alternative-selection rule is incomplete.

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