Skip to content

Commit

Permalink
Merge pull request #786 from LykosAI/main
Browse files Browse the repository at this point in the history
v2.11.5
  • Loading branch information
mohnjiles authored Jul 28, 2024
2 parents 13b0080 + e55b5dd commit 23a56ba
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 31 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +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.11.5
### Added
- Added DoRA category to CivitAI model browser
### Fixed
- Fixed `TaskCanceledException` when adding CivitAI Api key or searching for models when the API takes too long to respond. Retry and timeout behavior has been improved.
- Fixed [#782](https://github.com/LykosAI/StabilityMatrix/issues/782) - conflict error when launching new versions of Forge
- Fixed incorrect torch versions being installed for InvokeAI
- Fixed `ArgumentOutOfRangeException` with the Python Packages dialog ItemSourceView when interacting too quickly after loading.
### Supporters
#### Visionaries
- Shoutout to our Visionary-tier Patreon supporters, **Scopp Mcdee**, **Waterclouds**, and our newest Visionary, **Akiro_Senkai**! Many thanks for your generous support!
#### Pioneers
- Many thanks to our Pioneer-tier supporters on Patreon, **tankfox**, **tanangular**, and our newest Pioneers, **Mr. Unknown** and **Szir777**! Your support is greatly appreciated!

## v2.11.4
### Changed
- Base Python install will now use `setuptools==69.5.1` for compatibility with `torchsde`. Individual Packages can upgrade as required.
Expand Down
26 changes: 12 additions & 14 deletions StabilityMatrix.Avalonia/Controls/Painting/PaintCanvas.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

if (MainCanvas is not null)
{
// If we already have a BackgroundBitmap, scale MainCanvas to match
if (DataContext is PaintCanvasViewModel { BackgroundImage: { } backgroundBitmap })
if (DataContext is PaintCanvasViewModel { CanvasSize: var canvasSize })
{
MainCanvas.Width = backgroundBitmap.Width;
MainCanvas.Height = backgroundBitmap.Height;
MainCanvas.Width = canvasSize.Width;
MainCanvas.Height = canvasSize.Height;
}

MainCanvas.RenderSkia += OnRenderSkia;
Expand Down Expand Up @@ -108,10 +107,10 @@ protected override void OnDataContextChanged(EventArgs e)

viewModelSubscription?.Dispose();
viewModelSubscription = viewModel
.WhenPropertyChanged(vm => vm.BackgroundImage)
.WhenPropertyChanged(vm => vm.CanvasSize)
.Subscribe(change =>
{
if (MainCanvas is not null && change.Value is not null)
if (MainCanvas is not null && !change.Value.IsEmpty)
{
MainCanvas.Width = change.Value.Width;
MainCanvas.Height = change.Value.Height;
Expand Down Expand Up @@ -317,22 +316,21 @@ protected override void OnKeyDown(KeyEventArgs e)
/// </summary>
private void UpdateMainCanvasBounds()
{
if (
MainCanvas is null
|| DataContext is not PaintCanvasViewModel { BackgroundImage: { } backgroundBitmap }
)
if (MainCanvas is null || DataContext is not PaintCanvasViewModel vm)
{
return;
}

var canvasSize = vm.CanvasSize;

// Set size if mismatch
if (
Math.Abs(MainCanvas.Width - backgroundBitmap.Width) > 0.1
|| Math.Abs(MainCanvas.Height - backgroundBitmap.Height) > 0.1
((int)Math.Round(MainCanvas.Width) != canvasSize.Width)
|| ((int)Math.Round(MainCanvas.Height) != canvasSize.Height)
)
{
MainCanvas.Width = backgroundBitmap.Width;
MainCanvas.Height = backgroundBitmap.Height;
MainCanvas.Width = vm.CanvasSize.Width;
MainCanvas.Height = vm.CanvasSize.Height;
MainCanvas.InvalidateVisual();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using AsyncAwaitBestPractices;
using AutoCtor;
Expand Down Expand Up @@ -60,14 +61,17 @@ private void PostConstruct()
var searchPredicate = this.WhenPropertyChanged(vm => vm.SearchQuery)
.Throttle(TimeSpan.FromMilliseconds(100))
.DistinctUntilChanged()
.Select(
value =>
(Func<PipPackageInfo, bool>)(
p =>
string.IsNullOrWhiteSpace(value.Value)
|| p.Name.Contains(value.Value, StringComparison.OrdinalIgnoreCase)
)
);
.Select(value =>
{
if (string.IsNullOrWhiteSpace(value.Value))
{
return (static _ => true);
}

return (Func<PipPackageInfo, bool>)(
p => p.Name.Contains(value.Value, StringComparison.OrdinalIgnoreCase)
);
});

packageSource
.Connect()
Expand All @@ -76,6 +80,7 @@ private void PostConstruct()
.Transform(p => new PythonPackagesItemViewModel(settingsManager) { Package = p })
.SortBy(vm => vm.Package.Name)
.Bind(Packages)
.ObserveOn(SynchronizationContext.Current!)
.Subscribe();
}

Expand All @@ -101,7 +106,11 @@ private async Task Refresh()
);

var packages = await venvRunner.PipList();

packageSource.EditDiff(packages);

// Delay a bit to prevent thread issues with UI list
await Task.Delay(100);
}
}
finally
Expand Down
3 changes: 3 additions & 0 deletions StabilityMatrix.Core/Models/Api/CivitModelType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public enum CivitModelType
[ConvertTo<SharedFolderType>(SharedFolderType.Hypernetwork)]
Hypernetwork,

[ConvertTo<SharedFolderType>(SharedFolderType.Lora)]
DoRA,

[ConvertTo<SharedFolderType>(SharedFolderType.Lora)]
LORA,

Expand Down
8 changes: 4 additions & 4 deletions StabilityMatrix.Core/Models/Packages/InvokeAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ await SetupAndBuildInvokeFrontend(
await venvRunner
.PipInstall(
new PipInstallArgs(args.Any() ? args.ToArray() : Array.Empty<Argument>())
.WithTorch("==2.2.1")
.WithTorchVision("==0.17.1")
.WithXFormers("==0.0.25")
.WithTorch("==2.2.2")
.WithTorchVision("==0.17.2")
.WithXFormers("==0.0.25.post1")
.WithTorchExtraIndex("cu121"),
onConsoleOutput
)
Expand Down Expand Up @@ -250,7 +250,7 @@ private async Task SetupAndBuildInvokeFrontend(
{
await PrerequisiteHelper.InstallNodeIfNecessary(progress).ConfigureAwait(false);
await PrerequisiteHelper
.RunNpm(["i", "pnpm"], installLocation, envVars: envVars)
.RunNpm(["i", "pnpm@8"], installLocation, envVars: envVars)
.ConfigureAwait(false);

if (Compat.IsMacOS || Compat.IsLinux)
Expand Down
5 changes: 0 additions & 5 deletions StabilityMatrix.Core/Models/Packages/SDWebForge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ public override async Task InstallPackage(

var requirements = new FilePath(installLocation, "requirements_versions.txt");
var requirementsContent = await requirements.ReadAllTextAsync().ConfigureAwait(false);
if (!requirementsContent.Contains("pydantic"))
{
requirementsContent += "pydantic==1.10.15";
await requirements.WriteAllTextAsync(requirementsContent).ConfigureAwait(false);
}

var pipArgs = new PipInstallArgs("setuptools==69.5.1");
if (torchVersion is TorchVersion.DirectMl)
Expand Down

0 comments on commit 23a56ba

Please sign in to comment.