LykosAI/StabilityMatrix · error · ValidationException
Scheduler not selected
Error message
Scheduler not selected
What it means
WanSamplerCardViewModel.ApplyStep() reads SelectedScheduler (nullable ComfyScheduler?) and assigns it as the workflow's PrimaryScheduler. When no scheduler is selected it throws a ValidationException("Scheduler not selected") to abort building the ComfyUI graph. This is the scheduler counterpart of the 'Sampler not selected' check on the same card.
Solutions
- Connect to ComfyUI so the scheduler list loads, then select a scheduler in the Wan sampler card before generating.
- Restart the Inference tab or the app — the constructor defaults SelectedScheduler to ComfyScheduler.Simple, so a fresh card resolves the null.
- If instantiating the card in code/tests, set SelectedScheduler explicitly (e.g. card.SelectedScheduler = ComfyScheduler.Simple) before ApplyStep.
- Verify the scheduler dropdown's ItemsSource binding is populated from the client manager's scheduler list.
Example fix
// before (throws)
var primaryScheduler = SelectedScheduler ?? throw new ValidationException("Scheduler not selected");
// after (defensive default)
var primaryScheduler = SelectedScheduler ?? ComfyScheduler.Simple; Defensive patterns
Strategy: validation
Validate before calling
if (card.SelectedScheduler is null)
throw new ValidationException("Select a scheduler before generating.");
card.ApplyStep(e); Type guard
bool HasScheduler(WanSamplerCardViewModel c) => c.SelectedScheduler is not null;
Try / catch
try { card.ApplyStep(e); }
catch (ValidationException ex) { NotifyUser(ex.Message); } Prevention
- Rely on the constructor default (SelectedScheduler = ComfyScheduler.Simple); avoid clearing it.
- Ensure ComfyUI is connected before opening the Inference tab so the scheduler list loads.
- Validate all Wan card selections (sampler, scheduler) on Generate before building nodes.
- In code/tests, always set SelectedScheduler when constructing the card.
When it happens
Trigger: Running a Wan workflow when SelectedScheduler is null at ApplyStep time — the scheduler dropdown was never populated (ComfyUI disconnected / scheduler list not loaded), the selection was cleared, or the card was constructed manually without setting SelectedScheduler.
Common situations: ComfyUI backend not connected so schedulers never load; a restored prompt/layout carries a scheduler value that no longer resolves, leaving null; unit tests or other code paths instantiating WanSamplerCardViewModel via DI and invoking ApplyStep directly; binding failure between the scheduler combo box and the view model.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Sampler not selected
- : Model not selected
- BaseClipVision not set
- Prompt extensions not installed
- Resources.Validation_PackageNameCannotBeEmpty
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/89ccad5c2d6bc928.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Avalonia/ViewModels/Inference/WanSamplerCardViewModel.cs:51
SelectedScheduler = ComfyScheduler.Simple;
Length = 33;
}
public override void ApplyStep(ModuleApplyStepEventArgs e)
{
if (EnableAddons)
{
foreach (var module in ModulesCardViewModel.Cards.OfType<ModuleBase>())
{
module.ApplyStep(e);
}
}
// Set primary sampler and scheduler
var primarySampler = SelectedSampler ?? throw new ValidationException("Sampler not selected");
e.Builder.Connections.PrimarySampler = primarySampler;
var primaryScheduler = SelectedScheduler ?? throw new ValidationException("Scheduler not selected");
e.Builder.Connections.PrimaryScheduler = primaryScheduler;
// for later inheritance if needed
e.Builder.Connections.PrimaryCfg = CfgScale;
e.Builder.Connections.PrimarySteps = Steps;
e.Builder.Connections.PrimaryModelType = SelectedModelType;
e.Temp = e.CreateTempFromBuilder();
var conditioning = e.Temp.Base.Conditioning.Unwrap();
var isImgToVid = IsDenoiseStrengthEnabled;
if (isImgToVid)
{
var clipVisionEncode = e.Nodes.AddTypedNode(
new ComfyNodeBuilder.CLIPVisionEncode
{View on GitHub (pinned to af93d6ef57)