Text to Image
sdnext_txt2imgGenerate 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
| Name | Required | Description | Default |
|---|---|---|---|
| xyz | No | XYZ grid parameter sweep configuration. | |
| face | No | Face-driven generation module (FaceID/FaceSwap/PhotoMaker/InstantID). | |
| seed | No | Random seed (-1 = random). | |
| steps | No | Sampling steps. | |
| width | No | Image width in pixels. | |
| height | No | Image height in pixels. | |
| n_iter | No | Number of iterations (batches). | |
| prompt | Yes | Positive prompt. Supports <wildcards> and [style:name] syntax. | |
| styles | No | Style names to apply (from sdnext_list_styles). | |
| tiling | No | Use VAE tiling (saves VRAM, may degrade quality). | |
| cfg_end | No | Legacy CFG end step fraction. | |
| subseed | No | Secondary seed (-1 = random). | |
| cfg_true | No | True CFG scale (SD3/Flux style). | |
| hr_scale | No | High-res fix scale factor. | |
| save_dir | No | Local directory to write returned images into (creates it). | |
| vae_type | No | VAE type: "Full" or "Tiled". | |
| cfg_scale | No | Legacy CFG scale (guidance_scale when guidance_name=CFG). | |
| clip_skip | No | CLIP skip value. | |
| enable_hr | No | Enable high-res fix (two-pass generation). | |
| batch_size | No | Number of images per iteration. | |
| ip_adapter | No | IP adapter conditioning units. | |
| cfg_rescale | No | Legacy CFG rescale. | |
| hr_resize_x | No | High-res fix target width. | |
| hr_resize_y | No | High-res fix target height. | |
| hr_upscaler | No | Upscaler for high-res fix. | |
| save_images | No | Save images to disk. | |
| script_args | No | Script arguments, positional order matching script args. | |
| script_name | No | Script to run (from sdnext_list_scripts). | |
| send_images | No | Return base64 images in response (default true). | |
| cfg_adaptive | No | Adaptive CFG (0-1). | |
| init_control | No | Legacy init_control format. | |
| sampler_name | No | Sampler name (from sdnext_list_samplers), e.g. "euler_a", "dpmpp_2m_sde". | |
| control_units | No | ControlNet/control units to apply. | |
| guidance_name | No | Modular guidance type (e.g. "Default", "CFGZero", "APG"). | |
| guidance_stop | No | Guidance stop step fraction (0-1). | |
| refiner_start | No | Refiner start step fraction (0-1). | |
| refiner_steps | No | Refiner steps (0 = disabled). | |
| detailer_steps | No | Detailer steps. | |
| guidance_scale | No | Modular guidance scale (new SD.Next guidance system). | |
| guidance_start | No | Guidance start step fraction (0-1). | |
| refiner_prompt | No | Refiner prompt override. | |
| detailer_models | No | Detailer model names (from sdnext_list_detailers). | |
| detailer_prompt | No | Detailer prompt. | |
| hr_sampler_name | No | Sampler for high-res fix ("Same as primary" by default). | |
| negative_prompt | No | Negative prompt. | |
| alwayson_scripts | No | Always-on script args keyed by script name. | |
| detailer_classes | No | Comma-separated YOLO classes to detail (default: person). | |
| detailer_enabled | No | Enable built-in YOLO detailer. | |
| do_not_save_grid | No | Do not save grid image. | |
| guidance_rescale | No | Guidance rescale (0-1). | |
| lora_fuse_native | No | Fuse LoRA via native weights (fast, no TE recompile). | |
| refiner_negative | No | Refiner negative prompt override. | |
| subseed_strength | No | How much to use the subseed (0-1). | |
| detailer_negative | No | Detailer negative prompt. | |
| detailer_strength | No | Detailer denoising strength. | |
| lora_force_reload | No | Force LoRA reload. | |
| seed_resize_from_h | No | Resize from height for seed adjustment (-1 = disabled). | |
| seed_resize_from_w | No | Resize from width for seed adjustment (-1 = disabled). | |
| detailer_resolution | No | Detailer resolution. | |
| do_not_save_samples | No | Do not save samples to disk. | |
| lora_fuse_diffusers | No | Fuse LoRA via diffusers (slower, most compatible). | |
| sd_model_checkpoint | No | Checkpoint model name or filename to use (from sdnext_list_checkpoints). | |
| hr_second_pass_steps | No | Steps for second pass (0 = full steps). | |
| hr_denoising_strength | No | High-res fix denoising strength (0-1). | |
| extra_networks_default_multiplier | No | Default multiplier for extra networks mentioned in prompt. |