Skip to content
Merged

v2.15.4 #1449

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ All notable changes to Stability Matrix will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).

## v2.15.4
### Changed
- Updated Early Access indicators in the Civitai Details page to be more visible
- Updated error message when attempting to download a website-generation-only model from Civitai
- Updated nunchaku installer to 1.0.2
- Updated Package Import dialog to have Python version selector
### Fixed
- Fixed [#1435](https://github.com/LykosAI/StabilityMatrix/issues/1435) - SwarmUI not launching due to missing dotnet
- Fixed various install and Inference issues with ComfyUI-Zluda - big thanks to @neural_fault for the PRs!
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There seems to be a typo in the contributor's username. The pull request description mentions @NeuralFault, but the changelog has @neural_fault. For consistency and to ensure proper credit, it would be best to use the casing from the PR description.

Suggested change
- Fixed various install and Inference issues with ComfyUI-Zluda - big thanks to @neural_fault for the PRs!
- Fixed various install and Inference issues with ComfyUI-Zluda - big thanks to @NeuralFault for the PRs!

- Fixed sageattention version getting out of sync after torch updates in ComfyUI
- Potentially fixed issue where uv-managed Python versions would not appear in the version selector
### Supporters
#### 🌟 Visionaries
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.
#### 🚀 Pioneers
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**!

## v2.15.3
### Changed
- Updated fallback rocm index for InvokeAI to rocm6.3
Expand All @@ -21,7 +38,6 @@ Our deepest gratitude to our Visionaries for their foundational support: **Water
#### 🚀 Pioneers
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**!


## v2.15.2
### Changed
- Updated Avalonia to 11.3.7
Expand Down
6 changes: 3 additions & 3 deletions StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ private bool IsPythonVersionInstalled(PyVersion version) =>
private DirectoryPath NodeDir => AssetsDir.JoinDir("nodejs");
private string NpmPath => Path.Combine(NodeDir, "bin", "npm");
private bool IsNodeInstalled => File.Exists(NpmPath);

private DirectoryPath DotnetDir => AssetsDir.JoinDir("dotnet");
private string DotnetPath => Path.Combine(DotnetDir, "dotnet");
private string Dotnet7SdkExistsPath => Path.Combine(DotnetDir, "sdk", "7.0.405");
private string Dotnet8SdkExistsPath => Path.Combine(DotnetDir, "sdk", "8.0.101");
Expand All @@ -77,13 +75,15 @@ private bool IsPythonVersionInstalled(PyVersion version) =>
// Cached store of whether or not git is installed
private bool? isGitInstalled;

private string ExpectedUvVersion => "0.8.4";

public bool IsVcBuildToolsInstalled => false;
public bool IsHipSdkInstalled => false;
private string UvDownloadPath => Path.Combine(AssetsDir, "uv.tar.gz");
private string UvExtractPath => Path.Combine(AssetsDir, "uv");
public string UvExePath => Path.Combine(UvExtractPath, "uv");
public bool IsUvInstalled => File.Exists(UvExePath);
private string ExpectedUvVersion => "0.8.4";
public DirectoryPath DotnetDir => AssetsDir.JoinDir("dotnet");

// Helper method to get Python download URL for a specific version
private RemoteResource GetPythonDownloadResource(PyVersion version)
Expand Down
36 changes: 18 additions & 18 deletions StabilityMatrix.Avalonia/Helpers/WindowsPrerequisiteHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ private string GetPythonLibraryZipPath(PyVersion version) =>
private string NodeDownloadPath => Path.Combine(AssetsDir, "nodejs.zip");
private string Dotnet7DownloadPath => Path.Combine(AssetsDir, "dotnet-sdk-7.0.405-win-x64.zip");
private string Dotnet8DownloadPath => Path.Combine(AssetsDir, "dotnet-sdk-8.0.101-win-x64.zip");
private string DotnetExtractPath => Path.Combine(AssetsDir, "dotnet");
private string DotnetExistsPath => Path.Combine(DotnetExtractPath, "dotnet.exe");
private string Dotnet7SdkExistsPath => Path.Combine(DotnetExtractPath, "sdk", "7.0.405");
private string Dotnet8SdkExistsPath => Path.Combine(DotnetExtractPath, "sdk", "8.0.101");
private string DotnetExistsPath => Path.Combine(DotnetDir, "dotnet.exe");
private string Dotnet7SdkExistsPath => Path.Combine(DotnetDir, "sdk", "7.0.405");
private string Dotnet8SdkExistsPath => Path.Combine(DotnetDir, "sdk", "8.0.101");
private string VcBuildToolsDownloadPath => Path.Combine(AssetsDir, "vs_BuildTools.exe");

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

// Check if a specific Python version is installed
public bool IsPythonVersionInstalled(PyVersion version) => File.Exists(GetPythonDllPath(version));
Expand Down Expand Up @@ -740,7 +740,7 @@ await DownloadAndExtractPrerequisite(
progress,
Dotnet7DownloadUrl,
Dotnet7DownloadPath,
DotnetExtractPath
DotnetDir
);
}

