SDnext Parameters Guide
This guide documents all parameters available in SDnext.
Parameters listed here can be used in the extra
field of styles. Parameters there are specified as comma-separated key-value pairs using colons.
Table of Contents
- Base Parameters
- Understanding Parameter Value Types
- Sampler Parameters
- Guidance Parameters
- Style Parameters
- VAE Parameters
- Enhancement Parameters
- Detailer Parameters
- HDR Correction Parameters
- Image-to-Image Parameters
- High-Resolution (HiRes) Parameters
- Inpainting Parameters
- Refiner Parameters
- Save Options
- Script Parameters
- Override Parameters
- Video Processing Parameters
- Clip skip
- Resize modes
- Context aware scaling
- Notes
Understanding Parameter Terminology
This section helps you understand the different terms used throughout the SDnext Processing Parameters Guide. Here’s a breakdown:
Type | Use For | Example |
---|---|---|
key |
Identifier name for the parameter, before the colon | prompt , seed , width |
str |
Text or labels | "portrait, masterpiece" |
int |
Whole numbers | 20 , 512 |
float |
Numbers with decimals | 0.5 , 7.5 |
bool |
On/Off toggles | True , False |
list |
Multiple values | ["style1", "style2"] |
Dict |
Key-value settings | {key: value} |
Any |
Flexible input types, context dependent | image.png , #FFAA00 , True |
Base Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
prompt |
str |
"" |
Syntax: prompt: your text here |
The positive text prompt describing what you want to generate. This is the main instruction that tells the AI what image to create. |
negative_prompt |
str |
"" |
Syntax: negative_prompt: bad quality, blurry, extra fingers |
Text describing what you want to avoid in the generation. Common negatives include unwanted elements, quality issues, or artistic styles you want to exclude. |
seed |
int |
-1 |
Values: -1 (random), or any positive integer Syntax: seed: 12345 |
Random seed for reproducible results. Using the same seed with identical settings will generate the same image. -1 generates a random seed each time. |
subseed |
int |
-1 |
Values: -1 (random), or any positive integer Syntax: subseed: 67890 |
Secondary seed for additional variation control. Works together with subseed_strength to add controlled randomness to your generation. |
subseed_strength |
float |
0 |
Range: 0.0 to 1.0 Syntax: subseed_strength: 0.15 |
How much the subseed affects the generation (0 = no effect, 1 = maximum effect). Useful for creating slight variations of the image with the same seed. |
seed_resize_from_h |
int |
-1 |
Values: -1 (disabled), or positive integer Syntax: seed_resize_from_h: 512 |
Original height for seed resizing. This maintains noise patterns when changing resolution, useful when upscaling while keeping similar composition. |
seed_resize_from_w |
int |
-1 |
Values: -1 (disabled), or positive integer Syntax: seed_resize_from_w: 512 |
Original width for seed resizing. Works with seed_resize_from_h to maintain consistency across resolution changes. |
batch_size |
int |
1 |
Values: 1 or higher Syntax: batch_size: 4 |
Number of images to generate simultaneously. Higher values use more GPU memory but are more efficient than generating images one by one. |
n_iter |
int |
1 |
Values: 1 or higher Syntax: n_iter: 5 |
Number of generation iterations (batches) to run. If batch_size is 4 and n_iter is 5, you'll get 20 images total. |
clip_skip |
int |
1 |
Range: 1 to 12 Syntax: clip_skip: 2 |
Skip last N layers of CLIP model. Only affects models which use CLIP as their Text Encoder. Values 1 or 2 used with SD1.5, should be left at default 1 with SDXL and other models. More here: Clip skip |
width |
int |
1024 |
Values: Multiples of 8 Syntax: width: 1280 |
Image width in pixels. Must be divisible by 8. For best results use resolutions recommended for the model you're using. |
height |
int |
1024 |
Values: Multiples of 8 Syntax: height: 768 |
Image height in pixels. Must be divisible by 8. Consider aspect ratio for best results. |
Sampler Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
sampler_name |
str |
None |
Values: "Euler", "Euler a", "DPM++ 2M", etc. Syntax: sampler_name: DPM++ 2M Karras |
Algorithm used for image generation. Different samplers can produce different styles and qualities. |
steps |
int |
20 |
Range: 1 to 150 (typical) Syntax: steps: 30 |
Number of denoising steps. More steps generally mean better quality but slower generation. 20-50 is typical, with diminishing returns above 50. Settings may vary depending on sampler chosen. |
hr_sampler_name |
str |
None |
Values: Same as sampler_name Syntax: hr_sampler_name: UniPC |
Sampler for high-resolution pass. Can be different from primary sampler for specialized effects during upscaling when using HiRes. |
eta |
float |
None |
Range: 0.0 to 1.0 Syntax: eta: 0.67 |
Noise multiplier for samplers that support it (like DDIM). Adds randomness to deterministic samplers. 0 = fully deterministic, 1 = maximum noise. |
Guidance Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
cfg_scale |
float |
6.0 |
Range: 1.0 to 30.0 Syntax: cfg_scale: 7.5 |
Classifier-Free Guidance scale. Higher values follow your prompt more closely but can cause oversaturation. 4-12 is typical for most uses. |
cfg_end |
float |
1.0 |
Range: 0.0 to 1.0 Syntax: cfg_end: 0.7 |
When to stop applying CFG during generation (1.0 = full generation). Lower values can produce more creative results by reducing guidance in later steps. |
diffusers_guidance_rescale |
float |
0.0 |
Range: 0.0 to 1.0 Syntax: diffusers_guidance_rescale: 0.3 |
Rescale guidance for diffusers to prevent oversaturation when using high CFG values. Helps maintain color balance. |
pag_scale |
float |
0.0 |
Range: 0.0 to 5.0 Syntax: pag_scale: 2.0 |
Perturbed Attention Guidance scale for enhanced details. Improves fine details without affecting overall composition. |
pag_adaptive |
float |
0.5 |
Range: 0.0 to 1.0 Syntax: pag_adaptive: 0.8 |
Adaptive strength for PAG. Controls how much the guidance adapts to different image regions. |
Style Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
styles |
List[str] |
[] |
Syntax: styles: [photorealistic, dramatic lighting] |
List of style names to apply to the prompt. These are predefined styles that modify both prompts and parameters. |
VAE Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
tiling |
bool |
False |
Syntax: tiling: True |
Enable tiled VAE decoding for seamless textures. Perfect for creating repeating patterns or textures that tile without visible seams. |
vae_type |
str |
"Full" |
Values: "Full", "Tiny", "Remote" Syntax: vae_type: Tiny |
What type of VAE will be used for VAE Decode step at the end of generation. "Full" uses full VAE provided for the model, "Tiny" uses TAESD, a smaller VAE version that provides memory savings but lower quality, "Remote" utilises Huggingface remote VAE service to decode latent images on Huggingface servers instead of locally. |
Enhancement Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
hidiffusion |
bool |
False |
Syntax: hidiffusion: True |
Enable HiDiffusion for improved high-resolution generation. Helps maintain quality and coherence at resolutions higher than the model is capable of natively. |
do_not_reload_embeddings |
bool |
False |
Syntax: do_not_reload_embeddings: True |
Skip reloading embeddings (performance optimization). Useful when running multiple generations with the same embeddings. |
restore_faces |
bool |
False, |
Values: False, codeformer, gfpgan Syntax: restore_faces: True |
Apply face restoration post-processing using Codeformer or GFPGAN neural network. Automatically detects and enhances faces in the image for better facial details. Not the same as detailer, generally inferior, legacy option. |
enhance_prompt |
bool |
False |
Syntax: enhance_prompt: True |
Automatically enhance/expand the prompt using AI. Adds more descriptive details to simple prompts for better results. |
Detailer Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
detailer_enabled |
bool |
False |
Syntax: detailer_enabled: True |
Enable automatic detail enhancement pass. Runs after first and second pass, uses detection models for automatic detection and masking. Supports custom YOLO detection models for detection of various objects on the image. |
detailer_prompt |
str |
'' |
Syntax: detailer_prompt: highly detailed, sharp focus |
Specific prompt for detail enhancement. If used, overrides main positive prompt during detail pass for targeted improvements. |
detailer_negative |
str |
'' |
Syntax: detailer_negative: blurry, low quality |
Negative prompt for detail enhancement. If used, overrides main negative prompt during detail pass. |
detailer_steps |
int |
10 |
Range: 1 to 50 Syntax: detailer_steps: 15 |
Number of steps for detail enhancement. Can be set lower than main steps since it's refining existing details. |
detailer_strength |
float |
0.3 |
Range: 0.0 to 1.0 Syntax: detailer_strength: 0.5 |
Strength of detail enhancement. Higher values change the image more dramatically during detailing pass. |
HDR Correction Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
hdr_mode |
int |
0 |
Values: 0 (disabled), 1, 2, 3 Syntax: hdr_mode: 1 |
HDR processing mode. Each mode applies different tone mapping algorithms for enhanced dynamic range. |
hdr_brightness |
float |
0 |
Range: -1.0 to 1.0 Syntax: hdr_brightness: 0.2 |
Brightness adjustment. Positive values brighten the image, negative values darken it. |
hdr_color |
float |
0 |
Range: -1.0 to 1.0 Syntax: hdr_color: 0.3 |
Color/saturation adjustment. Positive values increase color vibrancy, negative values reduce it. |
hdr_sharpen |
float |
0 |
Range: 0.0 to 2.0 Syntax: hdr_sharpen: 0.5 |
Sharpening strength. Enhances edge details and overall image crispness. |
hdr_clamp |
bool |
False |
Syntax: hdr_clamp: True |
Clamp HDR values to prevent overflow. Prevents extreme bright or dark areas from clipping. |
hdr_boundary |
float |
4.0 |
Syntax: hdr_boundary: 3.5 |
HDR boundary threshold. Controls the range of HDR effect application. |
hdr_threshold |
float |
0.95 |
Range: 0.0 to 1.0 Syntax: hdr_threshold: 0.9 |
HDR activation threshold. Determines which brightness levels trigger HDR processing. |
hdr_maximize |
bool |
False |
Syntax: hdr_maximize: True |
Maximize HDR effect. Applies the strongest possible HDR enhancement. |
hdr_max_center |
float |
0.6 |
Range: 0.0 to 1.0 Syntax: hdr_max_center: 0.5 |
Center point for HDR maximization. Defines the brightness level that receives maximum enhancement. |
hdr_max_boundry |
float |
1.0 |
Syntax: hdr_max_boundry: 0.8 |
Boundary for HDR maximization. Sets the range around the center point for maximum effect. |
hdr_color_picker |
str |
None |
Syntax: hdr_color_picker: #FF5500 |
Color reference for HDR tinting. Applies a color cast to the HDR effect using hex color codes. |
hdr_tint_ratio |
float |
0 |
Range: 0.0 to 1.0 Syntax: hdr_tint_ratio: 0.2 |
Strength of HDR color tinting. Controls how much the selected color affects the image. |
Image-to-Image Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
init_images |
list |
None |
Syntax: init_images: [image1.png] |
List of input images for img2img/inpainting. These serve as the starting point for transformation. |
resize_mode |
int |
0 |
Values: 0 (Just resize), 1 (Crop and resize), ... Syntax: resize_mode: 1 |
How to handle size mismatch between input and output. Choose based on whether you want to preserve aspect ratio or fill the canvas. See more: Resize modes |
resize_name |
str |
'None' |
Values: Upscaler names ("Lanczos", "ESRGAN_4x") Syntax: resize_name: ESRGAN_4x |
Upscaler to use for resizing. Different upscalers excel at different content types. |
resize_context |
str |
'None' |
Values 'None, Add with forward", "Remove with forward", "Add with backward", "Remove with backward Syntax: resize_context: Add with forward |
Advanced image resizing technique that intelligently adds or removes content from images while preserving important visual elements. See more: Context-aware scaling |
denoising_strength |
float |
0.3 |
Range: 0.0 to 1.0 Syntax: denoising_strength: 0.75 |
How much to change the input image. 0 = no change, 1 = complete reimagining. 0.3-0.7 is typical for variations. |
image_cfg_scale |
float |
None |
Range: 0.0 to 3.0 Syntax: image_cfg_scale: 1.5 |
Image conditioning strength (for ControlNet/IP-Adapter). Controls how closely to follow the input image structure. |
scale_by |
float |
1.0 |
Range: 0.1 to 8.0 Syntax: scale_by: 2.0 |
Scale factor for input image. 2.0 doubles the size, 0.5 halves it. |
High-Resolution (HiRes) Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
enable_hr |
bool |
False |
Syntax: enable_hr: True |
Enable high-resolution second pass. Generates at lower resolution first, then upscales and optionally refines. |
hr_scale |
float |
2.0 |
Range: 1.0 to 4.0 Syntax: hr_scale: 2.5 |
Upscale factor for hires pass. 2.0 means the final image will be twice the width and height of the initial generation. |
hr_upscaler |
str |
None |
Values: "None", "Lanczos", "ESRGAN_4x", etc. Syntax: hr_upscaler: R-ESRGAN 4x+ |
Upscaler algorithm for hires pass. Each has strengths for different image types and styles. Can be combined with HiRes to upscale the image and then refine it. |
hr_second_pass_steps |
int |
0 |
Values: 0 (use primary steps), or 1-150 Syntax: hr_second_pass_steps: 20 |
Number of steps for hires pass. Often fewer steps are needed since it's refining an existing image. |
hr_resize_x |
int |
0 |
Values: 0 (use scale), or target width Syntax: hr_resize_x: 2048 |
Target width for hires (overrides scale). Use for exact output dimensions rather than relative scaling. |
hr_resize_y |
int |
0 |
Values: 0 (use scale), or target height Syntax: hr_resize_y: 1536 |
Target height for hires (overrides scale). Pairs with hr_resize_x for exact dimensions. |
hr_denoising_strength |
float |
0.0 |
Range: 0.0 to 1.0 Syntax: hr_denoising_strength: 0.4 |
Denoising strength for hires pass. Lower values preserve more detail from upscale, higher values allow more creative changes. |
firstphase_width |
int |
0 |
Values: 0 (disabled), or initial width Syntax: firstphase_width: 512 |
Override initial generation width. Useful for controlling the first pass resolution independently. |
firstphase_height |
int |
0 |
Values: 0 (disabled), or initial height Syntax: firstphase_height: 512 |
Override initial generation height. Works with firstphase_width for custom initial dimensions. |
Inpainting Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
mask |
Any |
None |
Syntax: mask: mask_image.png |
Mask image for inpainting. White areas will be regenerated, black areas will be preserved. |
mask_blur |
int |
4 |
Range: 0 to 64 Syntax: mask_blur: 8 |
Blur radius for mask edges. Higher values create smoother transitions between inpainted and original areas. |
inpainting_fill |
int |
0 |
Values: 0 (fill), 1 (original), 2 (latent noise), ... Syntax: inpainting_fill: 2 |
What to put in masked areas before inpainting. Different modes work better for different scenarios. |
inpaint_full_res |
bool |
False |
Syntax: inpaint_full_res: True |
Inpaint at full resolution of masked area only. Useful for detailed work on small areas without processing the entire image. |
inpaint_full_res_padding |
int |
0 |
Range: 0 to 256 Syntax: inpaint_full_res_padding: 32 |
Padding around masked area for full res inpainting. Helps blend the inpainted area with surroundings. |
inpainting_mask_invert |
int |
0 |
Values: 0 (normal), 1 (inverted) Syntax: inpainting_mask_invert: 1 |
Invert the mask (swap inpaint/keep areas). Useful when your mask highlights what to keep rather than what to change. |
Refiner Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
refiner_steps |
int |
5 |
Range: 0 to 50 Syntax: refiner_steps: 10 |
Number of steps for refiner model. Refiner models add final details and polish to images. |
refiner_start |
float |
0 |
Range: 0.0 to 1.0 Syntax: refiner_start: 0.8 |
When to switch to refiner (0.8 = at 80% of steps). Earlier switching gives refiner more influence over the final image. |
refiner_prompt |
str |
'' |
Syntax: refiner_prompt: masterpiece, best quality |
Override main positive prompt for refiner. Allows specialized prompting for the refinement stage. |
refiner_negative |
str |
'' |
Syntax: refiner_negative: low quality, blurry |
Override main negative prompt for refiner. |
hr_refiner_start |
float |
0 |
Range: 0.0 to 1.0 Syntax: hr_refiner_start: 0.85 |
When to switch to refiner in hires pass. Can be different from primary refiner_start for specialized workflows. |
Save Options
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
outpath_samples |
str |
None |
Syntax: outpath_samples: outputs/my_project/ |
Custom output directory for images. Helps organize outputs for different projects or styles. |
outpath_grids |
str |
None |
Syntax: outpath_grids: outputs/grids/ |
Custom output directory for grids. Separate location for batch result grids. |
do_not_save_samples |
bool |
False |
Syntax: do_not_save_samples: True |
Skip saving individual images. Useful when only the grid matters or for preview runs. |
do_not_save_grid |
bool |
False |
Syntax: do_not_save_grid: True |
Skip saving image grid. Useful when generating single images or when individual files are preferred. |
Script Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
script_args |
list |
[] |
Syntax: script_args: [arg1, arg2, arg3] |
Arguments passed to active scripts/extensions. Format depends on the specific script being used. |
Override Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
override_settings |
Dict[str, Any] |
{} |
Syntax: override_settings: {CLIP_stop_at_last_layers: 2} |
Temporarily override global settings for this generation. Settings revert after generation completes. |
override_settings_restore_afterwards |
bool |
True |
Syntax: override_settings_restore_afterwards: False |
Restore original settings after generation. Set to False to make overrides permanent. |
Video Processing Parameters
Parameter | Type | Default | Details / Syntax | Description |
---|---|---|---|---|
prompt_template |
str |
None |
Syntax: prompt_template: frame {frame_num}: {base_prompt} |
Template for animated prompts across frames. Allows dynamic prompt changes throughout video generation. |
frames |
int |
1 |
Values: 1 or higher Syntax: frames: 30 |
Number of video frames to generate. More frames = longer video but longer generation time. |
scheduler_shift |
float |
0.0 |
Syntax: scheduler_shift: 0.5 |
Shift scheduler timing for animation effects. Creates motion and transformation effects between frames. |
vae_tile_frames |
int |
0 |
Syntax: vae_tile_frames: 8 |
Number of frames to tile in VAE for memory efficiency. Helps process longer videos on limited GPU memory. |
Clip skip
TODO
Resize modes
TODO
Context aware scaling
TODO
Notes
- Memory Considerations: Higher batch_size, steps, and resolution require more GPU memory
- Quality vs Speed: More steps generally improve quality but increase generation time
- Compatibility: Some parameters may not work with all models or samplers
- Defaults: Default values are optimized for SDXL models at 1024x1024 resolution