Skip to content

Commit 47033a3

Browse files
authored
Merge pull request LykosAI#1174 from ionite34/backport/main/pr-1173
[dev to main] backport: Fix swarm missing dotnet env vars, update civitai early access … (1173)
2 parents 7dbad7f + 3bf8ec6 commit 47033a3

File tree

18 files changed

+355
-88
lines changed

18 files changed

+355
-88
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.15.4
9+
### Changed
10+
- Updated Early Access indicators in the Civitai Details page to be more visible
11+
- Updated error message when attempting to download a website-generation-only model from Civitai
12+
- Updated nunchaku installer to 1.0.2
13+
- Updated Package Import dialog to have Python version selector
14+
### Fixed
15+
- Fixed [#1435](https://github.com/LykosAI/StabilityMatrix/issues/1435) - SwarmUI not launching due to missing dotnet
16+
- Fixed various install and Inference issues with ComfyUI-Zluda - big thanks to @neural_fault for the PRs!
17+
- Fixed sageattention version getting out of sync after torch updates in ComfyUI
18+
- Potentially fixed issue where uv-managed Python versions would not appear in the version selector
19+
### Supporters
20+
#### 🌟 Visionaries
21+
Our heartfelt thanks to the driving force behind our progress, our Visionaries: **Waterclouds**, **JungleDragon**, **bluepopsicle**, **Bob S**, and **whudunit**! Your incredible support is the fuel that powers our development, allowing us to tackle bugs and push forward with confidence.
22+
#### 🚀 Pioneers
23+
A huge shoutout to our amazing Pioneers, who keep the momentum going strong! Thank you for being our trusted crew on this journey: **Szir777**, **Noah M**, **USATechDude**, **Thom**, **SeraphOfSalem**, **Desert Viber**, **Tundra Everquill**, **Adam**, **Droolguy**, **Philip R.**, **ACTUALLY_the_Real_Willem_Dafoe**, **takyamtom**, and **robek**!
24+
825
## v2.15.3
926
### Changed
1027
- Updated fallback rocm index for InvokeAI to rocm6.3
@@ -21,7 +38,6 @@ Our deepest gratitude to our Visionaries for their foundational support: **Water
2138
#### 🚀 Pioneers
2239
A huge thank you to our incredible Pioneers for keeping the project on track! Your support is vital for these important refinement updates. Thank you to **Szir777**, **Noah M**, **USATechDude**, **Thom**, **SeraphOfSalem**, **Desert Viber**, **Tundra Everquill**, **Adam**, **Droolguy**, **Philip R.**, **ACTUALLY_the_Real_Willem_Dafoe**, **takyamtom**, and a warm welcome to our newest Pioneer, **robek**!
2340

24-
2541
## v2.15.2
2642
### Changed
2743
- Updated Avalonia to 11.3.7

StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ private bool IsPythonVersionInstalled(PyVersion version) =>
6060
private DirectoryPath NodeDir => AssetsDir.JoinDir("nodejs");
6161
private string NpmPath => Path.Combine(NodeDir, "bin", "npm");
6262
private bool IsNodeInstalled => File.Exists(NpmPath);
63-
64-
private DirectoryPath DotnetDir => AssetsDir.JoinDir("dotnet");
6563
private string DotnetPath => Path.Combine(DotnetDir, "dotnet");
6664
private string Dotnet7SdkExistsPath => Path.Combine(DotnetDir, "sdk", "7.0.405");
6765
private string Dotnet8SdkExistsPath => Path.Combine(DotnetDir, "sdk", "8.0.101");
@@ -77,13 +75,15 @@ private bool IsPythonVersionInstalled(PyVersion version) =>
7775
// Cached store of whether or not git is installed
7876
private bool? isGitInstalled;
7977

78+
private string ExpectedUvVersion => "0.8.4";
79+
8080
public bool IsVcBuildToolsInstalled => false;
8181
public bool IsHipSdkInstalled => false;
8282
private string UvDownloadPath => Path.Combine(AssetsDir, "uv.tar.gz");
8383
private string UvExtractPath => Path.Combine(AssetsDir, "uv");
8484
public string UvExePath => Path.Combine(UvExtractPath, "uv");
8585
public bool IsUvInstalled => File.Exists(UvExePath);
86-
private string ExpectedUvVersion => "0.8.4";
86+
public DirectoryPath DotnetDir => AssetsDir.JoinDir("dotnet");
8787

8888
// Helper method to get Python download URL for a specific version
8989
private RemoteResource GetPythonDownloadResource(PyVersion version)

StabilityMatrix.Avalonia/Helpers/WindowsPrerequisiteHelper.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ private string GetPythonLibraryZipPath(PyVersion version) =>
9393
private string NodeDownloadPath => Path.Combine(AssetsDir, "nodejs.zip");
9494
private string Dotnet7DownloadPath => Path.Combine(AssetsDir, "dotnet-sdk-7.0.405-win-x64.zip");
9595
private string Dotnet8DownloadPath => Path.Combine(AssetsDir, "dotnet-sdk-8.0.101-win-x64.zip");
96-
private string DotnetExtractPath => Path.Combine(AssetsDir, "dotnet");
97-
private string DotnetExistsPath => Path.Combine(DotnetExtractPath, "dotnet.exe");
98-
private string Dotnet7SdkExistsPath => Path.Combine(DotnetExtractPath, "sdk", "7.0.405");
99-
private string Dotnet8SdkExistsPath => Path.Combine(DotnetExtractPath, "sdk", "8.0.101");
96+
private string DotnetExistsPath => Path.Combine(DotnetDir, "dotnet.exe");
97+
private string Dotnet7SdkExistsPath => Path.Combine(DotnetDir, "sdk", "7.0.405");
98+
private string Dotnet8SdkExistsPath => Path.Combine(DotnetDir, "sdk", "8.0.101");
10099
private string VcBuildToolsDownloadPath => Path.Combine(AssetsDir, "vs_BuildTools.exe");
101100

102101
private string VcBuildToolsExistsPath =>
@@ -121,6 +120,7 @@ private string GetPythonLibraryZipPath(PyVersion version) =>
121120
public string GitBinPath => Path.Combine(PortableGitInstallDir, "bin");
122121
public bool IsVcBuildToolsInstalled => Directory.Exists(VcBuildToolsExistsPath);
123122
public bool IsHipSdkInstalled => Directory.Exists(HipInstalledPath);
123+
public DirectoryPath DotnetDir => Path.Combine(AssetsDir, "dotnet");
124124

125125
// Check if a specific Python version is installed
126126
public bool IsPythonVersionInstalled(PyVersion version) => File.Exists(GetPythonDllPath(version));
@@ -740,7 +740,7 @@ await DownloadAndExtractPrerequisite(
740740
progress,
741741
Dotnet7DownloadUrl,
742742
Dotnet7DownloadPath,
743-
DotnetExtractPath
743+
DotnetDir
744744
);
745745
}
746746

