{"record":{"id":"be3d33276bc0462a","repo":"LykosAI/StabilityMatrix","slug":"no-clip1-selected-unetmodelcardviewmodel","errorCode":null,"errorMessage":"No Clip1 Selected","messagePattern":"No Clip1 Selected","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/ViewModels/Inference/UnetModelCardViewModel.cs","lineNumber":76,"sourceCode":"        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\",\n                        }\n                    )\n                    .Output\n                : e\n                    .Nodes.AddTypedNode(\n                        new ComfyNodeBuilder.DualCLIPLoader","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/Inference/UnetModelCardViewModel.cs#L58-L94","documentation":"Thrown in UnetModelCardViewModel.ApplyStep when the first CLIP model (text encoder) is not selected. UNet-based workflows use a DualCLIPLoader (or GGUF variant) requiring two CLIP file names; a null SelectedClip1 fails validation before the node is added.","triggerScenarios":"ApplyStep executed with SelectedClip1 == null when clipName1 is computed via SelectedClip1?.RelativePath ?? throw.","commonSituations":"UNet/checkpoint workflows (SDXL, Flux) require two text-encoder files (clip_l + clip_g or t5) and the user has only downloaded the base UNet; preset points at a deleted CLIP file; dropdowns reset after switching model modes.","solutions":["Select the first CLIP file (e.g. clip_l.safetensors) in the Clip1 dropdown","Download the required text-encoder files via Model Manager if missing","Update the saved preset to reference installed CLIP files"],"exampleFix":"// before\nawait vm.ApplyStep(args); // SelectedClip1 null -> throws\n// after\nif (vm.SelectedClip1 is null || vm.SelectedClip2 is null)\n    throw new ValidationException(\"Select both CLIP models first\");\nawait vm.ApplyStep(args);","handlingStrategy":"validation","validationCode":"if (vm.SelectedClip1 is null)\n    throw new ValidationException(\"Select Clip1 (e.g. clip_l) before generating\");","typeGuard":"bool hasClip1 = vm.SelectedClip1 is not null;","tryCatchPattern":"try { vm.ApplyStep(args); }\ncatch (ValidationException ex) when (ex.Message == \"No Clip1 Selected\") { /* prompt CLIP selection */ }","preventionTips":["Install both required text encoders with the UNet model","Keep Clip1/Clip2 selections together when saving presets","Disable Generate until Clip1 and Clip2 are chosen"],"tags":["validation","clip","text-encoder","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"}