Skip to main content
Glama

Text to Image

sdnext_txt2img

Generate images from text prompts using SD.Next, with samplers, LoRA, ControlNet, high-res fix, and style options. Returns base64 images and parameters.

Instructions

Generate images from text prompts (SD.Next /sdapi/v1/txt2img). Supports samplers, modular guidance, hires fix, refiner, detailer, LoRA (prompt lora:name:weight), styles, scripts, control units, face modules, XYZ grid. Returns base64 images, info string, and echoed parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xyzNoXYZ grid parameter sweep configuration.
faceNoFace-driven generation module (FaceID/FaceSwap/PhotoMaker/InstantID).
seedNoRandom seed (-1 = random).
stepsNoSampling steps.
widthNoImage width in pixels.
heightNoImage height in pixels.
n_iterNoNumber of iterations (batches).
promptYesPositive prompt. Supports <wildcards> and [style:name] syntax.
stylesNoStyle names to apply (from sdnext_list_styles).
tilingNoUse VAE tiling (saves VRAM, may degrade quality).
cfg_endNoLegacy CFG end step fraction.
subseedNoSecondary seed (-1 = random).
cfg_trueNoTrue CFG scale (SD3/Flux style).
hr_scaleNoHigh-res fix scale factor.
save_dirNoLocal directory to write returned images into (creates it).
vae_typeNoVAE type: "Full" or "Tiled".
cfg_scaleNoLegacy CFG scale (guidance_scale when guidance_name=CFG).
clip_skipNoCLIP skip value.
enable_hrNoEnable high-res fix (two-pass generation).
batch_sizeNoNumber of images per iteration.
ip_adapterNoIP adapter conditioning units.
cfg_rescaleNoLegacy CFG rescale.
hr_resize_xNoHigh-res fix target width.
hr_resize_yNoHigh-res fix target height.
hr_upscalerNoUpscaler for high-res fix.
save_imagesNoSave images to disk.
script_argsNoScript arguments, positional order matching script args.
script_nameNoScript to run (from sdnext_list_scripts).
send_imagesNoReturn base64 images in response (default true).
cfg_adaptiveNoAdaptive CFG (0-1).
init_controlNoLegacy init_control format.
sampler_nameNoSampler name (from sdnext_list_samplers), e.g. "euler_a", "dpmpp_2m_sde".
control_unitsNoControlNet/control units to apply.
guidance_nameNoModular guidance type (e.g. "Default", "CFGZero", "APG").
guidance_stopNoGuidance stop step fraction (0-1).
refiner_startNoRefiner start step fraction (0-1).
refiner_stepsNoRefiner steps (0 = disabled).
detailer_stepsNoDetailer steps.
guidance_scaleNoModular guidance scale (new SD.Next guidance system).
guidance_startNoGuidance start step fraction (0-1).
refiner_promptNoRefiner prompt override.
detailer_modelsNoDetailer model names (from sdnext_list_detailers).
detailer_promptNoDetailer prompt.
hr_sampler_nameNoSampler for high-res fix ("Same as primary" by default).
negative_promptNoNegative prompt.
alwayson_scriptsNoAlways-on script args keyed by script name.
detailer_classesNoComma-separated YOLO classes to detail (default: person).
detailer_enabledNoEnable built-in YOLO detailer.
do_not_save_gridNoDo not save grid image.
guidance_rescaleNoGuidance rescale (0-1).
lora_fuse_nativeNoFuse LoRA via native weights (fast, no TE recompile).
refiner_negativeNoRefiner negative prompt override.
subseed_strengthNoHow much to use the subseed (0-1).
detailer_negativeNoDetailer negative prompt.
detailer_strengthNoDetailer denoising strength.
lora_force_reloadNoForce LoRA reload.
seed_resize_from_hNoResize from height for seed adjustment (-1 = disabled).
seed_resize_from_wNoResize from width for seed adjustment (-1 = disabled).
detailer_resolutionNoDetailer resolution.
do_not_save_samplesNoDo not save samples to disk.
lora_fuse_diffusersNoFuse LoRA via diffusers (slower, most compatible).
sd_model_checkpointNoCheckpoint model name or filename to use (from sdnext_list_checkpoints).
hr_second_pass_stepsNoSteps for second pass (0 = full steps).
hr_denoising_strengthNoHigh-res fix denoising strength (0-1).
extra_networks_default_multiplierNoDefault multiplier for extra networks mentioned in prompt.
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool returns base64 images, an info string, and echoed parameters, plus mentions that save_dir creates a local directory and send_images controls response behavior. However, it does not disclose computational cost (GPU/time), caching behavior, rate limits, or potential side effects like writing to disk (unless save_images/save_dir set). For a complex generation tool, this is moderate coverage.

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 description is a single comprehensive sentence, front-loaded with 'Generate images from text prompts'. It crams many feature names but each is a recognizable keyword. It's a bit noun-heavy but acceptable for a feature-rich tool. No fluff, but the list of features is a bit dense.

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 65 parameters fully described in schema and no output schema, the description covers the core purpose and return format. However, it doesn't mention execution time, memory requirements, or that the tool may be slow/expensive, which is relevant for an agent deciding whether to invoke. Slightly above average because the feature list guides what to set, but gaps around operational context.

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 100%, so each of 65 parameters has a description. The tool description adds value by mentioning that some parameters are sourced from list tools (e.g., sampler_name from sdnext_list_samplers, models from sdnext_list_controlnets), which is also in schema but the tool description reinforces. However, it doesn't add parameter-relationship or workflow hints beyond schema. With full schema coverage, a 3 baseline, but the description's mention of LoRA syntax and endpoint provides some added semantics.

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 images from text prompts, references the underlying SD.Next API endpoint (/sdapi/v1/txt2img), and enumerates supported features (samplers, guidance, hires fix, refiner, detailer, LoRA, styles, scripts, control units, face modules, XYZ grid). This distinctly separates it from sibling tools like sdnext_img2img (image-to-image) and sdnext_control. The verb 'generate' and resource 'images from text prompts' are specific.

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 implies usage for text-to-image generation and hints at feature selection (e.g., mentioning LoRA syntax, styles, scripts), but does not explicitly state when to use this over sdnext_img2img or sdnext_process_image. It lacks explicit when-not or alternative guidance. The API endpoint mention is helpful context, but no exclusion criteria are given. Without sibling differentiation, it's slightly above baseline because the feature list suggests richness.

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/Congenital/sdnext_mcp'

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