@@ -750,7 +750,7 @@ await DownloadAndExtractPrerequisite(
750750
progress,
751751
Dotnet8DownloadUrl,
752752
Dotnet8DownloadPath,
753-
DotnetExtractPath
753+
DotnetDir
754754
);
755755
}
756756
}
@@ -782,18 +782,18 @@ await downloadService.DownloadToFileAsync(
782782

783783
var process = ProcessRunner.StartAnsiProcess(
784784
VcBuildToolsDownloadPath,
785-
"--quiet --wait " +
786-
"--add Microsoft.VisualStudio.Workload.VCTools " +
787-
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 " +
788-
"--add Microsoft.VisualStudio.Component.VC.CMake.Project " +
789-
"--add Microsoft.VisualStudio.Component.VC.Llvm.Clang " +
790-
"--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang " +
791-
"--add Microsoft.VisualStudio.Component.Windows10SDK.18362 " +
792-
"--add Microsoft.VisualStudio.Component.Windows10SDK.19041 " +
793-
"--add Microsoft.VisualStudio.Component.Windows10SDK.20348 " +
794-
"--add Microsoft.VisualStudio.Component.Windows11SDK.22000 " +
795-
"--add Microsoft.VisualStudio.Component.Windows11SDK.22621 " +
796-
"--add Microsoft.VisualStudio.Component.Windows11SDK.26100",
785+
"--quiet --wait "
786+
+ "--add Microsoft.VisualStudio.Workload.VCTools "
787+
+ "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 "
788+
+ "--add Microsoft.VisualStudio.Component.VC.CMake.Project "
789+
+ "--add Microsoft.VisualStudio.Component.VC.Llvm.Clang "
790+
+ "--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang "
791+
+ "--add Microsoft.VisualStudio.Component.Windows10SDK.18362 "
792+
+ "--add Microsoft.VisualStudio.Component.Windows10SDK.19041 "
793+
+ "--add Microsoft.VisualStudio.Component.Windows10SDK.20348 "
794+
+ "--add Microsoft.VisualStudio.Component.Windows11SDK.22000 "
795+
+ "--add Microsoft.VisualStudio.Component.Windows11SDK.22621 "
796+
+ "--add Microsoft.VisualStudio.Component.Windows11SDK.26100",
797797
outputDataReceived: output =>
798798
progress?.Report(
799799
new ProgressReport(

StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CivitAiBrowserViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ protected override async Task OnInitialLoadedAsync()
359359

360360
public override async Task OnLoadedAsync()
361361
{
362+
if (Design.IsDesignMode)
363+
return;
364+
362365
var baseModels = await baseModelTypeService.GetBaseModelTypes(includeAllOption: false);
363366
baseModels = baseModels.Except(settingsManager.Settings.DisabledBaseModelTypes).ToList();
364367
if (baseModels.Count == 0)

StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CivitDetailsPageViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ IModelImportService modelImportService
109109
nameof(LastUpdated),
110110
nameof(ShortSha256),
111111
nameof(BaseModelType),
112-
nameof(ModelFileNameFormat)
112+
nameof(ModelFileNameFormat),
113+
nameof(IsEarlyAccess)
113114
)]
114115
public partial ModelVersionViewModel? SelectedVersion { get; set; }
115116

@@ -169,6 +170,8 @@ IModelImportService modelImportService
169170

170171
public string BaseModelType => SelectedVersion?.ModelVersion.BaseModel?.Trim() ?? string.Empty;
171172

173+
public bool IsEarlyAccess => SelectedVersion?.ModelVersion.IsEarlyAccess ?? false;
174+
172175
public string CivitUrl => $@"https://civitai.com/models/{CivitModel.Id}";
173176

174177
public int DescriptionRowSpan => string.IsNullOrWhiteSpace(ModelVersionDescription) ? 3 : 1;

StabilityMatrix.Avalonia/ViewModels/Dialogs/PackageImportViewModel.cs

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using StabilityMatrix.Avalonia.ViewModels.Base;
1515
using StabilityMatrix.Avalonia.Views.Dialogs;
1616
using StabilityMatrix.Core.Attributes;
17+
using StabilityMatrix.Core.Helper;
1718
using StabilityMatrix.Core.Helper.Factory;
1819
using StabilityMatrix.Core.Models;
1920
using StabilityMatrix.Core.Models.Database;
@@ -27,21 +28,22 @@ namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
2728
[View(typeof(PackageImportDialog))]
2829
[ManagedService]
2930
[RegisterTransient<PackageImportViewModel>]
30-
public partial class PackageImportViewModel : ContentDialogViewModelBase
31+
public partial class PackageImportViewModel(
32+
IPackageFactory packageFactory,
33+
ISettingsManager settingsManager,
34+
IPyInstallationManager pyInstallationManager
35+
) : ContentDialogViewModelBase
3136
{
3237
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
33-
34-
private readonly IPackageFactory packageFactory;
35-
private readonly ISettingsManager settingsManager;
38+
private bool venvDetected = false;
3639

3740
[ObservableProperty]
3841
private DirectoryPath? packagePath;
3942

4043
[ObservableProperty]
4144
private BasePackage? selectedBasePackage;
4245

43-
public IReadOnlyList<BasePackage> AvailablePackages =>
44-
packageFactory.GetAllAvailablePackages().ToImmutableArray();
46+
public IReadOnlyList<BasePackage> AvailablePackages => [.. packageFactory.GetAllAvailablePackages()];
4547

4648
[ObservableProperty]
4749
private PackageVersion? selectedVersion;
@@ -64,6 +66,9 @@ public partial class PackageImportViewModel : ContentDialogViewModelBase
6466
[ObservableProperty]
6567
private bool showCustomCommitSha;
6668

69+
[ObservableProperty]
70+
public partial bool ShowPythonVersionSelection { get; set; } = true;
71+
6772
// Version types (release or commit)
6873
[ObservableProperty]
6974
[NotifyPropertyChangedFor(nameof(ReleaseLabelText), nameof(IsReleaseMode), nameof(SelectedVersion))]
@@ -73,6 +78,13 @@ public partial class PackageImportViewModel : ContentDialogViewModelBase
7378
[NotifyPropertyChangedFor(nameof(IsReleaseModeAvailable))]
7479
private PackageVersionType availableVersionTypes =
7580
PackageVersionType.GithubRelease | PackageVersionType.Commit;
81+
82+
[ObservableProperty]
83+
public partial ObservableCollection<UvPythonInfo> AvailablePythonVersions { get; set; } = [];
84+
85+
[ObservableProperty]
86+
public partial UvPythonInfo? SelectedPythonVersion { get; set; }
87+
7688
public string ReleaseLabelText => IsReleaseMode ? "Version" : "Branch";
7789
public bool IsReleaseMode
7890
{
@@ -82,12 +94,6 @@ public bool IsReleaseMode
8294

8395
public bool IsReleaseModeAvailable => AvailableVersionTypes.HasFlag(PackageVersionType.GithubRelease);
8496

85-
public PackageImportViewModel(IPackageFactory packageFactory, ISettingsManager settingsManager)
86-
{
87-
this.packageFactory = packageFactory;
88-
this.settingsManager = settingsManager;
89-
}
90-
9197
public override async Task OnLoadedAsync()
9298
{
9399
SelectedBasePackage ??= AvailablePackages[0];
@@ -115,6 +121,24 @@ public override async Task OnLoadedAsync()
115121
);
116122
UpdateSelectedVersionToLatestMain();
117123
}
124+
125+
var pythonVersions = await pyInstallationManager.GetAllAvailablePythonsAsync();
126+
AvailablePythonVersions = new ObservableCollection<UvPythonInfo>(pythonVersions);
127+
128+
if (
129+
PackagePath is not null
130+
&& Utilities.TryGetPyVenvVersion(PackagePath.FullPath, out var venvPyVersion)
131+
)
132+
{
133+
var matchingVenvPy = AvailablePythonVersions.FirstOrDefault(x => x.Version == venvPyVersion);
134+
if (matchingVenvPy != default)
135+
{
136+
SelectedPythonVersion = matchingVenvPy;
137+
venvDetected = true;
138+
}
139+
}
140+
141+
SelectedPythonVersion ??= GetRecommendedPyVersion() ?? AvailablePythonVersions.LastOrDefault();
118142
}
119143
catch (Exception e)
120144
{
@@ -155,7 +179,7 @@ partial void OnSelectedVersionChanged(PackageVersion? value)
155179
if (commits is null || commits.Count == 0)
156180
return;
157181

158-
commits = [..commits, new GitCommit { Sha = "Custom..." }];
182+
commits = [.. commits, new GitCommit { Sha = "Custom..." }];
159183

160184
AvailableCommits = new ObservableCollection<GitCommit>(commits);
161185
SelectedCommit = AvailableCommits[0];
@@ -205,12 +229,18 @@ partial void OnSelectedBasePackageChanged(BasePackage? value)
205229
if (commits is null || commits.Count == 0)
206230
return;
207231

208-
commits = [..commits, new GitCommit { Sha = "Custom..." }];
232+
commits = [.. commits, new GitCommit { Sha = "Custom..." }];
209233

210234
AvailableCommits = new ObservableCollection<GitCommit>(commits);
211235
SelectedCommit = AvailableCommits[0];
212236
UpdateSelectedVersionToLatestMain();
213237
}
238+
239+
if (!venvDetected)
240+
{
241+
SelectedPythonVersion =
242+
GetRecommendedPyVersion() ?? AvailablePythonVersions.FirstOrDefault();
243+
}
214244
})
215245
.SafeFireAndForget();
216246
}
@@ -267,7 +297,9 @@ public async Task AddPackageWithCurrentInputs()
267297
LastUpdateCheck = DateTimeOffset.Now,
268298
PreferredTorchIndex = torchVersion,
269299
PreferredSharedFolderMethod = sharedFolderRecommendation,
270-
PythonVersion = PyInstallationManager.Python_3_10_11.StringValue
300+
PythonVersion =
301+
SelectedPythonVersion?.Version.StringValue
302+
?? PyInstallationManager.Python_3_10_17.StringValue,
271303
};
272304

