LykosAI/StabilityMatrix · error · ValidationException
Model not selected
Error message
Model not selected
What it means
Stability Matrix's Inference workflow builder throws ValidationException when the Wan workflow's UNet loader node is created but no model has been selected in the WanModelCard UI. For GGUF checkpoints it uses SelectedModel?.RelativePath, which is null when no checkpoint is chosen, so it throws 'Model not selected'. This is a deliberate fail-fast validation so an incomplete workflow is never sent to ComfyUI.
Solutions
- Open the Wan model card in the Inference tab and select a unet/diffusion model (gguf or safetensors) before generating.
- Click the folder/refresh icon on the model dropdown to rescan the shared model directory if the expected model is missing.
- Place the model file in the correct ComfyUI shared unet/diffusion_models folder so it appears in the picker.
- If a saved workflow triggers this, reopen it after confirming the model is indexed, or re-pick the model and save.
Example fix
// before
UnetName = SelectedModel?.RelativePath ?? throw new ValidationException("Model not selected")
// after
// in the ViewModel, before ApplyStep builds nodes:
if (SelectedModel is null)
throw new ValidationException("Model not selected"); // surfaced in UI before node building
UnetName = SelectedModel.RelativePath; Defensive patterns
Strategy: validation
Validate before calling
if (card.SelectedModel is null) throw new ValidationException("Model not selected"); Type guard
bool HasModel(WanModelCardViewModel c) => c.SelectedModel is { RelativePath: not null }; Try / catch
catch (ValidationException ex) when (ex.Message == "Model not selected") { /* prompt for model */ } Prevention
- Disable generate until all required dropdowns are set
When it happens
Trigger: Clicking generate/apply a Wan inference workflow while the UNet/GGUF model dropdown in the WanModelCardViewModel has no selection (SelectedModel == null), so SelectedModel?.RelativePath evaluates to null at WanModelCardViewModel.cs:182.
Common situations: User adds a Wan image/video generation workflow and forgets to pick a unet/diffusion-model file; the selected model was moved or deleted from the shared model folder after the card remembered its path; a preset or imported workflow references a model that no longer resolves to a selection.
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
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/b988de09dfbcfc1c.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Avalonia/ViewModels/Inference/WanModelCardViewModel.cs:182
);
await dialog.ShowAsync();
return false;
}
return true;
}
public void ApplyStep(ModuleApplyStepEventArgs e)
{
ComfyTypedNodeBase<ModelNodeConnection> modelLoader;
if (SelectedModel?.RelativePath.EndsWith("gguf", StringComparison.OrdinalIgnoreCase) is true)
{
modelLoader = e.Nodes.AddTypedNode(
new ComfyNodeBuilder.UnetLoaderGGUF
{
Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.UnetLoaderGGUF)),
UnetName =
SelectedModel?.RelativePath ?? throw new ValidationException("Model not selected"),
}
);
}
else
{
modelLoader = e.Nodes.AddTypedNode(
new ComfyNodeBuilder.UNETLoader
{
Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.UNETLoader)),
UnetName =
SelectedModel?.RelativePath ?? throw new ValidationException("Model not selected"),
WeightDtype = SelectedDType ?? "fp8_e4m3fn_fast",
}
);
}
var modelSamplingSd3 = e.Nodes.AddTypedNode(
new ComfyNodeBuilder.ModelSamplingSD3View on GitHub (pinned to af93d6ef57)