{"record":{"id":"d7e87f87c34adc20","repo":"LykosAI/StabilityMatrix","slug":"no-text-encoders-configured-please-select-at-least-one","errorCode":null,"errorMessage":"No text encoders configured. Please select at least one encoder model.","messagePattern":"No text encoders configured\\. Please select at least one encoder model\\.","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/ViewModels/Inference/ModelCardViewModel.cs","lineNumber":1933,"sourceCode":"                            Type = clipType,\n                        }\n                    )\n                    .Output\n                : e\n                    .Nodes.AddTypedNode(\n                        new ComfyNodeBuilder.CLIPLoader\n                        {\n                            Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.CLIPLoader)),\n                            ClipName = clipName1,\n                            Type = clipType,\n                        }\n                    )\n                    .Output;\n        }\n        else\n        {\n            // No valid encoders configured\n            throw new ValidationException(\n                \"No text encoders configured. Please select at least one encoder model.\"\n            );\n        }\n    }\n\n    private static bool AnyClipIsGguf(params HybridModelFile?[] clips) =>\n        clips.Any(clip => clip is { IsGguf: true });\n\n    internal class ModelCardModel\n    {\n        public string? SelectedModelName { get; init; }\n        public string? SelectedRefinerName { get; init; }\n        public string? SelectedVaeName { get; init; }\n\n        // Legacy encoder fields (for backward compatibility)\n        public string? SelectedClip1Name { get; init; }\n        public string? SelectedClip2Name { get; init; }\n        public string? SelectedClip3Name { get; init; }","sourceCodeStart":1915,"sourceCodeEnd":1951,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/Inference/ModelCardViewModel.cs#L1915-L1951","documentation":"ModelCardViewModel's base-CLIP setup throws this ValidationException when none of the supported text-encoder slots (e.g. Clip1/Clip2) holds a valid selection, so the workflow builder reaches the final 'else' branch with nothing to wire into Connections.Base.Clip. ComfyUI text-to-image workflows require at least one text encoder, so the library fails fast.","triggerScenarios":"Running the inference workflow with a model card where SelectedClip1 is null/None and all other encoder slots are also unset — i.e. no text encoder file is configured at all.","commonSituations":"Fresh model card for a checkpoint the user believes bundles its own CLIP but the card still requires encoder selection; user cleared encoder selections while troubleshooting; imported preset with encoder paths that failed to resolve to files, silently leaving slots empty.","solutions":["Select at least one text encoder model in the model card (Clip1 or Clip2 slot).","Programmatically assign SelectedClip1 (plus ClipType) or SelectedClip2 with a valid HybridModelFile before generating.","If the checkpoint truly needs no external encoder, use the correct checkpoint-only model type/card so the encoder branch is not entered.","Validate encoder selections in UI before enabling the Generate button."],"exampleFix":"// before\ncard.SelectedClip1 = null;\ncard.SelectedClip2 = null;\nawait vm.Generate(); // throws\n// after\ncard.SelectedClip1 = installedTextEncoder;\ncard.SelectedClipType = ComfyClipType.ClipL;\nawait vm.Generate();","handlingStrategy":"validation","validationCode":"bool hasEncoder = card.SelectedClip1 is { IsNone: false } || card.SelectedClip2 is { IsNone: false };\nif (!hasEncoder) throw new InvalidOperationException(\"Select at least one text encoder\");","typeGuard":"var encodersConfigured = new[] { card.SelectedClip1, card.SelectedClip2 }.Any(c => c is { IsNone: false });","tryCatchPattern":"try { await vm.Generate(); }\ncatch (ValidationException ex) when (ex.Message.StartsWith(\"No text encoders configured\"))\n{\n    // guide user to select a text encoder model\n}","preventionTips":["Require an encoder selection before enabling generation for model types that need one.","After importing presets, verify encoder slots actually resolved to installed files.","Show inline validation markers on empty encoder slots."],"tags":["validation","comfyui","workflow-config","empty-selection"],"backgroundTag":"empty-required-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"}