Browse Source

Merge pull request #599 from ionite34/fix-teaching-tip-spam

Fix Inference teaching tip showing more often & fix `--launch-package` argument not working
pull/629/head
JT 7 months ago committed by GitHub
parent
commit
662022e191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      CHANGELOG.md
  2. 2
      StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml
  3. 45
      StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs

5
CHANGELOG.md

@ -5,6 +5,11 @@ 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.10.1
### Fixed
- 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
## v2.10.0
### Added
- 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.

2
StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml

@ -72,7 +72,7 @@
<ui:TeachingTip
Target="{Binding #PART_HelpButton}"
Title="{x:Static lang:Resources.TeachingTip_InferencePromptHelpButton}"
IsOpen="{Binding IsHelpButtonTeachingTipOpen}"/>
IsOpen="{Binding IsHelpButtonTeachingTipOpen, Mode=TwoWay}"/>
</Panel>
<Button

45
StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs

@ -42,6 +42,7 @@ public partial class PackageManagerViewModel : PageViewModelBase
private readonly INotificationService notificationService;
private readonly INavigationService<NewPackageManagerViewModel> packageNavigationService;
private readonly ILogger<PackageManagerViewModel> logger;
private readonly RunningPackageService runningPackageService;
public override string Title => Resources.Label_Packages;
public override IconSource IconSource => new SymbolIconSource { Symbol = Symbol.Box, IsFilled = true };
@ -69,7 +70,8 @@ public partial class PackageManagerViewModel : PageViewModelBase
ServiceManager<ViewModelBase> dialogFactory,
INotificationService notificationService,
INavigationService<NewPackageManagerViewModel> packageNavigationService,
ILogger<PackageManagerViewModel> logger
ILogger<PackageManagerViewModel> logger,
RunningPackageService runningPackageService
)
{
this.settingsManager = settingsManager;
@ -77,6 +79,7 @@ public partial class PackageManagerViewModel : PageViewModelBase
this.notificationService = notificationService;
this.packageNavigationService = packageNavigationService;
this.logger = logger;
this.runningPackageService = runningPackageService;
EventManager.Instance.InstalledPackagesChanged += OnInstalledPackagesChanged;
EventManager.Instance.OneClickInstallFinished += OnOneClickInstallFinished;
@ -118,15 +121,39 @@ public partial class PackageManagerViewModel : PageViewModelBase
unknownInstalledPackages.Edit(s => s.Load(packages));
}
protected override async Task OnInitialLoadedAsync()
{
if (string.IsNullOrWhiteSpace(Program.Args.LaunchPackageName))
{
await base.OnInitialLoadedAsync();
return;
}
await LoadPackages();
var package = Packages.FirstOrDefault(x => x.DisplayName == Program.Args.LaunchPackageName);
if (package is not null)
{
await runningPackageService.StartPackage(package);
return;
}
package = Packages.FirstOrDefault(x => x.Id.ToString() == Program.Args.LaunchPackageName);
if (package is null)
{
await base.OnInitialLoadedAsync();
return;
}
await runningPackageService.StartPackage(package);
}
public override async Task OnLoadedAsync()
{
if (Design.IsDesignMode || !settingsManager.IsLibraryDirSet)
return;
installedPackages.EditDiff(settingsManager.Settings.InstalledPackages, InstalledPackage.Comparer);
var currentUnknown = await Task.Run(IndexUnknownPackages);
unknownInstalledPackages.Edit(s => s.Load(currentUnknown));
await LoadPackages();
timer.Start();
}
@ -142,6 +169,14 @@ public partial class PackageManagerViewModel : PageViewModelBase
NavigateToSubPage(typeof(PackageInstallBrowserViewModel));
}
private async Task LoadPackages()
{
installedPackages.EditDiff(settingsManager.Settings.InstalledPackages, InstalledPackage.Comparer);
var currentUnknown = await Task.Run(IndexUnknownPackages);
unknownInstalledPackages.Edit(s => s.Load(currentUnknown));
}
private async Task CheckPackagesForUpdates()
{
foreach (var package in PackageCards)

Loading…
Cancel
Save