LykosAI/StabilityMatrix · error · ValidationException

No Clip1 Selected

Error message

No Clip1 Selected

What it means

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.

Solutions

  1. Select the first CLIP file (e.g. clip_l.safetensors) in the Clip1 dropdown
  2. Download the required text-encoder files via Model Manager if missing
  3. Update the saved preset to reference installed CLIP files

Example fix

// before
await vm.ApplyStep(args); // SelectedClip1 null -> throws
// after
if (vm.SelectedClip1 is null || vm.SelectedClip2 is null)
    throw new ValidationException("Select both CLIP models first");
await vm.ApplyStep(args);
Defensive patterns

Strategy: validation

Validate before calling

if (vm.SelectedClip1 is null)
    throw new ValidationException("Select Clip1 (e.g. clip_l) before generating");

Type guard

bool hasClip1 = vm.SelectedClip1 is not null;

Try / catch

try { vm.ApplyStep(args); }
catch (ValidationException ex) when (ex.Message == "No Clip1 Selected") { /* prompt CLIP selection */ }

Prevention

When it happens

Trigger: ApplyStep executed with SelectedClip1 == null when clipName1 is computed via SelectedClip1?.RelativePath ?? throw.

Common situations: 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.

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/be3d33276bc0462a. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Avalonia/ViewModels/Inference/UnetModelCardViewModel.cs:76

        return false;
    }

    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)