LykosAI/StabilityMatrix · error · ValidationException

No Clip3 Selected

Error message

No Clip3 Selected

What it means

Identical ValidationException backstop for the third CLIP slot in the 4-CLIP branch of ModelCardViewModel's workflow builder. The `SelectedClip3?.RelativePath ?? throw` fires if SelectedClip3 is null when the QuadCLIPLoaderGGUF node is being built, meaning no third CLIP model file was chosen.

Solutions

  1. Assign a valid CLIP model to the Clip3 slot before starting generation
  2. Ensure the model card expects a 3/4-encoder layout and populate all required CLIP slots
  3. Snapshot the SelectedClip3 value into a local before the guard to eliminate null re-evaluation races
  4. Pre-validate all SelectedClipN properties and surface a friendly UI message instead of an exception at build time

Example fix

// before
var clipName3 = SelectedClip3?.RelativePath ?? throw new ValidationException("No Clip3 Selected");
// after
var clip3 = SelectedClip3;
var clipName3 = clip3?.RelativePath ?? throw new ValidationException("Clip3 is required for this checkpoint - select a CLIP model in slot 3");
Defensive patterns

Strategy: validation

Validate before calling

if (SelectedClip3 is null or { IsNone: true })
    throw new ValidationException("Clip3 must be selected for this checkpoint");

Type guard

static bool HasClip(LazyFileReference? clip) => clip is { IsNone: false };

Try / catch

try
{
    await viewModel.BuildWorkspaceAsync(e);
}
catch (ValidationException ex) when (ex.Message.Contains("Clip3"))
{
    NotificationService.ShowPersistent("Missing CLIP 3", ex.Message, NotificationType.Error);
}

Prevention

When it happens

Trigger: Building the inference graph with SelectedClip3 null/unassigned while Clip1, Clip2, Clip4 are set; or the observable SelectedClip3 property mutating to null between the branch guard and the node construction.

Common situations: Checkpoints requiring three or four text encoders where the user fills only some slots; cleared or failed model downloads leaving a slot empty; state desync in the card view model after preset changes.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/7d2ce98f90a23ab9. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Avalonia/ViewModels/Inference/ModelCardViewModel.cs:1805

            e.Builder.Connections.PrimaryVAE = vaeLoader.Output;
        }
    }

    private void SetupClipLoaders(ModuleApplyStepEventArgs e)
    {
        // The GGUF loader variants can also load .safetensors encoders, so any gguf pick
        // routes the whole (possibly mixed) selection through the GGUF loader
        if (
            SelectedClip4 is { IsNone: false }
            && SelectedClip3 is { IsNone: false }
            && SelectedClip2 is { IsNone: false }
            && SelectedClip1 is { IsNone: false }
        )
        {
            var clipName1 = SelectedClip1?.RelativePath ?? throw new ValidationException("No Clip1 Selected");
            var clipName2 = SelectedClip2?.RelativePath ?? throw new ValidationException("No Clip2 Selected");
            var clipName3 = SelectedClip3?.RelativePath ?? throw new ValidationException("No Clip3 Selected");
            var clipName4 = SelectedClip4?.RelativePath ?? throw new ValidationException("No Clip4 Selected");

            e.Builder.Connections.Base.Clip = AnyClipIsGguf(
                SelectedClip1,
                SelectedClip2,
                SelectedClip3,
                SelectedClip4
            )
                ? e
                    .Nodes.AddTypedNode(
                        new ComfyNodeBuilder.QuadrupleCLIPLoaderGGUF
                        {
                            Name = e.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.QuadrupleCLIPLoaderGGUF)),
                            ClipName1 = clipName1,
                            ClipName2 = clipName2,
                            ClipName3 = clipName3,
                            ClipName4 = clipName4,
                        }

View on GitHub (pinned to af93d6ef57)