{"record":{"id":"5f09168a456db028","repo":"LykosAI/StabilityMatrix","slug":"comfyui-must-be-installed-to-use-swarmui","errorCode":null,"errorMessage":"ComfyUI must be installed to use SwarmUI","messagePattern":"ComfyUI must be installed to use SwarmUI","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/Packages/StableSwarm.cs","lineNumber":227,"sourceCode":"\n    public override async Task InstallPackage(\n        string installLocation,\n        InstalledPackage installedPackage,\n        InstallPackageOptions options,\n        IProgress<ProgressReport>? progress = null,\n        Action<ProcessOutput>? onConsoleOutput = null,\n        CancellationToken cancellationToken = default\n    )\n    {\n        progress?.Report(new ProgressReport(-1f, \"Installing SwarmUI...\", isIndeterminate: true));\n\n        var comfy = settingsManager.Settings.InstalledPackages.FirstOrDefault(x =>\n            x.PackageName is nameof(ComfyUI) or \"ComfyUI-Zluda\"\n        );\n\n        if (comfy == null)\n        {\n            throw new InvalidOperationException(\"ComfyUI must be installed to use SwarmUI\");\n        }\n\n        try\n        {\n            await prerequisiteHelper\n                .RunDotnet(\n                    [\n                        \"nuget\",\n                        \"add\",\n                        \"source\",\n                        \"https://api.nuget.org/v3/index.json\",\n                        \"--name\",\n                        \"\\\"NuGet official package source\\\"\",\n                    ],\n                    workingDirectory: installLocation,\n                    onProcessOutput: onConsoleOutput\n                )\n                .ConfigureAwait(false);","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/Packages/StableSwarm.cs#L209-L245","documentation":"StableSwarm.InstallPackage throws InvalidOperationException when no installed package named ComfyUI or ComfyUI-Zluda exists, because SwarmUI depends on a ComfyUI backend to function.","triggerScenarios":"Installing SwarmUI while the settings' InstalledPackages list contains no package whose PackageName is 'ComfyUI' or 'ComfyUI-Zluda'.","commonSituations":"User tries to install SwarmUI as their first package; ComfyUI was uninstalled earlier; ComfyUI installed under a different variant name not covered by the check.","solutions":["Install ComfyUI (or ComfyUI-Zluda) first, then install SwarmUI.","Reinstall ComfyUI if it was removed; the name must match exactly for the dependency check.","If using an alternative ComfyUI fork, install the standard ComfyUI package so the dependency resolves.","Check Settings > Installed Packages to confirm ComfyUI is actually present and not just downloaded."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"bool hasComfy = settingsManager.Settings.InstalledPackages\n    .Any(x => x.PackageName is nameof(ComfyUI) or \"ComfyUI-Zluda\");\nif (!hasComfy) { /* install ComfyUI first */ }","typeGuard":null,"tryCatchPattern":"try { await swarmPackage.InstallPackage(...); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"ComfyUI must be installed\"))\n{ OfferToInstallComfyUiFirst(); }","preventionTips":["Always install ComfyUI before SwarmUI","Avoid uninstalling ComfyUI while SwarmUI is present","Note the dependency check matches exact names ComfyUI / ComfyUI-Zluda"],"tags":["missing-dependency","comfyui","swarmui","install"],"backgroundTag":"missing-dependency","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"}