Expand All @@ -750,7 +750,7 @@ await DownloadAndExtractPrerequisite(
progress,
Dotnet8DownloadUrl,
Dotnet8DownloadPath,
DotnetExtractPath
DotnetDir
);
}
}
Expand Down Expand Up @@ -782,18 +782,18 @@ await downloadService.DownloadToFileAsync(

var process = ProcessRunner.StartAnsiProcess(
VcBuildToolsDownloadPath,
"--quiet --wait " +
"--add Microsoft.VisualStudio.Workload.VCTools " +
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 " +
"--add Microsoft.VisualStudio.Component.VC.CMake.Project " +
"--add Microsoft.VisualStudio.Component.VC.Llvm.Clang " +
"--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang " +
"--add Microsoft.VisualStudio.Component.Windows10SDK.18362 " +
"--add Microsoft.VisualStudio.Component.Windows10SDK.19041 " +
"--add Microsoft.VisualStudio.Component.Windows10SDK.20348 " +
"--add Microsoft.VisualStudio.Component.Windows11SDK.22000 " +
"--add Microsoft.VisualStudio.Component.Windows11SDK.22621 " +
"--add Microsoft.VisualStudio.Component.Windows11SDK.26100",
"--quiet --wait "
+ "--add Microsoft.VisualStudio.Workload.VCTools "
+ "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 "
+ "--add Microsoft.VisualStudio.Component.VC.CMake.Project "
+ "--add Microsoft.VisualStudio.Component.VC.Llvm.Clang "
+ "--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang "
+ "--add Microsoft.VisualStudio.Component.Windows10SDK.18362 "
+ "--add Microsoft.VisualStudio.Component.Windows10SDK.19041 "
+ "--add Microsoft.VisualStudio.Component.Windows10SDK.20348 "
+ "--add Microsoft.VisualStudio.Component.Windows11SDK.22000 "
+ "--add Microsoft.VisualStudio.Component.Windows11SDK.22621 "
+ "--add Microsoft.VisualStudio.Component.Windows11SDK.26100",
outputDataReceived: output =>
progress?.Report(
new ProgressReport(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ protected override async Task OnInitialLoadedAsync()

public override async Task OnLoadedAsync()
{
if (Design.IsDesignMode)
return;

var baseModels = await baseModelTypeService.GetBaseModelTypes(includeAllOption: false);
baseModels = baseModels.Except(settingsManager.Settings.DisabledBaseModelTypes).ToList();
if (baseModels.Count == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ IModelImportService modelImportService
nameof(LastUpdated),
nameof(ShortSha256),
nameof(BaseModelType),
nameof(ModelFileNameFormat)
nameof(ModelFileNameFormat),
nameof(IsEarlyAccess)
)]
public partial ModelVersionViewModel? SelectedVersion { get; set; }

Expand Down Expand Up @@ -169,6 +170,8 @@ IModelImportService modelImportService

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

public bool IsEarlyAccess => SelectedVersion?.ModelVersion.IsEarlyAccess ?? false;

public string CivitUrl => $@"https://civitai.com/models/{CivitModel.Id}";

public int DescriptionRowSpan => string.IsNullOrWhiteSpace(ModelVersionDescription) ? 3 : 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using StabilityMatrix.Avalonia.ViewModels.Base;
using StabilityMatrix.Avalonia.Views.Dialogs;
using StabilityMatrix.Core.Attributes;
using StabilityMatrix.Core.Helper;
using StabilityMatrix.Core.Helper.Factory;
using StabilityMatrix.Core.Models;
using StabilityMatrix.Core.Models.Database;
Expand All @@ -27,21 +28,22 @@ namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
[View(typeof(PackageImportDialog))]
[ManagedService]
[RegisterTransient<PackageImportViewModel>]
public partial class PackageImportViewModel : ContentDialogViewModelBase
public partial class PackageImportViewModel(
IPackageFactory packageFactory,
ISettingsManager settingsManager,
IPyInstallationManager pyInstallationManager
) : ContentDialogViewModelBase
{
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();

private readonly IPackageFactory packageFactory;
private readonly ISettingsManager settingsManager;
private bool venvDetected = false;

[ObservableProperty]
private DirectoryPath? packagePath;

[ObservableProperty]
private BasePackage? selectedBasePackage;

public IReadOnlyList<BasePackage> AvailablePackages =>
packageFactory.GetAllAvailablePackages().ToImmutableArray();
public IReadOnlyList<BasePackage> AvailablePackages => [.. packageFactory.GetAllAvailablePackages()];

[ObservableProperty]
private PackageVersion? selectedVersion;
Expand All @@ -64,6 +66,9 @@ public partial class PackageImportViewModel : ContentDialogViewModelBase
[ObservableProperty]
private bool showCustomCommitSha;

[ObservableProperty]
public partial bool ShowPythonVersionSelection { get; set; } = true;

// Version types (release or commit)
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(ReleaseLabelText), nameof(IsReleaseMode), nameof(SelectedVersion))]
Expand All @@ -73,6 +78,13 @@ public partial class PackageImportViewModel : ContentDialogViewModelBase
[NotifyPropertyChangedFor(nameof(IsReleaseModeAvailable))]
private PackageVersionType availableVersionTypes =
PackageVersionType.GithubRelease | PackageVersionType.Commit;

[ObservableProperty]
public partial ObservableCollection<UvPythonInfo> AvailablePythonVersions { get; set; } = [];

[ObservableProperty]
public partial UvPythonInfo? SelectedPythonVersion { get; set; }

public string ReleaseLabelText => IsReleaseMode ? "Version" : "Branch";
public bool IsReleaseMode
{
Expand All @@ -82,12 +94,6 @@ public bool IsReleaseMode

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

public PackageImportViewModel(IPackageFactory packageFactory, ISettingsManager settingsManager)
{
this.packageFactory = packageFactory;
this.settingsManager = settingsManager;
}

public override async Task OnLoadedAsync()
{
SelectedBasePackage ??= AvailablePackages[0];
Expand Down Expand Up @@ -115,6 +121,24 @@ public override async Task OnLoadedAsync()
);
UpdateSelectedVersionToLatestMain();
}

var pythonVersions = await pyInstallationManager.GetAllAvailablePythonsAsync();
AvailablePythonVersions = new ObservableCollection<UvPythonInfo>(pythonVersions);

if (
PackagePath is not null
&& Utilities.TryGetPyVenvVersion(PackagePath.FullPath, out var venvPyVersion)
)
{
var matchingVenvPy = AvailablePythonVersions.FirstOrDefault(x => x.Version == venvPyVersion);
if (matchingVenvPy != default)
{
SelectedPythonVersion = matchingVenvPy;
venvDetected = true;
}
}

SelectedPythonVersion ??= GetRecommendedPyVersion() ?? AvailablePythonVersions.LastOrDefault();
}
catch (Exception e)
{
Expand Down Expand Up @@ -155,7 +179,7 @@ partial void OnSelectedVersionChanged(PackageVersion? value)
if (commits is null || commits.Count == 0)
return;

commits = [..commits, new GitCommit { Sha = "Custom..." }];
commits = [.. commits, new GitCommit { Sha = "Custom..." }];

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

commits = [..commits, new GitCommit { Sha = "Custom..." }];
commits = [.. commits, new GitCommit { Sha = "Custom..." }];

AvailableCommits = new ObservableCollection<GitCommit>(commits);
SelectedCommit = AvailableCommits[0];
UpdateSelectedVersionToLatestMain();
}

if (!venvDetected)
{
SelectedPythonVersion =
GetRecommendedPyVersion() ?? AvailablePythonVersions.FirstOrDefault();
Comment on lines +241 to +242
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a small inconsistency in the fallback logic for selecting a Python version. Here, FirstOrDefault() is used, while OnLoadedAsync uses LastOrDefault(). Using LastOrDefault() is preferable as it will select the latest available patch version of Python if a recommended version isn't found. For consistency and to provide a better default, I suggest using LastOrDefault() here as well.

                    SelectedPythonVersion =
                        GetRecommendedPyVersion() ?? AvailablePythonVersions.LastOrDefault();

}
})
.SafeFireAndForget();
}
Expand Down Expand Up @@ -267,7 +297,9 @@ public async Task AddPackageWithCurrentInputs()
LastUpdateCheck = DateTimeOffset.Now,
PreferredTorchIndex = torchVersion,
PreferredSharedFolderMethod = sharedFolderRecommendation,
PythonVersion = PyInstallationManager.Python_3_10_11.StringValue
PythonVersion =
SelectedPythonVersion?.Version.StringValue
?? PyInstallationManager.Python_3_10_17.StringValue,
};

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

