{"record":{"id":"98dc2fdf01505eea","repo":"LykosAI/StabilityMatrix","slug":"no-vae-selected-unetmodelcardviewmodel","errorCode":null,"errorMessage":"No VAE Selected","messagePattern":"No VAE Selected","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/ViewModels/Inference/UnetModelCardViewModel.cs","lineNumber":70,"sourceCode":"\n        var dialog = DialogHelper.CreateMarkdownDialog(\n            \"Please select a model to continue.\",\n            \"No Model Selected\"\n        );\n        await dialog.ShowAsync();\n        return false;\n    }\n\n    public void ApplyStep(ModuleApplyStepEventArgs e)\n    {\n        var checkpointLoader = e.Nodes.AddTypedNode(GetModelLoader(e, SelectedModel!, SelectedDType));\n        e.Builder.Connections.Base.Model = checkpointLoader.Output;\n\n        var vaeLoader = e.Nodes.AddTypedNode(\n            new ComfyNodeBuilder.VAELoader\n            {\n                Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.VAELoader)),\n                VaeName = SelectedVae?.RelativePath ?? throw new ValidationException(\"No VAE Selected\"),\n            }\n        );\n        e.Builder.Connections.Base.VAE = vaeLoader.Output;\n\n        // DualCLIPLoader (GGUF variant can also load .safetensors, so any gguf pick routes there)\n        var clipName1 = SelectedClip1?.RelativePath ?? throw new ValidationException(\"No Clip1 Selected\");\n        var clipName2 = SelectedClip2?.RelativePath ?? throw new ValidationException(\"No Clip2 Selected\");\n\n        e.Builder.Connections.Base.Clip =\n            SelectedClip1 is { IsGguf: true } || SelectedClip2 is { IsGguf: true }\n                ? e\n                    .Nodes.AddTypedNode(\n                        new ComfyNodeBuilder.DualCLIPLoaderGGUF\n                        {\n                            Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.DualCLIPLoaderGGUF)),\n                            ClipName1 = clipName1,\n                            ClipName2 = clipName2,\n                            Type = \"flux\",","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/Inference/UnetModelCardViewModel.cs#L52-L88","documentation":"Thrown in UnetModelCardViewModel.ApplyStep when building a UNet (e.g. SDXL/Flux/GGUF) checkpoint workflow and no VAE file is selected in the card. The workflow includes a VAELoader node that requires a VaeName, so a null SelectedVae aborts graph construction with this ValidationException.","triggerScenarios":"ApplyStep executed with SelectedVae == null at the point the ComfyNodeBuilder.VAELoader node is added (VaeName = SelectedVae?.RelativePath ?? throw).","commonSituations":"Fresh install or new model directory where no VAE has been downloaded/selected; user cleared the VAE dropdown; preset referencing a VAE that is no longer installed.","solutions":["Select a VAE file in the VAE dropdown of the UNet model card (e.g. sdxl_vae.safetensors)","Download/import a VAE into the models/vae folder via Model Manager if none is installed","Re-point the preset to an installed VAE if the previously selected one was removed"],"exampleFix":"// before\nawait vm.ApplyStep(args); // SelectedVae null -> throws\n// after\nif (vm.SelectedVae is null) { throw new ValidationException(\"Pick a VAE in the model card first\"); }\nawait vm.ApplyStep(args);","handlingStrategy":"validation","validationCode":"if (vm.SelectedVae is null)\n    throw new ValidationException(\"Select a VAE in the UNet model card before generating\");","typeGuard":"bool hasVae = vm.SelectedVae is not null;","tryCatchPattern":"try { vm.ApplyStep(args); }\ncatch (ValidationException ex) when (ex.Message == \"No VAE Selected\") { /* surface VAE picker */ }","preventionTips":["Download a matching VAE whenever you install a UNet model","Disable Generate until all required model dropdowns are set","Check presets for VAE entries that no longer exist on disk"],"tags":["validation","vae","comfyui","model-selection"],"backgroundTag":"missing-required-config-field","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"}