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
| Name | Required | Description | Default |
|---|---|---|---|
| cfg | No | Guidance / CFG scale for this call. Same as params.cfg. | |
| seed | No | -1 for random; a fixed seed reproduces an image. | |
| count | No | Number of images (1-4 recommended). | |
| guard | No | 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. | |
| model | No | Model override for multi-model engines. | |
| steps | No | Sampling steps. Defaults to the engine's own default. | |
| width | No | 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. | |
| aspect | No | Aspect preset used when width/height are omitted; the tool then sizes the image itself and applies its VRAM-aware long edge. | |
| height | No | Pixel height. Same contract as width. Omitted = the engine default. | |
| params | No | 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. | |
| prompt | Yes | Positive prompt. English is strongly recommended; include subject, environment, lighting, camera/lens and style. | |
| dry_run | No | 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. | |
| sampler | No | Sampler name, e.g. euler / dpm++2m. | |
| timeout_s | No | Job timeout in seconds. | |
| output_dir | No | Absolute directory for the image files. Omit to use the working directory's ./output folder. | |
| filename_prefix | No | Semantic filename prefix, e.g. architecture_court. | |
| negative_prompt | No | What to avoid. A quality-oriented default is applied when omitted. |