settingsManager.Transaction(s => s.InstalledPackages.Add(package));
}

private UvPythonInfo? GetRecommendedPyVersion() =>
AvailablePythonVersions.LastOrDefault(x =>
x.Version.Major.Equals(SelectedBasePackage?.RecommendedPythonVersion.Major)
&& x.Version.Minor.Equals(SelectedBasePackage?.RecommendedPythonVersion.Minor)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ exception is HuggingFaceLoginRequiredException
ShowHuggingFaceLoginRequiredDialog();
return;
}
else if (
exception is CivitDownloadDisabledException
|| exception.InnerException is CivitDownloadDisabledException
)
{
Dispatcher.UIThread.InvokeAsync(async () =>
await notificationService.ShowPersistentAsync(
NotificationKey.Download_Failed,
new Notification
{
Title = "Download Disabled",
Body =
$"The creator of {e.FileName} has disabled downloads on this file",
}
)
);
return;
}
}

Dispatcher.UIThread.InvokeAsync(async () =>
Expand Down
19 changes: 13 additions & 6 deletions StabilityMatrix.Avalonia/Views/CivitDetailsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,9 @@
Margin="0,2,8,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="Orange"
IsVisible="{Binding ModelVersion.IsEarlyAccess}"
ToolTip.Tip="Early Access"
Value="fa-regular fa-credit-card" />
Value="fa-solid fa-coins" />
<TextBlock
Grid.Column="1"
VerticalAlignment="Center"
Expand Down Expand Up @@ -395,10 +394,18 @@
Padding="12"
VerticalAlignment="Top">
<StackPanel Spacing="8">
<TextBlock
FontSize="20"
FontWeight="Light"
Text="{x:Static lang:Resources.Label_Details}" />
<avalonia1:SpacedGrid ColumnDefinitions="*, *">
<TextBlock
FontSize="20"
FontWeight="Light"
Text="{x:Static lang:Resources.Label_Details}" />
<Label
Grid.Column="1"
Classes="Circle Solid Red"
Content="Early Access"
IsVisible="{Binding IsEarlyAccess}"
Theme="{StaticResource TagLabel}" />
</avalonia1:SpacedGrid>
<Separator Margin="0" />
<avalonia1:SpacedGrid ColumnDefinitions="*,*" RowDefinitions="*,Auto,*,Auto,*,Auto,*,Auto,*">
<TextBlock
Expand Down
Loading
Loading