Skip to content
Merged

v2.13.4 #1180

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6215a58
Merge pull request #980 from ionite34/fix-model-overwrite
mohnjiles Feb 4, 2025
c3226b0
chagenlog
mohnjiles Feb 6, 2025
7c623ae
fix conflicts
mohnjiles Feb 6, 2025
c7b232f
Remove dev stuff
mohnjiles Feb 6, 2025
3580b25
Merge pull request #981 from ionite34/backport/main/pr-980
mohnjiles Feb 6, 2025
0af6218
Merge pull request #982 from ionite34/fix-model-download-locations
mohnjiles Feb 8, 2025
1c841b8
chagenlog
mohnjiles Feb 8, 2025
207e6c6
Merge pull request #983 from ionite34/backport/main/pr-982
mohnjiles Feb 8, 2025
83043e6
Merge pull request #984 from ionite34/blackwell-support
mohnjiles Feb 20, 2025
bc24742
fix chagenlog
mohnjiles Feb 21, 2025
d79e3fc
Merge pull request #985 from ionite34/backport/main/pr-984
mohnjiles Feb 21, 2025
5d050d3
Merge pull request #986 from ionite34/issue-fixes
mohnjiles Feb 22, 2025
e60a471
Merge pull request #988 from ionite34/backport/main/pr-986
mohnjiles Feb 22, 2025
b4632c3
Merge pull request #979 from ionite34/openid
ionite34 Feb 22, 2025
a1a4804
Fix conflict
ionite34 Feb 27, 2025
ca34b32
Fix Merge
ionite34 Feb 27, 2025
81de359
Fix conflict
ionite34 Feb 27, 2025
7677137
fix conflict
mohnjiles Feb 27, 2025
1940b0d
Merge pull request #991 from ionite34/backport/main/pr-979
mohnjiles Feb 27, 2025
f91ad63
Merge pull request #992 from ionite34/fix-patreon-disconnect
ionite34 Mar 2, 2025
f6513d4
Merge pull request #993 from ionite34/fixes-n-stuf
mohnjiles Mar 2, 2025
29b2a11
fix merge conflict
mohnjiles Mar 2, 2025
b07e4ad
fix chagenlog
mohnjiles Mar 2, 2025
8b5fde1
Merge pull request #994 from ionite34/backport/main/pr-992
ionite34 Mar 2, 2025
ee005c0
Merge branch 'main' into backport/main/pr-993
mohnjiles Mar 2, 2025
e7c15ed
Merge pull request #996 from ionite34/more-blackwell-updates
mohnjiles Mar 3, 2025
8351c03
Merge pull request #995 from ionite34/backport/main/pr-993
mohnjiles Mar 3, 2025
b346754
Merge branch 'main' into backport/main/pr-996
mohnjiles Mar 3, 2025
3fe3df8
Merge pull request #997 from ionite34/backport/main/pr-996
mohnjiles Mar 3, 2025
3b4264d
Merge pull request #1003 from ionite34/fix-updater
mohnjiles Mar 6, 2025
a1a08be
Merge pull request #1004 from ionite34/backport/main/pr-1003
mohnjiles Mar 6, 2025
3efa4b7
shoutout chagenlog
mohnjiles Mar 7, 2025
824b1f4
Merge pull request #1005 from ionite34/shoutout-chagenlog
mohnjiles Mar 7, 2025
0d7f50d
Merge branch 'LykosAI:main' into main
mohnjiles Mar 8, 2025
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
7 changes: 7 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
],
"rollForward": false
},
"refitter": {
"version": "1.4.1",
"commands": [
"refitter"
],
"rollForward": false
},
"dotnet-script": {
"version": "1.6.0",
"commands": [
Expand Down
6 changes: 6 additions & 0 deletions .husky/task-runner.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"command": "dotnet",
"args": [ "xstyler", "-f", "${staged}" ],
"include": [ "**/*.axaml" ]
},
{
"name": "Run refitter for LykosAuthApi",
"group": "generate-openapi",
"command": "dotnet",
"args": ["refitter", "--settings-file", "./StabilityMatrix.Core/Api/LykosAuthApi/.refitter"]
}
]
}
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,32 @@ 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.13.4
### Added
- Added support for RTX 5000-series GPUs in ComfyUI, Forge, and reForge
- Added "Rebuild .NET Project" command to SwarmUI installs - available via the 3-dots menu -> Package Commands -> Rebuild .NET Project
### Changed
- Upgraded ComfyUI CUDA torch to 12.6
- Upgraded Lykos account connection to use OAuth 2.0 device flow
- (Internal) Updated Avalonia to 11.2.5
### Fixed
- Fixed [#1128](https://github.com/LykosAI/StabilityMatrix/issues/1128) - overwriting models when downloading multiple with the same name
- Fixed ROCm torch indexes for ComfyUI & Forge
- Fixed model browser sometimes downloading to `ModelsLora` or `ModelsStableDiffusion` folders instead of the correct folder
- Fixed incorrect Unet folder path for ComfyUI users on Linux/macOS
- Fixed [#1157](https://github.com/LykosAI/StabilityMatrix/issues/1157) - crash when broken symlinks exist in model directories
- Fixed [#1154](https://github.com/LykosAI/StabilityMatrix/issues/1154) - increased width for package name on the package cards
- Fixed ComfyUI-Zluda not being recognized as an option for Inference or SwarmUI
- Fixed SwarmUI showing Python options in the 3-dots menu
- Fixed SD.Next install failures in certain cases when using Zluda
### Supporters
#### Visionaries
- Huge thanks to our amazing Visionary-tier Patrons, **Waterclouds** and **Corey T**! We're truly grateful for your continued generosity and support!
#### Pioneers
- Special appreciation to our fantastic Pioneer-tier Patrons: **tankfox**, **Mr. Unknown**, **Szir777**, **Tigon**, **NowFallenAngel**, and our newest addition, **Al Gorithm**! Thank you all for your incredible commitment and ongoing encouragement!

## v2.13.3
### Added
- Added Safetensor Metadata viewer to the Checkpoint Manager context menu - thanks to @genteure!
### Changed
- "Remove symbolic links on shutdown" option now also removes links from Output Sharing
### Fixed
Expand Down
48 changes: 46 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@
# Stability Matrix Code Style Guidelines
# Building
## Running & Debug
- If building using managed IDEs like Rider or Visual Studio, ensure that a valid `--runtime ...` argument is being passed to `dotnet`, or `RuntimeIdentifier=...` is set for calling `msbuild`. This is required for runtime-specific resources to be included in the build. Stability Matrix currently supports building for the `win-x64`, `linux-x64` and `osx-arm64` runtimes.
- You can also build the `StabilityMatrix.Avalonia` project using `dotnet`:
```bash
dotnet build ./StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj -r win-x64 -c Debug
```
- Note that on Windows, the `net8.0-windows10.0.17763.0` framework is used, build outputs will be in `StabilityMatrix.Avalonia/bin/Debug/net8.0-windows10.0.17763.0/win-x64`. On other platforms the `net8.0` framework is used.

## Building to single file for release
(Replace `$RELEASE_VERSION` with a non v-prefixed semver version number, e.g. `2.10.0`, `2.11.0-dev.1`, etc.)
### Windows
```bash
dotnet publish ./StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj -r win-x64 -c Release -p:Version=$env:RELEASE_VERSION -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=true
```
### macOS
The `output_dir` environment variable can be specified or defaults to `./out/osx-arm64/`
```bash
./Build/build_macos_app.sh -v $RELEASE_VERSION
```
### Linux
```bash
sudo apt-get -y install libfuse2
dotnet tool install -g KuiperZone.PupNet
pupnet -r linux-x64 -c Release --kind appimage --app-version $RELEASE_VERSION --clean
```

# Scripts
## Install Husky.Net & Pre-commit hooks
- Building the `StabilityMatrix.Avalonia` project once should also install Husky.Net, or run the following command:
```bash
dotnet tool restore && dotnet husky install
```
## Adding Husky pre-commit hooks
```bash
dotnet husky install
```
## Generated OpenApi clients
- Refitter is used to generate some OpenApi clients. New clients should be added to `./.husky/task-runner.json`.
- To regenerate clients, run the following command:
```bash
dotnet husky run -g generate-openapi
```

# Style Guidelines
These are just guidelines, mostly following the official C# style guidelines, except in a few cases. We might not adhere to these 100% ourselves, but lets try our best :)

## Naming conventions
Expand Down Expand Up @@ -47,4 +91,4 @@ if (alreadyAteLunch)
- Mock data for XAML Designer should go in `DesignData\`
- The `Helper\` and `Services\` folder don't really have guidelines, use your best judgment
- XAML & JSON converters should go in the `Converters\` and `Converters\Json\` directories respectively
- Refit interfaces should go in the `Api\` folder
- Refit interfaces should go in the `Api\` folder
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<AvaloniaVersion>11.2.2</AvaloniaVersion>
<AvaloniaVersion>11.2.5</AvaloniaVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
<PackageVersion Include="Octokit" Version="13.0.1" />
<PackageVersion Include="OneOf" Version="3.0.271" />
<PackageVersion Include="OneOf.SourceGenerator" Version="3.0.271" />
<PackageVersion Include="OpenIddict.Client" Version="5.8.0" />
<PackageVersion Include="OpenIddict.Client.SystemNetHttp" Version="5.8.0" />
<PackageVersion Include="Polly" Version="8.5.0" />
<PackageVersion Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
Expand Down Expand Up @@ -125,4 +127,4 @@
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
</Project>
</Project>
66 changes: 64 additions & 2 deletions StabilityMatrix.Avalonia/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
Expand Down Expand Up @@ -37,6 +38,8 @@
using NLog.Extensions.Logging;
using NLog.Targets;
using Octokit;
using OpenIddict.Abstractions;
using OpenIddict.Client;
using Polly;
using Polly.Contrib.WaitAndRetry;
using Polly.Extensions.Http;
Expand All @@ -52,6 +55,7 @@
using StabilityMatrix.Avalonia.ViewModels.Progress;
using StabilityMatrix.Avalonia.Views;
using StabilityMatrix.Core.Api;
using StabilityMatrix.Core.Api.LykosAuthApi;
using StabilityMatrix.Core.Attributes;
using StabilityMatrix.Core.Converters.Json;
using StabilityMatrix.Core.Database;
Expand All @@ -67,6 +71,7 @@
using Application = Avalonia.Application;
using Logger = NLog.Logger;
using LogLevel = Microsoft.Extensions.Logging.LogLevel;
using ProductHeaderValue = Octokit.ProductHeaderValue;
#if DEBUG
using StabilityMatrix.Avalonia.Diagnostics.LogViewer;
using StabilityMatrix.Avalonia.Diagnostics.LogViewer.Extensions;
Expand Down Expand Up @@ -123,6 +128,14 @@ public sealed class App : Application
#else
public const string LykosAnalyticsApiBaseUrl = "https://analytics.lykos.ai";
#endif
#if DEBUG
// ReSharper disable twice LocalizableElement
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
public static string LykosAccountApiBaseUrl =>
Config?["LykosAccountApiBaseUrl"] ?? "https://account.lykos.ai/";
#else
public const string LykosAccountApiBaseUrl = "https://account.lykos.ai/";
#endif

// ReSharper disable once MemberCanBePrivate.Global
public IClassicDesktopStyleApplicationLifetime? DesktopLifetime =>
Expand Down Expand Up @@ -365,7 +378,10 @@ internal static void ConfigurePageViewModels(IServiceCollection services)
provider.GetRequiredService<Lazy<IModelDownloadLinkHandler>>(),
provider.GetRequiredService<INotificationService>(),
provider.GetRequiredService<IAnalyticsHelper>(),
provider.GetRequiredService<IUpdateHelper>()
provider.GetRequiredService<IUpdateHelper>(),
provider.GetRequiredService<ISecretsManager>(),
provider.GetRequiredService<INavigationService<MainWindowViewModel>>(),
provider.GetRequiredService<INavigationService<SettingsViewModel>>()
)
{
Pages =
Expand Down Expand Up @@ -594,7 +610,7 @@ internal static IServiceCollection ConfigureServices()
.AddPolicyHandler(retryPolicyLonger);

services
.AddRefitClient<ILykosAuthApi>(defaultRefitSettings)
.AddRefitClient<ILykosAuthApiV1>(defaultRefitSettings)
.ConfigureHttpClient(c =>
{
c.BaseAddress = new Uri(LykosAuthApiBaseUrl);
Expand All @@ -607,6 +623,21 @@ internal static IServiceCollection ConfigureServices()
new TokenAuthHeaderHandler(serviceProvider.GetRequiredService<LykosAuthTokenProvider>())
);

services
.AddRefitClient<ILykosAuthApiV2>(defaultRefitSettings)
.ConfigureHttpClient(c =>
{
c.BaseAddress = new Uri(LykosAuthApiBaseUrl);
c.Timeout = TimeSpan.FromHours(1);
c.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "");
})
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false })
.AddPolicyHandler(retryPolicy)
.AddHttpMessageHandler(
serviceProvider =>
new TokenAuthHeaderHandler(serviceProvider.GetRequiredService<LykosAuthTokenProvider>())
);

services
.AddRefitClient<ILykosAnalyticsApi>(defaultRefitSettings)
.ConfigureHttpClient(c =>
Expand Down Expand Up @@ -643,6 +674,37 @@ internal static IServiceCollection ConfigureServices()
}
);

// Add OpenId
services
.AddOpenIddict()
.AddClient(options =>
{
options.AllowDeviceCodeFlow().AllowRefreshTokenFlow();

options.DisableTokenStorage();
options.AddEphemeralEncryptionKey().AddEphemeralSigningKey();

options.UseSystemNetHttp().SetProductInformation("StabilityMatrix", "2.0");

options.AddRegistration(
new OpenIddictClientRegistration
{
ProviderName = OpenIdClientConstants.LykosAccount.ProviderName,
Issuer = new Uri(LykosAccountApiBaseUrl),
ClientId = "ai.lykos.stabilitymatrix",
Scopes =
{
OpenIddictConstants.Scopes.Profile,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.OpenId,
"api",
OpenIddictConstants.Scopes.OfflineAccess
},
RedirectUri = Program.MessagePipeUri.Append("/callback/login/lykos")
}
);
});

ConditionalAddLogViewer(services);

var logConfig = ConfigureLogging();
Expand Down
53 changes: 53 additions & 0 deletions StabilityMatrix.Avalonia/Assets/brands-lykos-oauth-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions StabilityMatrix.Avalonia/DesignData/DesignData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,13 @@ public static UpdateSettingsViewModel UpdateSettingsViewModel
+ "redirect_uri=http://localhost:5022/api/oauth/patreon/callback";
});

public static OAuthDeviceAuthViewModel OAuthDeviceAuthViewModel =>
DialogFactory.Get<OAuthDeviceAuthViewModel>(vm =>
{
vm.VerificationUri = new Uri("https://example.org/connect/verify");
vm.UserCode = "AB23-CD56";
});

public static PythonPackageSpecifiersViewModel PythonPackageSpecifiersViewModel =>
DialogFactory.Get<PythonPackageSpecifiersViewModel>();

Expand Down
12 changes: 12 additions & 0 deletions StabilityMatrix.Avalonia/Helpers/ClipboardCommands.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using CommunityToolkit.Mvvm.Input;

namespace StabilityMatrix.Avalonia.Helpers;

public static class ClipboardCommands
{
private static readonly Lazy<RelayCommand<string?>> CopyTextCommandLazy =
new(() => new RelayCommand<string?>(text => App.Clipboard.SetTextAsync(text)));

public static RelayCommand<string?> CopyTextCommand => CopyTextCommandLazy.Value;
}
Loading
Loading