LykosAI/StabilityMatrix · error · ValidationException
Upscaler is required
Error message
Upscaler is required
What it means
UpscalerModule.OnApplyStep throws this ValidationException when calling Group_Upscale because card.SelectedUpscaler is null — no upscale model (e.g. an ESRGAN/4x-UltraSharp upscaler) was chosen on the upscaler card. The upscale group node needs a model name, so the workflow build aborts.
Solutions
- Select an upscaler model in the Upscaler card's model dropdown before generating.
- Install an upscaler model (e.g. 4x-UltraSharp.pth) into the upscale models directory so it can be selected.
- Programmatically set card.SelectedUpscaler to a valid installed HybridModelFile.
- Remove/disable the Upscaler step if upscaling is not needed.
- Pre-validate that SelectedUpscaler is non-null whenever the upscaler card is enabled.
Example fix
// before upscalerCard.IsEnabled = true; // SelectedUpscaler null await vm.Generate(); // after upscalerCard.IsEnabled = true; upscalerCard.SelectedUpscaler = upscalerModelFile; await vm.Generate();
Defensive patterns
Strategy: validation
Validate before calling
if (upscalerCard.SelectedUpscaler is null)
throw new InvalidOperationException("Upscaler step requires an upscaler model"); Type guard
var hasUpscaler = upscalerCard.SelectedUpscaler?.RelativePath is not null;
Try / catch
try { await vm.Generate(); }
catch (ValidationException ex) when (ex.Message == "Upscaler is required")
{
// prompt user to pick an upscaler model
} Prevention
- Gate the upscale step behind a non-null SelectedUpscaler check.
- Ship/point users to install a default upscaler model so the dropdown is never empty.
- Clear or disable the upscale step if its model file is deleted.
When it happens
Trigger: Adding/upscaling in the inference pipeline with the Upscaler card enabled but its upscaler model dropdown left empty at generation time.
Common situations: User enables upscale step but forgets to pick an upscaler model; upscaler models were never added to the Upscale Models folder so nothing can be selected; imported preset references an upscaler that no longer exists, leaving the selection null.
Understand the failure class
Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 libraries.
Related errors
- No SelectedModel
- No BboxModel
- Length cannot be null when latentType is Hunyuan
- Prompt extensions not installed
- No ImageSource
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/1c68c92c29a1514a.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Avalonia/ViewModels/Inference/Modules/UpscalerModule.cs:41
/// <inheritdoc />
protected override void OnApplyStep(ModuleApplyStepEventArgs e)
{
var card = GetCard<UpscalerCardViewModel>();
// Skip if scale is close to 1
if (Math.Abs(card.Scale - 1) < 0.005)
{
return;
}
var upscaleSize = e.Builder.Connections.PrimarySize.WithScale(card.Scale);
var upscaleResult = e.Builder.Group_Upscale(
e.Builder.Nodes.GetUniqueName("PostUpscale"),
e.Builder.Connections.Primary ?? throw new ArgumentException("No Primary"),
e.Builder.Connections.GetDefaultVAE(),
card.SelectedUpscaler ?? throw new ValidationException("Upscaler is required"),
upscaleSize.Width,
upscaleSize.Height
);
e.Builder.Connections.Primary = upscaleResult;
e.Builder.Connections.PrimarySize = upscaleSize;
}
}
View on GitHub (pinned to af93d6ef57)