AUTOMATIC1111/stable-diffusion-webui · error · ValueError
{axis_label} value "{x}" out of range [{min_val}, {max_val}]
Error message
{axis_label} value "{x}" out of range [{min_val}, {max_val}] What it means
confirm_range is a factory that builds validation closures for numeric XYZ axes (e.g. CFG scale, denoising strength). The generated confirm_range_fun checks each axis value lies within [min_val, max_val] and raises ValueError with the axis label, offending value, and allowed interval. It protects samplers/models from out-of-range parameters that would otherwise fail unpredictably later.
Source
Thrown at scripts/xyz_grid.py:104
raise RuntimeError(f"Unknown checkpoint: {x}")
def confirm_checkpoints_or_none(p, xs):
for x in xs:
if x in (None, "", "None", "none"):
continue
if modules.sd_models.get_closet_checkpoint_match(x) is None:
raise RuntimeError(f"Unknown checkpoint: {x}")
def confirm_range(min_val, max_val, axis_label):
"""Generates a AxisOption.confirm() function that checks all values are within the specified range."""
def confirm_range_fun(p, xs):
for x in xs:
if not (max_val >= x >= min_val):
raise ValueError(f'{axis_label} value "{x}" out of range [{min_val}, {max_val}]')
return confirm_range_fun
def apply_size(p, x: str, xs) -> None:
try:
width, _, height = x.partition('x')
width = int(width.strip())
height = int(height.strip())
p.width = width
p.height = height
except ValueError:
print(f"Invalid size in XYZ plot: {x}")
def find_vae(name: str):
if (name := name.strip().lower()) in ('auto', 'automatic'):
return 'Automatic'
View on GitHub (pinned to 82a973c043)
Solutions
- Clamp or correct the offending value to fall inside the interval stated in the error message.
- If you genuinely need wider bounds, edit the axis definition in scripts/xyz_grid.py (min_val/max_val passed to confirm_range) or the extension that defines the axis.
- Validate numeric axis lists in your script before invoking the grid.
Example fix
# before (CFG axis, allowed [1.0, 30.0]) axis_values = "0, 7, 40" # 0 and 40 out of range -> ValueError # after axis_values = "1, 7, 30" # all within [1.0, 30.0]
Defensive patterns
Strategy: validation
Validate before calling
def clamp_axis_values(xs, min_val, max_val, label):
"""Raise before the run if any numeric axis value is out of range."""
bad = [x for x in xs if not (max_val >= x >= min_val)]
if bad:
raise ValueError(f'{label} values {bad} out of range [{min_val}, {max_val}]')
return xs
clamp_axis_values([1, 7, 30], 1.0, 30.0, "CFG scale") Type guard
def in_range(x, min_val, max_val) -> bool:
"""True when x is numeric and within [min_val, max_val]."""
return isinstance(x, (int, float)) and min_val <= x <= max_val Try / catch
try:
run_grid(p, axis_values)
except ValueError as e:
if "out of range" in str(e):
axis_values = [min(max_val, max(min_val, x)) for x in axis_values] # clamp and retry
else:
raise Prevention
- Clamp user-supplied numeric sweeps to the axis bounds before invoking the grid.
- Read the error message: it states the exact allowed interval per axis label.
- Keep sweep lists in config files next to their bounds so they are reviewed together.
When it happens
Trigger: Entering a numeric axis value outside the axis's supported interval, e.g. CFG scale of 0 or 40 when the axis allows [1.0, 30.0], or a negative denoising strength. Raised during axis validation before generation starts, so the entire grid aborts.
Common situations: Copy-pasted axis lists from tutorials using different bounds; exploring extreme values without checking the axis limits; locale/formatting issues where '1,5' is parsed oddly; extensions defining custom axes with narrow ranges.
Related errors
- Unknown sampler: {x}
- Invalid image format
- model {checkpoint_name!r} not found
- A tensor with NaNs was produced. Use --disable-nan-check com
- Prompt S/R did not find {xs[0]} in prompt or negative prompt
AI-assisted analysis of AUTOMATIC1111/stable-diffusion-webui@82a973c043 (2026-08-14).
Data as JSON: /api/errors/eb92fc218582a175.
Report an issue: GitHub.