Browse Source

fixed a few more github issues

pull/629/head
JT 7 months ago
parent
commit
805dde5bd5
  1. 7
      CHANGELOG.md
  2. 2
      StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CivitAiBrowserViewModel.cs
  3. 13
      StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFile.cs
  4. 19
      StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFolder.cs
  5. 5
      StabilityMatrix.Avalonia/ViewModels/OpenArtBrowserViewModel.cs
  6. 8
      StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs
  7. 7
      StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml
  8. 33
      StabilityMatrix.Avalonia/Views/Settings/MainSettingsPage.axaml
  9. 2
      StabilityMatrix.Core/Models/DownloadPackageVersionOptions.cs
  10. 48
      StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs
  11. 2
      StabilityMatrix.Core/Models/Packages/BasePackage.cs
  12. 17
      StabilityMatrix.Core/Models/Packages/UnknownPackage.cs
  13. 1
      StabilityMatrix.Core/Models/SharedFolderType.cs

7
CHANGELOG.md

@ -6,15 +6,20 @@ 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.10.1
### Added
- Added SVD Shared Model Folder for Forge (fixes [#580](https://github.com/LykosAI/StabilityMatrix/issues/580))
### Changed
- Improved error message when logging in with a Lykos account fails due to incorrect email or password.
### Fixed
- 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.
- Fixed "No refresh token found" error when failing to login with Lykos account in some cases.
- Fixed blank entries appearing in the Categories dropdown on the Checkpoints page
- Fixed crash when loading invalid connected model info files
- Fixed [#585](https://github.com/LykosAI/StabilityMatrix/issues/585) - Crash when drag & drop source and destination are the same
- Fixed [#584](https://github.com/LykosAI/StabilityMatrix/issues/584) - `--launch-package` argument not working
- Fixed [#581](https://github.com/LykosAI/StabilityMatrix/issues/581) - Inference teaching tip showing more often than it should
- Fixed [#574](https://github.com/LykosAI/StabilityMatrix/issues/574) - local images not showing on macOS or Linux
- 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
- Fixed [#574](https://github.com/LykosAI/StabilityMatrix/issues/574) - local images not showing on macOS or Linux
## v2.10.0
### Added

2
StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CivitAiBrowserViewModel.cs

@ -177,6 +177,8 @@ public partial class CivitAiBrowserViewModel : TabViewModelBase, IInfinitelyScro
model => model.ShowNsfw,
settings => settings.ModelBrowserNsfwEnabled
);
SearchModelsCommand.ExecuteAsync(false);
}
/// <summary>

13
StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFile.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Avalonia.Data;
using CommunityToolkit.Mvvm.ComponentModel;
@ -10,7 +11,6 @@ using CommunityToolkit.Mvvm.Input;
using FluentAvalonia.UI.Controls;
using Microsoft.Extensions.DependencyInjection;
using NLog;
using StabilityMatrix.Avalonia.Languages;
using StabilityMatrix.Avalonia.ViewModels.Base;
using StabilityMatrix.Core.Attributes;
using StabilityMatrix.Core.Extensions;
@ -333,8 +333,15 @@ public partial class CheckpointFile : ViewModelBase
if (File.Exists(jsonPath))
{
var json = File.ReadAllText(jsonPath);
var connectedModelInfo = ConnectedModelInfo.FromJson(json);
checkpointFile.ConnectedModel = connectedModelInfo;
try
{
var connectedModelInfo = ConnectedModelInfo.FromJson(json);
checkpointFile.ConnectedModel = connectedModelInfo;
}
catch (JsonException)
{
checkpointFile.ConnectedModel = null;
}
}
checkpointFile.PreviewImagePath = SupportedImageExtensions

19
StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFolder.cs

@ -92,7 +92,8 @@ public partial class CheckpointFolder : ViewModelBase
public string TitleWithFilesCount =>
CheckpointFiles.Any() || SubFolders.Any(f => f.CheckpointFiles.Any())
? $"{FolderType.GetDescription() ?? FolderType.GetStringValue()} ({CheckpointFiles.Count + SubFolders.Sum(folder => folder.CheckpointFiles.Count)})"
? $"{FolderType.GetDescription() ?? (string.IsNullOrWhiteSpace(FolderType.GetStringValue()) ? Path.GetFileName(DirectoryPath) : FolderType.GetStringValue())} "
+ $"({CheckpointFiles.Count + SubFolders.Sum(folder => folder.CheckpointFiles.Count)})"
: FolderType.GetDescription() ?? FolderType.GetStringValue();
public ProgressViewModel Progress { get; } = new();
@ -447,6 +448,22 @@ public partial class CheckpointFolder : ViewModelBase
Progress.Value = 0;
var copyPaths = files.ToDictionary(k => k, v => Path.Combine(DirectoryPath, Path.GetFileName(v)));
// remove files that are already in the folder
foreach (var (source, destination) in copyPaths)
{
if (source == destination)
{
copyPaths.Remove(source);
}
}
if (copyPaths.Count == 0)
{
Progress.Text = "Import complete";
Progress.Value = 100;
return;
}
var progress = new Progress<ProgressReport>(report =>
{
Progress.IsIndeterminate = false;

5
StabilityMatrix.Avalonia/ViewModels/OpenArtBrowserViewModel.cs

@ -12,7 +12,6 @@ using DynamicData.Binding;
using FluentAvalonia.UI.Controls;
using Refit;
using StabilityMatrix.Avalonia.Controls;
using StabilityMatrix.Avalonia.Languages;
using StabilityMatrix.Avalonia.Models;
using StabilityMatrix.Avalonia.Services;
using StabilityMatrix.Avalonia.ViewModels.Base;
@ -36,8 +35,7 @@ public partial class OpenArtBrowserViewModel(
IOpenArtApi openArtApi,
INotificationService notificationService,
ISettingsManager settingsManager,
IPackageFactory packageFactory,
ServiceManager<ViewModelBase> vmFactory
IPackageFactory packageFactory
) : TabViewModelBase, IInfinitelyScroll
{
private const int PageSize = 20;
@ -90,6 +88,7 @@ public partial class OpenArtBrowserViewModel(
{
searchResultsCache.Connect().DeferUntilLoaded().Bind(SearchResults).Subscribe();
SelectedSortMode = AllSortModes.First();
DoSearch().SafeFireAndForget();
}
[RelayCommand]

8
StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs

@ -95,6 +95,9 @@ public partial class PackageCardViewModel(
[ObservableProperty]
private bool showWebUiButton;
[ObservableProperty]
private DownloadPackageVersionOptions? updateVersion;
private void RunningPackagesOnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
if (runningPackageService.RunningPackages.Select(x => x.Value) is not { } runningPackages)
@ -196,6 +199,10 @@ public partial class PackageCardViewModel(
}
IsUpdateAvailable = await HasUpdate();
if (IsUpdateAvailable)
{
UpdateVersion = await basePackage.GetUpdate(currentPackage);
}
if (
Package != null
@ -672,6 +679,7 @@ public partial class PackageCardViewModel(
try
{
var hasUpdate = await basePackage.CheckForUpdates(Package);
UpdateVersion = await basePackage.GetUpdate(Package);
await using (settingsManager.BeginTransaction())
{

7
StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

@ -255,9 +255,14 @@
Margin="4,4,0,0"
Padding="4"
IsEnabled="{Binding !IsRunning}"
ToolTip.Tip="{x:Static lang:Resources.Label_UpdateAvailable}"
markupExtensions:ShowDisabledTooltipExtension.ShowOnDisabled="True"
Command="{Binding Update}">
<ToolTip.Tip>
<TextBlock>
<Run Text="{x:Static lang:Resources.Label_UpdateAvailable}"/>
<Run Text="(" /><Run Text="{Binding UpdateVersion.ReadableVersionString, FallbackValue=none}"/><Run Text=")"/>
</TextBlock>
</ToolTip.Tip>
<Button.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="!IsUnknownPackage" />

33
StabilityMatrix.Avalonia/Views/Settings/MainSettingsPage.axaml

@ -82,19 +82,6 @@
Symbol="Alert" />
</ui:SettingsExpander.IconSource>
</ui:SettingsExpander>
<ui:SettingsExpander Grid.Row="3"
Header="{x:Static lang:Resources.Label_HolidayMode}">
<ui:SettingsExpander.IconSource>
<fluentIcons:SymbolIconSource
FontSize="10"
IsFilled="True"
Symbol="WeatherSnowflake" />
</ui:SettingsExpander.IconSource>
<ui:SettingsExpander.Footer>
<ui:FAComboBox SelectedItem="{Binding HolidayModeSetting}"
ItemsSource="{Binding HolidayModes}"/>
</ui:SettingsExpander.Footer>
</ui:SettingsExpander>
</sg:SpacedGrid>
<!-- Integrations -->
@ -215,7 +202,7 @@
</sg:SpacedGrid>
<!-- Theme -->
<Grid RowDefinitions="Auto,*,*,*">
<Grid RowDefinitions="Auto,*,*,*,*">
<TextBlock
Margin="0,0,0,8"
FontWeight="Medium"
@ -245,8 +232,24 @@
SelectedItem="{Binding SelectedLanguage}" />
</ui:SettingsExpander.Footer>
</ui:SettingsExpander>
<ui:SettingsExpander Grid.Row="3"
Margin="8,0,8,4"
Header="{x:Static lang:Resources.Label_HolidayMode}">
<ui:SettingsExpander.IconSource>
<fluentIcons:SymbolIconSource
FontSize="10"
IsFilled="True"
Symbol="WeatherSnowflake" />
</ui:SettingsExpander.IconSource>
<ui:SettingsExpander.Footer>
<ui:FAComboBox SelectedItem="{Binding HolidayModeSetting}"
ItemsSource="{Binding HolidayModes}"/>
</ui:SettingsExpander.Footer>
</ui:SettingsExpander>
<ui:SettingsExpander
Grid.Row="3"
Grid.Row="4"
Margin="8,0,8,4"
ActionIconSource="ChevronRight"
Command="{Binding NavigateToSubPageCommand}"

2
StabilityMatrix.Core/Models/DownloadPackageVersionOptions.cs

@ -10,4 +10,6 @@ public class DownloadPackageVersionOptions
public string GetReadableVersionString() =>
!string.IsNullOrWhiteSpace(VersionTag) ? VersionTag : $"{BranchName}@{CommitHash?[..7]}";
public string ReadableVersionString => GetReadableVersionString();
}

48
StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs

@ -345,6 +345,54 @@ public abstract class BaseGitPackage : BasePackage
}
}
public override async Task<DownloadPackageVersionOptions?> GetUpdate(InstalledPackage installedPackage)
{
var currentVersion = installedPackage.Version;
if (currentVersion is null or { InstalledReleaseVersion: null, InstalledBranch: null })
{
Logger.Warn(
"Could not check updates for package {Name}, version is invalid: {@currentVersion}",
Name,
currentVersion
);
return null;
}
var versionOptions = new DownloadPackageVersionOptions { IsLatest = true };
try
{
if (currentVersion.IsReleaseMode)
{
var latestVersion = await GetLatestVersion(currentVersion.IsPrerelease).ConfigureAwait(false);
versionOptions.IsPrerelease = latestVersion.IsPrerelease;
versionOptions.VersionTag = latestVersion.VersionTag;
return versionOptions;
}
var allCommits = (
await GetAllCommits(currentVersion.InstalledBranch!).ConfigureAwait(false)
)?.ToList();
if (allCommits == null || !allCommits.Any())
{
Logger.Warn("No commits found for {Package}", installedPackage.PackageName);
return null;
}
var latestCommitHash = allCommits.First().Sha;
versionOptions.CommitHash = latestCommitHash;
versionOptions.BranchName = currentVersion.InstalledBranch;
return versionOptions;
}
catch (ApiException e)
{
Logger.Warn(e, "Failed to check for package updates");
return null;
}
}
public override async Task<InstalledPackageVersion> Update(
InstalledPackage installedPackage,
TorchVersion torchVersion,

2
StabilityMatrix.Core/Models/Packages/BasePackage.cs

@ -237,4 +237,6 @@ public abstract class BasePackage
onConsoleOutput
);
}
public abstract Task<DownloadPackageVersionOptions?> GetUpdate(InstalledPackage installedPackage);
}

17
StabilityMatrix.Core/Models/Packages/UnknownPackage.cs

@ -15,8 +15,7 @@ public class UnknownPackage : BasePackage
public override string GithubUrl => "";
public override string LicenseType => "AGPL-3.0";
public override string LicenseUrl =>
"https://github.com/LykosAI/StabilityMatrix/blob/main/LICENSE";
public override string LicenseUrl => "https://github.com/LykosAI/StabilityMatrix/blob/main/LICENSE";
public override string Blurb => "A dank interface for diffusion";
public override string LaunchCommand => "test";
@ -140,20 +139,20 @@ public class UnknownPackage : BasePackage
public override List<LaunchOptionDefinition> LaunchOptions => new();
public override Dictionary<SharedFolderType, IReadOnlyList<string>>? SharedFolders { get; }
public override Dictionary<
SharedOutputType,
IReadOnlyList<string>
>? SharedOutputFolders { get; }
public override Dictionary<SharedOutputType, IReadOnlyList<string>>? SharedOutputFolders { get; }
public override Task<DownloadPackageVersionOptions> GetLatestVersion(
bool includePrerelease = false
)
public override Task<DownloadPackageVersionOptions> GetLatestVersion(bool includePrerelease = false)
{
throw new NotImplementedException();
}
public override string MainBranch { get; }
public override Task<DownloadPackageVersionOptions?> GetUpdate(InstalledPackage installedPackage)
{
return Task.FromResult(new DownloadPackageVersionOptions { IsLatest = true, VersionTag = "1.8.0" });
}
public override Task<PackageVersionOptions> GetAllVersionOptions() =>
Task.FromResult(new PackageVersionOptions());

1
StabilityMatrix.Core/Models/SharedFolderType.cs

@ -39,6 +39,7 @@ public enum SharedFolderType
InvokeIpAdapters15 = 1 << 24,
InvokeIpAdaptersXl = 1 << 25,
InvokeClipVision = 1 << 26,
SVD = 1 << 27,
PromptExpansion = 1 << 30
}

Loading…
Cancel
Save