{"record":{"id":"ac5f808efdbeab95","repo":"LykosAI/StabilityMatrix","slug":"no-bboxmodel","errorCode":null,"errorMessage":"No BboxModel","messagePattern":"No BboxModel","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/ViewModels/Inference/Modules/FaceDetailerModule.cs","lineNumber":61,"sourceCode":"            vm.IncludeCategories = [\"Settings\"];\n        });\n\n        await gridVm.GetDialog().ShowAsync();\n    }\n\n    protected override void OnApplyStep(ModuleApplyStepEventArgs e)\n    {\n        var faceDetailerCard = GetCard<FaceDetailerViewModel>();\n        if (faceDetailerCard is { InheritSeed: false, SeedCardViewModel.IsRandomizeEnabled: true })\n        {\n            faceDetailerCard.SeedCardViewModel.GenerateNewSeed();\n        }\n\n        var bboxLoader = new ComfyNodeBuilder.UltralyticsDetectorProvider\n        {\n            Name = e.Builder.Nodes.GetUniqueName(nameof(ComfyNodeBuilder.UltralyticsDetectorProvider)),\n            ModelName =\n                GetModelName(faceDetailerCard.BboxModel) ?? throw new ArgumentException(\"No BboxModel\"),\n        };\n\n        var samplerName =\n            (\n                faceDetailerCard.IsSamplerSelectionEnabled\n                    ? faceDetailerCard.Sampler?.Name\n                    : e.Builder.Connections.PrimarySampler?.Name\n            ) ?? throw new ArgumentException(\"No PrimarySampler\");\n\n        var schedulerName =\n            (\n                faceDetailerCard.IsSchedulerSelectionEnabled\n                    ? faceDetailerCard.Scheduler?.Name\n                    : e.Builder.Connections.PrimaryScheduler?.Name\n            ) ?? throw new ArgumentException(\"No PrimaryScheduler\");\n\n        if (schedulerName == \"align_your_steps\")\n        {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/Inference/Modules/FaceDetailerModule.cs#L43-L79","documentation":"FaceDetailerModule.OnApplyStep throws this ArgumentException when building the UltralyticsDetectorProvider node: GetModelName(faceDetailerCard.BboxModel) returned null, meaning no bbox/face-detection model (e.g. a face_yolov8 or GroundingDINO ultralytics detector) is selected. Unlike the ValidationException siblings, this uses ArgumentException but signals the same missing-selection condition.","triggerScenarios":"Including a FaceDetailer module whose card's BboxModel field is unset (or points to a model the resolver cannot name) when ApplyStep builds the workflow.","commonSituations":"User enables FaceDetailer but leaves the bbox detector dropdown empty; ultralytics/seg detector models (bbox/segm/sam) were never downloaded into ComfyUI's models/ultralytics folder; the previously selected detector file was removed so the selection is stale/null.","solutions":["Select a bbox detection model (e.g. bbox/face_yolov8m.pt) in the FaceDetailer card before generating.","Download the required ultralytics detector model into the ComfyUI models/ultralytics directory so it appears in the selector.","Programmatically set faceDetailerCard.BboxModel to a valid installed model file.","Also verify SamModel/SegmModel selections, which the same module validates similarly."],"exampleFix":"// before\nfaceDetailerCard.IsEnabled = true; // BboxModel null\nawait vm.Generate(); // ArgumentException\n// after\nfaceDetailerCard.IsEnabled = true;\nfaceDetailerCard.BboxModel = bboxDetectorFile; // installed ultralytics model\nawait vm.Generate();","handlingStrategy":"validation","validationCode":"if (faceDetailerCard.BboxModel is null)\n    throw new InvalidOperationException(\"FaceDetailer requires a bbox detection model\");","typeGuard":"var hasBbox = faceDetailerCard.BboxModel is not null && !string.IsNullOrEmpty(faceDetailerCard.BboxModel.RelativePath);","tryCatchPattern":"try { await vm.Generate(); }\ncatch (ArgumentException ex) when (ex.Message == \"No BboxModel\")\n{\n    // prompt user to select/install an ultralytics bbox detector\n}","preventionTips":["Install the required ultralytics detector models before enabling FaceDetailer.","Require bbox (and optionally segm/sam) selections before generation.","Catch this as ArgumentException, not ValidationException, in catch filters."],"tags":["validation","comfyui","facedetailer","missing-model"],"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"}