Browse Source

Merge branch 'dev' into fix-inference-inherit-addons

pull/629/head
Ionite 8 months ago committed by GitHub
parent
commit
c119a3be91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 19
      StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs

1
CHANGELOG.md

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
## v2.10.0-dev.3
### Fixed
- Fixed Inference HiresFix module "Inherit Primary Sampler Addons" setting not effectively disabling when unchecked
- Fix model download location options for VAEs in the CivitAI Model Browser
## v2.10.0-dev.2
### Added

19
StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs

@ -91,7 +91,6 @@ public partial class SelectModelVersionViewModel(
{
SelectedVersionViewModel = Versions[0];
CanGoToNextImage = true;
LoadInstallLocations();
}
partial void OnSelectedVersionViewModelChanged(ModelVersionViewModel? value)
@ -130,6 +129,8 @@ public partial class SelectModelVersionViewModel(
var canImport = true;
if (settingsManager.IsLibraryDirSet)
{
LoadInstallLocations();
var fileSizeBytes = value?.CivitFile.SizeKb * 1024;
var freeSizeBytes =
SystemInfo.GetDiskFreeSpaceBytes(settingsManager.ModelsDirectory) ?? long.MaxValue;
@ -151,9 +152,9 @@ public partial class SelectModelVersionViewModel(
IsImportEnabled = value?.CivitFile != null && canImport && !ShowEmptyPathWarning;
}
partial void OnSelectedInstallLocationChanged(string value)
partial void OnSelectedInstallLocationChanged(string? value)
{
if (value.Equals("Custom...", StringComparison.OrdinalIgnoreCase))
if (value?.Equals("Custom...", StringComparison.OrdinalIgnoreCase) is true)
{
Dispatcher.UIThread.InvokeAsync(SelectCustomFolder);
}
@ -304,14 +305,16 @@ public partial class SelectModelVersionViewModel(
private void LoadInstallLocations()
{
var installLocations = new ObservableCollection<string>();
var rootModelsDirectory = new DirectoryPath(settingsManager.ModelsDirectory);
var downloadDirectory = rootModelsDirectory.JoinDir(
CivitModel.Type.ConvertTo<SharedFolderType>().GetStringValue()
SelectedFile?.CivitFile.Type == CivitFileType.VAE
? SharedFolderType.VAE.GetStringValue()
: CivitModel.Type.ConvertTo<SharedFolderType>().GetStringValue()
);
var installLocations = new ObservableCollection<string>
{
downloadDirectory.ToString().Replace(rootModelsDirectory, "Models")
};
installLocations.Add(downloadDirectory.ToString().Replace(rootModelsDirectory, "Models"));
foreach (var directory in downloadDirectory.EnumerateDirectories())
{

Loading…
Cancel
Save