273305
// Recreate venv if it's a BaseGitPackage
@@ -300,4 +332,10 @@ await gitPackage.SetupVenv(
300332

301333
settingsManager.Transaction(s => s.InstalledPackages.Add(package));
302334
}
335+
336+
private UvPythonInfo? GetRecommendedPyVersion() =>
337+
AvailablePythonVersions.LastOrDefault(x =>
338+
x.Version.Major.Equals(SelectedBasePackage?.RecommendedPythonVersion.Major)
339+
&& x.Version.Minor.Equals(SelectedBasePackage?.RecommendedPythonVersion.Minor)
340+
);
303341
}

StabilityMatrix.Avalonia/ViewModels/Progress/ProgressManagerViewModel.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,24 @@ exception is HuggingFaceLoginRequiredException
145145
ShowHuggingFaceLoginRequiredDialog();
146146
return;
147147
}
148+
else if (
149+
exception is CivitDownloadDisabledException
150+
|| exception.InnerException is CivitDownloadDisabledException
151+
)
152+
{
153+
Dispatcher.UIThread.InvokeAsync(async () =>
154+
await notificationService.ShowPersistentAsync(
155+
NotificationKey.Download_Failed,
156+
new Notification
157+
{
158+
Title = "Download Disabled",
159+
Body =
160+
$"The creator of {e.FileName} has disabled downloads on this file",
161+
}
162+
)
163+
);
164+
return;
165+
}
148166
}
149167

