Skip to content

Commit 3b8b8cc

Browse files
committed
2 parents 9ac2b91 + e626c47 commit 3b8b8cc

38 files changed

+280
-89
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ 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.10.1
9+
### Added
10+
- Added SVD Shared Model & Output Folders for Forge (fixes [#580](https://github.com/LykosAI/StabilityMatrix/issues/580))
11+
### Changed
12+
- Improved error message when logging in with a Lykos account fails due to incorrect email or password
13+
- Model Browser & Workflow Browser now auto-load when first navigating to those pages
14+
- Removed update confirmation dialog, instead showing the new version in the update button tooltip
15+
### Fixed
16+
- Fixed package launch not working when environment variable `SETUPTOOLS_USE_DISTUTILS` is set due to conflict with a default environment variable. User environment variables will now correctly override any default environment variables.
17+
- Fixed "No refresh token found" error when failing to login with Lykos account in some cases
18+
- Fixed blank entries appearing in the Categories dropdown on the Checkpoints page
19+
- Fixed crash when loading invalid connected model info files
20+
- Fixed [#585](https://github.com/LykosAI/StabilityMatrix/issues/585) - Crash when drag & drop source and destination are the same
21+
- Fixed [#584](https://github.com/LykosAI/StabilityMatrix/issues/584) - `--launch-package` argument not working
22+
- Fixed [#581](https://github.com/LykosAI/StabilityMatrix/issues/581) - Inference teaching tip showing more often than it should
23+
- Fixed [#578](https://github.com/LykosAI/StabilityMatrix/issues/578) - "python setup.py egg_info did not run successfully" failure when installing Auto1111 or SDWebUI Forge
24+
- Fixed [#574](https://github.com/LykosAI/StabilityMatrix/issues/574) - local images not showing on macOS or Linux
25+
826
## v2.10.0
927
### Added
1028
- Added Reference-Only mode for Inference ControlNet, used for guiding the sampler with an image without a pretrained model. Part of the latent and attention layers will be connected to the reference image, similar to Image to Image or Inpainting.

StabilityMatrix.Avalonia/Controls/Inference/ImageFolderCard.axaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
xmlns:scroll="clr-namespace:StabilityMatrix.Avalonia.Controls.Scroll"
1212
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
1313
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
14+
xmlns:converters="clr-namespace:StabilityMatrix.Avalonia.Converters"
1415
x:DataType="vmInference:ImageFolderCardViewModel">
1516

1617
<Design.PreviewWith>
@@ -20,6 +21,8 @@
2021
</Grid>
2122
</Panel>
2223
</Design.PreviewWith>
24+
25+
<converters:FileUriConverter x:Key="FileUriConverter" />
2326

2427
<ControlTheme x:Key="{x:Type controls:ImageFolderCard}" TargetType="controls:ImageFolderCard">
2528
<Setter Property="Background" Value="Transparent" />
@@ -200,7 +203,7 @@
200203
<vendorLabs:BetterAsyncImage
201204
Width="{Binding $parent[ItemsRepeater].((vmInference:ImageFolderCardViewModel)DataContext).ImageSize.Width}"
202205
Height="{Binding $parent[ItemsRepeater].((vmInference:ImageFolderCardViewModel)DataContext).ImageSize.Height}"
203-
Source="{Binding AbsolutePath}"
206+
Source="{Binding AbsolutePath, Converter={StaticResource FileUriConverter}}"
204207
Stretch="UniformToFill" />
205208

206209
<Border

StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<ui:TeachingTip
7373
Target="{Binding #PART_HelpButton}"
7474
Title="{x:Static lang:Resources.TeachingTip_InferencePromptHelpButton}"
75-
IsOpen="{Binding IsHelpButtonTeachingTipOpen}"/>
75+
IsOpen="{Binding IsHelpButtonTeachingTipOpen, Mode=TwoWay}"/>
7676
</Panel>
7777

7878
<Button

StabilityMatrix.Avalonia/Converters/FileUriConverter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class FileUriConverter : IValueConverter
1717

1818
return value switch
1919
{
20+
string str when str.StartsWith("avares://") => new Uri(str),
2021
string str => new Uri("file://" + str),
2122
IFormattable formattable => new Uri("file://" + formattable.ToString(null, culture)),
2223
_ => null

StabilityMatrix.Avalonia/Services/INavigationService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ void NavigateTo(
3939
bool GoBack();
4040

4141
bool CanGoBack { get; }
42+
object? CurrentPageDataContext { get; }
4243
}

StabilityMatrix.Avalonia/Services/NavigationService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Linq;
3+
using Avalonia.Controls;
34
using FluentAvalonia.UI.Controls;
45
using FluentAvalonia.UI.Media.Animation;
56
using FluentAvalonia.UI.Navigation;
@@ -190,4 +191,6 @@ public bool GoBack()
190191
}
191192

192193
public bool CanGoBack => _frame?.CanGoBack ?? false;
194+
195+
public object? CurrentPageDataContext => (_frame?.Content as Control)?.DataContext;
193196
}

StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CivitAiBrowserViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ public override void OnLoaded()
177177
model => model.ShowNsfw,
178178
settings => settings.ModelBrowserNsfwEnabled
179179
);
180+
181+
SearchModelsCommand.ExecuteAsync(false);
180182
}
181183

182184
/// <summary>

StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFile.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
using System.Collections.ObjectModel;
44
using System.IO;
55
using System.Linq;
6+
using System.Text.Json;
67
using System.Threading.Tasks;
78
using Avalonia.Data;
89
using CommunityToolkit.Mvvm.ComponentModel;
910
using CommunityToolkit.Mvvm.Input;
1011
using FluentAvalonia.UI.Controls;
1112
using Microsoft.Extensions.DependencyInjection;
1213
using NLog;
13-
using StabilityMatrix.Avalonia.Languages;
1414
using StabilityMatrix.Avalonia.ViewModels.Base;
1515
using StabilityMatrix.Core.Attributes;
1616
using StabilityMatrix.Core.Extensions;
@@ -333,8 +333,15 @@ public static IEnumerable<CheckpointFile> FromDirectoryIndex(
333333
if (File.Exists(jsonPath))
334334
{
335335
var json = File.ReadAllText(jsonPath);
336-
var connectedModelInfo = ConnectedModelInfo.FromJson(json);
337-
checkpointFile.ConnectedModel = connectedModelInfo;
336+
try
337+
{
338+
var connectedModelInfo = ConnectedModelInfo.FromJson(json);
339+
checkpointFile.ConnectedModel = connectedModelInfo;
340+
}
341+
catch (JsonException)
342+
{
343+
checkpointFile.ConnectedModel = null;
344+
}
338345
}
339346

340347
checkpointFile.PreviewImagePath = SupportedImageExtensions

StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFolder.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public partial class CheckpointFolder : ViewModelBase
9292

9393
public string TitleWithFilesCount =>
9494
CheckpointFiles.Any() || SubFolders.Any(f => f.CheckpointFiles.Any())
95-
? $"{FolderType.GetDescription() ?? FolderType.GetStringValue()} ({CheckpointFiles.Count + SubFolders.Sum(folder => folder.CheckpointFiles.Count)})"
95+
? $"{FolderType.GetDescription() ?? (string.IsNullOrWhiteSpace(FolderType.GetStringValue()) ? Path.GetFileName(DirectoryPath) : FolderType.GetStringValue())} "
96+
+ $"({CheckpointFiles.Count + SubFolders.Sum(folder => folder.CheckpointFiles.Count)})"
9697
: FolderType.GetDescription() ?? FolderType.GetStringValue();
9798

9899
public ProgressViewModel Progress { get; } = new();
@@ -447,6 +448,22 @@ public async Task ImportFilesAsync(IEnumerable<string> files, bool convertToConn
447448
Progress.Value = 0;
448449
var copyPaths = files.ToDictionary(k => k, v => Path.Combine(DirectoryPath, Path.GetFileName(v)));
449450

451+
// remove files that are already in the folder
452+
foreach (var (source, destination) in copyPaths)
453+
{
454+
if (source == destination)
455+
{
456+
copyPaths.Remove(source);
457+
}
458+
}
459+
460+
if (copyPaths.Count == 0)
461+
{
462+
Progress.Text = "Import complete";
463+
Progress.Value = 100;
464+
return;
465+
}
466+
450467
var progress = new Progress<ProgressReport>(report =>
451468
{
452469
Progress.IsIndeterminate = false;

StabilityMatrix.Avalonia/ViewModels/Dialogs/LykosLoginViewModel.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.ComponentModel.DataAnnotations;
4+
using System.Net;
45
using System.Threading.Tasks;
56
using CommunityToolkit.Mvvm.ComponentModel;
67
using CommunityToolkit.Mvvm.Input;
@@ -90,7 +91,15 @@ private async Task LoginAsync()
9091
}
9192
catch (ApiException e)
9293
{
93-
LoginError = new AppException("Failed to login", $"{e.StatusCode} - {e.Message}");
94+
LoginError = e.StatusCode switch
95+
{
96+
HttpStatusCode.Unauthorized
97+
=> new AppException(
98+
"Incorrect email or password",
99+
"Please try again or reset your password"
100+
),
101+
_ => new AppException("Failed to login", $"{e.StatusCode} - {e.Message}")
102+
};
94103
}
95104
}
96105

0 commit comments

Comments
 (0)