{"record":{"id":"40b351bd0cc80119","repo":"LykosAI/StabilityMatrix","slug":"no-clip-type-selected","errorCode":null,"errorMessage":"No Clip Type Selected","messagePattern":"No Clip Type Selected","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/ViewModels/Inference/ModelCardViewModel.cs","lineNumber":1692,"sourceCode":"\n            e.Builder.Connections.Base.Model = modelSamplingSd3.Output;\n        }\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        if (SelectedClipType == \"flux\")\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            var clipType = SelectedClipType ?? throw new ValidationException(\"No Clip Type Selected\");\n\n            e.Builder.Connections.Base.Clip = AnyClipIsGguf(SelectedClip1, SelectedClip2)\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 = clipType,\n                        }\n                    )\n                    .Output\n                : e\n                    .Nodes.AddTypedNode(\n                        new ComfyNodeBuilder.DualCLIPLoader\n                        {\n                            Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.DualCLIPLoader)),","sourceCodeStart":1674,"sourceCodeEnd":1710,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/Inference/ModelCardViewModel.cs#L1674-L1710","documentation":"The Flux dual-CLIP branch also requires an explicit clip type string; when SelectedClipType is null the builder cannot decide between the standard DualCLIPLoader and the GGUF variant, so it throws. Note the guard `SelectedClipType == \"flux\"` passed, meaning the null case arises when the property holds \"flux\" but the later local re-read (`SelectedClipType ?? throw`) still treats the nullable as possibly empty.","triggerScenarios":"Building a Flux workflow when SelectedClipType is null/empty at the point the clipType local is assigned — e.g. the Clip Type dropdown was cleared or never persisted after selecting flux mode.","commonSituations":"Custom workflows/templates missing the clip type field; binding/serialization of the ViewModel state dropped the selection; user reset the card while remaining in a flux-shaped graph.","solutions":["Set the Clip Type dropdown (e.g. \"flux\") in the Model card so SelectedClipType has a value before generating","Re-load or repair the workflow/preset that is missing the clip type field","If driving programmatically, assign SelectedClipType before invoking the build step"],"exampleFix":"// before\nvar clipType = SelectedClipType ?? throw new ValidationException(\"No Clip Type Selected\");\n// after\nif (string.IsNullOrEmpty(SelectedClipType))\n{\n    NotificationHelper.Warn(\"Select a CLIP type\");\n    return;\n}\nvar clipType = SelectedClipType;","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(vm.SelectedClipType))\n    throw new InvalidOperationException(\"Select a Clip Type before building the workflow\");","typeGuard":"bool HasClipType(ModelCardViewModel vm) => !string.IsNullOrEmpty(vm.SelectedClipType);","tryCatchPattern":"try { builder.ApplyStep(e); } catch (ValidationException ex) when (ex.Message == \"No Clip Type Selected\") { NotifyUser(\"Choose the CLIP type in the Model card\"); }","preventionTips":["Never clear the Clip Type dropdown once a CLIP-dependent workflow is configured","Validate that templates carry a clip type field on import","Reset the whole card rather than individual fields to keep bindings consistent"],"tags":["validation","comfyui","ui-state"],"backgroundTag":"missing-required-argument","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"}