150168
Dispatcher.UIThread.InvokeAsync(async () =>

StabilityMatrix.Avalonia/Views/CivitDetailsPage.axaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,9 @@
268268
Margin="0,2,8,0"
269269
HorizontalAlignment="Left"
270270
VerticalAlignment="Center"
271-
Foreground="Orange"
272271
IsVisible="{Binding ModelVersion.IsEarlyAccess}"
273272
ToolTip.Tip="Early Access"
274-
Value="fa-regular fa-credit-card" />
273+
Value="fa-solid fa-coins" />
275274
<TextBlock
276275
Grid.Column="1"
277276
VerticalAlignment="Center"
@@ -395,10 +394,18 @@
395394
Padding="12"
396395
VerticalAlignment="Top">
397396
<StackPanel Spacing="8">
398-
<TextBlock
399-
FontSize="20"
400-
FontWeight="Light"
401-
Text="{x:Static lang:Resources.Label_Details}" />
397+
<avalonia1:SpacedGrid ColumnDefinitions="*, *">
398+
<TextBlock
399+
FontSize="20"
400+
FontWeight="Light"
401+
Text="{x:Static lang:Resources.Label_Details}" />
402+
<Label
403+
Grid.Column="1"
404+
Classes="Circle Solid Red"
405+
Content="Early Access"
406+
IsVisible="{Binding IsEarlyAccess}"
407+
Theme="{StaticResource TagLabel}" />
408+
</avalonia1:SpacedGrid>
402409
<Separator Margin="0" />
403410
<avalonia1:SpacedGrid ColumnDefinitions="*,*" RowDefinitions="*,Auto,*,Auto,*,Auto,*,Auto,*">
404411
<TextBlock

0 commit comments

Comments
 (0)