diff --git a/CHANGELOG.md b/CHANGELOG.md index d06e9998..605190e8 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs index b992eb6e..9ef4c378 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs +++ b/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(); + var rootModelsDirectory = new DirectoryPath(settingsManager.ModelsDirectory); var downloadDirectory = rootModelsDirectory.JoinDir( - CivitModel.Type.ConvertTo().GetStringValue() + SelectedFile?.CivitFile.Type == CivitFileType.VAE + ? SharedFolderType.VAE.GetStringValue() + : CivitModel.Type.ConvertTo().GetStringValue() ); - var installLocations = new ObservableCollection - { - downloadDirectory.ToString().Replace(rootModelsDirectory, "Models") - }; + + installLocations.Add(downloadDirectory.ToString().Replace(rootModelsDirectory, "Models")); foreach (var directory in downloadDirectory.EnumerateDirectories()) {