LykosAI/StabilityMatrix · error · ValidationException
No Clip2 Selected
Error message
No Clip2 Selected
What it means
Thrown in UnetModelCardViewModel.ApplyStep when the second CLIP model is not selected. Dual-CLIP architectures (SDXL, Flux) require exactly two text encoders; with SelectedClip2 null the DualCLIPLoader cannot be configured and validation fails.
Solutions
- Select the second CLIP file (e.g. clip_g.safetensors or t5xxl) in the Clip2 dropdown
- Download the missing second text encoder via Model Manager
- Fix the preset so both Clip1 and Clip2 point to installed files
Example fix
// before
await vm.ApplyStep(args); // SelectedClip2 null -> throws
// after
if (vm.SelectedClip2 is null) { throw new ValidationException("Select Clip2 (e.g. clip_g) first"); }
await vm.ApplyStep(args); Defensive patterns
Strategy: validation
Validate before calling
if (vm.SelectedClip2 is null)
throw new ValidationException("Select Clip2 (e.g. clip_g or t5xxl) before generating"); Type guard
bool hasBothClips = vm.SelectedClip1 is not null && vm.SelectedClip2 is not null;
Try / catch
try { vm.ApplyStep(args); }
catch (ValidationException ex) when (ex.Message == "No Clip2 Selected") { /* prompt second CLIP selection */ } Prevention
- Remember dual-CLIP models need two encoder files
- Verify model-family switches reset both CLIP dropdowns
- Validate both CLIP paths exist on disk before generation
When it happens
Trigger: ApplyStep executed with SelectedClip2 == null when clipName2 is computed via SelectedClip2?.RelativePath ?? throw.
Common situations: User selected Clip1 but left Clip2 unset (only one text encoder downloaded); switching between model families left the second dropdown empty; preset references a removed Clip2 file.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/4cc063e1ee711d34.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Avalonia/ViewModels/Inference/UnetModelCardViewModel.cs:77
}
public void ApplyStep(ModuleApplyStepEventArgs e)
{
var checkpointLoader = e.Nodes.AddTypedNode(GetModelLoader(e, SelectedModel!, SelectedDType));
e.Builder.Connections.Base.Model = checkpointLoader.Output;
var vaeLoader = e.Nodes.AddTypedNode(
new ComfyNodeBuilder.VAELoader
{
Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.VAELoader)),
VaeName = SelectedVae?.RelativePath ?? throw new ValidationException("No VAE Selected"),
}
);
e.Builder.Connections.Base.VAE = vaeLoader.Output;
// DualCLIPLoader (GGUF variant can also load .safetensors, so any gguf pick routes there)
var clipName1 = SelectedClip1?.RelativePath ?? throw new ValidationException("No Clip1 Selected");
var clipName2 = SelectedClip2?.RelativePath ?? throw new ValidationException("No Clip2 Selected");
e.Builder.Connections.Base.Clip =
SelectedClip1 is { IsGguf: true } || SelectedClip2 is { IsGguf: true }
? e
.Nodes.AddTypedNode(
new ComfyNodeBuilder.DualCLIPLoaderGGUF
{
Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.DualCLIPLoaderGGUF)),
ClipName1 = clipName1,
ClipName2 = clipName2,
Type = "flux",
}
)
.Output
: e
.Nodes.AddTypedNode(
new ComfyNodeBuilder.DualCLIPLoader
{View on GitHub (pinned to af93d6ef57)