Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.11.1 #699

Merged
merged 39 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
129afab
Re-add the Rename functionality for checkpoints
mohnjiles Jun 17, 2024
1caa9ce
chagenlog
mohnjiles Jun 17, 2024
9fdf750
fix build
mohnjiles Jun 17, 2024
0917999
Merge pull request #677 from ionite34/rename-checkpoints
mohnjiles Jun 17, 2024
dcadcb3
Add pinned numpy and mpmath for comfy install
ionite34 Jun 17, 2024
1a7200c
Add changelog
ionite34 Jun 17, 2024
c8366ae
Merge pull request #678 from ionite34/fix-comfy-install
ionite34 Jun 17, 2024
9f53880
Add stale workflow
ionite34 Jun 17, 2024
8147de4
Formatting
ionite34 Jun 17, 2024
643777e
Add unobserved task exception notification
ionite34 Jun 17, 2024
a0a0d83
Fix paint canvas load bitmap not working
ionite34 Jun 17, 2024
bd1d310
Merge pull request #679 from ionite34/fixes
ionite34 Jun 17, 2024
1dc62e3
Fix unobserved task exception notification thread
ionite34 Jun 18, 2024
71fddeb
Add SharedFolderLayout framework
ionite34 Jun 18, 2024
9a0e6b2
Update Fooocus to use SharedFolderLayout
ionite34 Jun 18, 2024
68ef26b
Add output folder sharing
ionite34 Jun 18, 2024
31ad97b
Add unique behavior for LegacySharedFolders conversion
ionite34 Jun 18, 2024
090a203
Fix fooocus controlnet config shared folders not working
ionite34 Jun 18, 2024
1bb6ce5
Version bump
ionite34 Jun 18, 2024
81eca91
Move options to own file
ionite34 Jun 18, 2024
b96a770
Hide the overloads
ionite34 Jun 18, 2024
23e9456
Combined some methods
ionite34 Jun 18, 2024
c954616
Merge pull request #680 from ionite34/config-fixes
ionite34 Jun 18, 2024
5f8c1cd
Add disclaimer to FooocusControlNet since it looks ded
mohnjiles Jun 18, 2024
a97646d
update Disclaimer
mohnjiles Jun 18, 2024
703f0a0
Add PyBaseInstall and CreatePyVenvRunner with tcl tk parsing
ionite34 Jun 18, 2024
a2f7c75
Updated PyVenvRunner init for tk tcl and custom base python support. …
ionite34 Jun 19, 2024
d2131d2
Fix kohya install arguments on linux
ionite34 Jun 19, 2024
5337df2
Merge pull request #681 from ionite34/fooocus-controlnet-disclaimer
mohnjiles Jun 19, 2024
69585e4
Merge pull request #683 from ionite34/downmerge
mohnjiles Jun 19, 2024
78f96c7
Merge branch 'dev' into downmerge
mohnjiles Jun 19, 2024
9188086
Merge branch 'dev' into fix-pyvenv
ionite34 Jun 19, 2024
012fcbb
Merge pull request #684 from ionite34/downmerge
mohnjiles Jun 19, 2024
d0a3af4
Merge branch 'dev' into fix-pyvenv
ionite34 Jun 19, 2024
4ff818f
Merge pull request #682 from ionite34/fix-pyvenv
ionite34 Jun 19, 2024
2f6172c
Update changelog
ionite34 Jun 19, 2024
c31ba98
Merge pull request #686 from ionite34/changelog
ionite34 Jun 19, 2024
f515fcf
Merge pull request #687 from ionite34/dev
mohnjiles Jun 19, 2024
1825be9
Merge pull request #685 from ionite34/2.11.1
mohnjiles Jun 19, 2024
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
39 changes: 39 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Close stale issues'

permissions:
issues: write
pull-requests: write

on:
workflow_dispatch:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is pending because it has been awaiting a response for 14 days with no activity. Remove the pending label or comment, else this will be closed in 5 days.'
close-issue-message: 'This issue was closed because it has been pending for 5 days with no activity.'
only-labels: 'awaiting-feedback'
stale-issue-label: 'pending'
exempt-issue-labels: 'planned,milestone,work-in-progress'
days-before-issue-stale: 14
days-before-issue-close: 5
days-before-pr-close: -1
days-before-pr-stale: -1
operations-per-run: 45

- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove the stale label or comment, else this will be closed in 5 days.'
close-issue-message: 'This issue was closed because it has been stale for 5 days with no activity.'
stale-issue-label: 'stale'
exempt-issue-labels: 'planned,milestone,work-in-progress'
days-before-issue-stale: 30
days-before-issue-close: 5
days-before-pr-close: -1
days-before-pr-stale: -1
operations-per-run: 45
17 changes: 17 additions & 0 deletions 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.11.1
### Added
- Added Rename option back to the Checkpoints page
### Changed
- Unobserved Task Exceptions across the app will now show a toast notification to aid in debugging
- Updated SD.Next Package details and thumbnail - [#697](https://github.com/LykosAI/StabilityMatrix/pull/697)
### Fixed
- Fixed [#689](https://github.com/LykosAI/StabilityMatrix/issues/689) - New ComfyUI installs encountering launch error due to torch 2.0.0 update, added pinned `numpy==1.26.4` to install and update.
- Fixed Inference image mask editor's 'Load Mask' not able to load image files
- Fixed Fooocus ControlNet default config shared folder mode not taking effect
- Fixed tkinter python libraries not working on macOS with 'Can't find a usable init.tcl' error
### Supporters
#### Visionaries
- Shoutout to our Visionary-tier supporters on Patreon, **Scopp Mcdee** and **Waterclouds**! Your generous support is appreciated and helps us continue to make Stability Matrix better for everyone!
#### Pioneers
- A big thank you to our Pioneer-tier supporters on Patreon, **tankfox** and **tanangular**! Your support helps us continue to improve Stability Matrix!

## v2.11.0
### Added
#### Packages
Expand Down
31 changes: 31 additions & 0 deletions StabilityMatrix.Avalonia/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ private void ShowMainWindow()
DesktopLifetime.ShutdownRequested += OnShutdownRequested;

AppDomain.CurrentDomain.ProcessExit += OnExit;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;

// Since we're manually shutting down NLog in OnExit
LogManager.AutoShutdown = false;
Expand Down Expand Up @@ -883,6 +884,36 @@ private void OnExit(object? sender, EventArgs _)
}
}

private static void TaskScheduler_UnobservedTaskException(
object? sender,
UnobservedTaskExceptionEventArgs e
)
{
if (e.Exception is not Exception unobservedEx)
return;

try
{
var notificationService = Services.GetRequiredService<INotificationService>();

Dispatcher.UIThread.Invoke(() =>
{
var originException = unobservedEx.InnerException ?? unobservedEx;
notificationService.ShowPersistent(
$"Unobserved Task Exception - {originException.GetType().Name}",
originException.Message
);
});

// Consider the exception observed if we were able to show a notification
e.SetObserved();
}
catch (Exception ex)
{
Logger.Error(ex, "Failed to show Unobserved Task Exception notification");
}
}

