{"record":{"id":"a583d1bef1ae3b94","repo":"LykosAI/StabilityMatrix","slug":"scheduler-not-selected","errorCode":null,"errorMessage":"Scheduler not selected","messagePattern":"Scheduler not selected","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/ViewModels/Inference/SamplerCardViewModel.cs","lineNumber":353,"sourceCode":"    )\n    {\n        // Provide temp values\n        e.Temp = e.CreateTempFromBuilder();\n\n        // Apply steps from our addons\n        ApplyAddonSteps(e);\n\n        // Get primary as latent using vae\n        var primaryLatent = e.Builder.GetPrimaryAsLatent(\n            e.Temp.Primary!.Unwrap(),\n            e.Builder.Connections.GetDefaultVAE()\n        );\n\n        // Set primary sampler and scheduler\n        var primarySampler = SelectedSampler ?? throw new ValidationException(\"Sampler not selected\");\n        e.Builder.Connections.PrimarySampler = primarySampler;\n\n        var primaryScheduler = SelectedScheduler ?? throw new ValidationException(\"Scheduler not selected\");\n        e.Builder.Connections.PrimaryScheduler = primaryScheduler;\n\n        // for later inheritance if needed\n        e.Builder.Connections.PrimaryCfg = CfgScale;\n        e.Builder.Connections.PrimarySteps = Steps;\n        e.Builder.Connections.PrimaryModelType = SelectedModelType;\n\n        // KSamplerSelect\n        var kSamplerSelect = e.Nodes.AddTypedNode(\n            new ComfyNodeBuilder.KSamplerSelect\n            {\n                Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.KSamplerSelect)),\n                SamplerName = e.Builder.Connections.PrimarySampler?.Name!,\n            }\n        );\n\n        e.Builder.Connections.PrimarySamplerNode = kSamplerSelect.Output;\n","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/Inference/SamplerCardViewModel.cs#L335-L371","documentation":"SamplerCardViewModel.ApplyStepsInitialCustomSampler throws this ValidationException when SelectedScheduler is null: after validating the sampler, the method must also set Connections.PrimaryScheduler, and a missing scheduler (e.g. karras, normal, sgm_uniform) leaves the sampler step incomplete, so it fails fast.","triggerScenarios":"Calling ApplyStepsInitialCustomSampler with SelectedSampler set but SelectedScheduler never assigned — the scheduler dropdown on the sampler card is empty.","commonSituations":"User picks a sampler but leaves scheduler at null; scheduler defaults were reset or a settings import omitted the scheduler; programmatic construction sets only SelectedSampler.","solutions":["Select a scheduler in the sampler card's scheduler dropdown before generating.","Programmatically set vm.SelectedScheduler to a valid ComfyScheduler value.","Set both sampler and scheduler together when configuring the card to avoid partial configuration.","Pre-validate both fields before invoking ApplyStepsInitialCustomSampler."],"exampleFix":"// before\nsamplerCard.SelectedSampler = ComfySampler.Dpmpp2m; // scheduler null\nawait samplerCard.ApplyStepsInitialCustomSampler(args); // throws\n// after\nsamplerCard.SelectedSampler = ComfySampler.Dpmpp2m;\nsamplerCard.SelectedScheduler = ComfyScheduler.Karras;\nawait samplerCard.ApplyStepsInitialCustomSampler(args);","handlingStrategy":"validation","validationCode":"if (samplerCard.SelectedSampler is null || samplerCard.SelectedScheduler is null)\n    throw new InvalidOperationException(\"Sampler and scheduler must both be selected\");","typeGuard":"var samplerStepReady = samplerCard.SelectedSampler is not null && samplerCard.SelectedScheduler is not null;","tryCatchPattern":"try { await samplerCard.ApplyStepsInitialCustomSampler(args); }\ncatch (ValidationException ex) when (ex.Message == \"Scheduler not selected\")\n{\n    // prompt user to choose a scheduler\n}","preventionTips":["Always configure sampler and scheduler as a pair.","Give the scheduler dropdown a non-null default value.","Restore both fields when importing saved sampler settings."],"tags":["validation","comfyui","scheduler","missing-selection"],"backgroundTag":"missing-required-option","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}