private static LoggingConfiguration ConfigureLogging()
{
var setupBuilder = LogManager.Setup();
Expand Down
2 changes: 2 additions & 0 deletions StabilityMatrix.Avalonia/DesignData/DesignData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ public static void Initialize()
new MockModelIndexService(),
notificationService,
dialogFactory,
null,
new LocalModelFile
{
SharedFolderType = SharedFolderType.StableDiffusion,
Expand Down Expand Up @@ -356,6 +357,7 @@ public static void Initialize()
new MockModelIndexService(),
notificationService,
dialogFactory,
null,
new LocalModelFile
{
RelativePath = "~/Models/Lora/model.safetensors",
Expand Down
2 changes: 1 addition & 1 deletion StabilityMatrix.Avalonia/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ UnobservedTaskExceptionEventArgs e
{
if (e.Exception is Exception ex)
{
Logger.Error(ex, "Unobserved task exception");
Logger.Error(ex, "Unobserved Task Exception");
}
}

Expand Down
2 changes: 1 addition & 1 deletion StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>./Assets/Icon.ico</ApplicationIcon>
<Version>2.11.0-dev.999</Version>
<Version>2.12.0-dev.999</Version>
<InformationalVersion>$(Version)</InformationalVersion>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System;
using System.Collections.Immutable;
using System.ComponentModel;
using System.IO;
using System.Threading.Tasks;
using Avalonia.Controls.Notifications;
using Avalonia.Data;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using FluentAvalonia.UI.Controls;
using Microsoft.Extensions.Logging;
using StabilityMatrix.Avalonia.Services;
using StabilityMatrix.Avalonia.ViewModels.Base;
using StabilityMatrix.Avalonia.ViewModels.Dialogs;
Expand Down Expand Up @@ -36,6 +39,7 @@ public partial class CheckpointFileViewModel : SelectableViewModelBase
private readonly IModelIndexService modelIndexService;
private readonly INotificationService notificationService;
private readonly ServiceManager<ViewModelBase> vmFactory;
private readonly ILogger logger;

public bool CanShowTriggerWords => CheckpointFile.ConnectedModelInfo?.TrainedWords?.Length > 0;
public string BaseModelName => CheckpointFile.ConnectedModelInfo?.BaseModel ?? string.Empty;
Expand All @@ -47,13 +51,15 @@ public CheckpointFileViewModel(
IModelIndexService modelIndexService,
INotificationService notificationService,
ServiceManager<ViewModelBase> vmFactory,
ILogger logger,
LocalModelFile checkpointFile
)
{
this.settingsManager = settingsManager;
this.modelIndexService = modelIndexService;
this.notificationService = notificationService;
this.vmFactory = vmFactory;
this.logger = logger;
CheckpointFile = checkpointFile;
ThumbnailUri = settingsManager.IsLibraryDirSet
? CheckpointFile.GetPreviewImageFullPath(settingsManager.ModelsDirectory)
Expand Down Expand Up @@ -186,4 +192,71 @@ private async Task DeleteAsync(bool showConfirmation = true)

await modelIndexService.RemoveModelAsync(CheckpointFile);
}

[RelayCommand]
private async Task RenameAsync()
{
// Parent folder path
var parentPath =
Path.GetDirectoryName((string?)CheckpointFile.GetFullPath(settingsManager.ModelsDirectory)) ?? "";

var textFields = new TextBoxField[]
{
new()
{
Label = "File name",
Validator = text =>
{
if (string.IsNullOrWhiteSpace(text))
throw new DataValidationException("File name is required");

if (File.Exists(Path.Combine(parentPath, text)))
throw new DataValidationException("File name already exists");
},
Text = CheckpointFile.FileName
}
};

var dialog = DialogHelper.CreateTextEntryDialog("Rename Model", "", textFields);

if (await dialog.ShowAsync() == ContentDialogResult.Primary)
{
var name = textFields[0].Text;
var nameNoExt = Path.GetFileNameWithoutExtension(name);
var originalNameNoExt = Path.GetFileNameWithoutExtension(CheckpointFile.FileName);
// Rename file in OS
try
{
var newFilePath = Path.Combine(parentPath, name);
File.Move(CheckpointFile.GetFullPath(settingsManager.ModelsDirectory), newFilePath);

// If preview image exists, rename it too
var previewPath = CheckpointFile.GetPreviewImageFullPath(settingsManager.ModelsDirectory);
if (previewPath != null && File.Exists(previewPath))
{
var newPreviewImagePath = Path.Combine(
parentPath,
$"{nameNoExt}.preview{Path.GetExtension(previewPath)}"
);
File.Move(previewPath, newPreviewImagePath);
}

// If connected model info exists, rename it too (<name>.cm-info.json)
if (CheckpointFile.HasConnectedModel)
{
var cmInfoPath = Path.Combine(parentPath, $"{originalNameNoExt}.cm-info.json");
if (File.Exists(cmInfoPath))
{
File.Move(cmInfoPath, Path.Combine(parentPath, $"{nameNoExt}.cm-info.json"));
}
}

await modelIndexService.RefreshIndex();
}
catch (Exception e)
{
logger.LogError(e, "Failed to rename checkpoint file");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ or nameof(SortConnectedModelsFirst)
modelIndexService,
notificationService,
dialogFactory,
logger,
x
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel;
using System.Linq;
Expand Down Expand Up @@ -77,6 +76,9 @@ public partial class PaintCanvasViewModel(ILogger<PaintCanvasViewModel> logger)
[JsonIgnore]
private SKLayer BrushLayer => Layers["Brush"];

[JsonIgnore]
private SKLayer ImagesLayer => Layers["Images"];

[JsonIgnore]
private SKLayer BackgroundLayer => Layers["Background"];

Expand All @@ -99,9 +101,6 @@ public SKBitmap? BackgroundImage
}
}

[JsonIgnore]
public List<SKBitmap> LayerImages { get; } = [];

/// <summary>
/// Set by <see cref="PaintCanvas"/> to allow the view model to
/// refresh the canvas view after updating points or bitmap layers.
Expand All @@ -117,8 +116,7 @@ public void SetSourceCanvas(SKCanvas canvas)

public void LoadCanvasFromBitmap(SKBitmap bitmap)
{
LayerImages.Clear();
LayerImages.Add(bitmap);
ImagesLayer.Bitmaps = [bitmap];

RefreshCanvas?.Invoke();
}
Expand Down
4 changes: 2 additions & 2 deletions StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@
IsVisible="{Binding CheckpointFile.HasConnectedModel}" />

<ui:MenuFlyoutSeparator />
<!-- <ui:MenuFlyoutItem Command="{Binding RenameCommand}" -->
<!-- Text="{x:Static lang:Resources.Action_Rename}" IconSource="Rename" /> -->
<ui:MenuFlyoutItem Command="{Binding RenameCommand}"
Text="{x:Static lang:Resources.Action_Rename}" IconSource="Rename" />
<ui:MenuFlyoutItem Command="{Binding DeleteCommand}"
CommandParameter="{StaticResource True}"
Text="{x:Static lang:Resources.Action_Delete}"
Expand Down
Loading
Loading