diff --git a/CHANGELOG.md b/CHANGELOG.md index eb016570..cfa30ec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,10 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 #### Visionaries - Shoutout to our Visionary-tier Patreon supporters, **Scopp Mcdee**, **Waterclouds**, and our newest Visionary, **Akiro_Senkai**! Many thanks for your generous support! +## v2.11.8 +### Fixed +- Fixed CivitAI model browser not loading search results + ## v2.11.7 ### Changed - Forge will use the recommended pytorch version 2.3.1 the next time it is updated diff --git a/StabilityMatrix.Avalonia/DesignData/DesignData.cs b/StabilityMatrix.Avalonia/DesignData/DesignData.cs index d55aa06e..3e5b5914 100644 --- a/StabilityMatrix.Avalonia/DesignData/DesignData.cs +++ b/StabilityMatrix.Avalonia/DesignData/DesignData.cs @@ -346,8 +346,8 @@ public static void Initialize() FileMetadata = new CivitFileMetadata { Format = CivitModelFormat.SafeTensor, - Fp = CivitModelFpType.fp16, - Size = CivitModelSize.pruned, + Fp = "fp16", + Size = "pruned", }, TrainedWords = ["aurora", "lightning"] } @@ -636,8 +636,8 @@ public static UpdateSettingsViewModel UpdateSettingsViewModel Metadata = new CivitFileMetadata { Format = CivitModelFormat.SafeTensor, - Fp = CivitModelFpType.fp16, - Size = CivitModelSize.pruned + Fp = "fp16", + Size = "pruned" } }, new() @@ -647,8 +647,8 @@ public static UpdateSettingsViewModel UpdateSettingsViewModel Metadata = new CivitFileMetadata { Format = CivitModelFormat.SafeTensor, - Fp = CivitModelFpType.fp32, - Size = CivitModelSize.full + Fp = "fp32", + Size = "full" }, Hashes = new CivitFileHashes { BLAKE3 = "ABCD" } } diff --git a/StabilityMatrix.Avalonia/Services/ModelDownloadLinkHandler.cs b/StabilityMatrix.Avalonia/Services/ModelDownloadLinkHandler.cs index e893f30d..a8cd11d8 100644 --- a/StabilityMatrix.Avalonia/Services/ModelDownloadLinkHandler.cs +++ b/StabilityMatrix.Avalonia/Services/ModelDownloadLinkHandler.cs @@ -127,14 +127,16 @@ private void UriReceivedHandler(Uri receivedUri) x => x.Type == civitFileType && x.Metadata.Format == civitFormat ); - if (!string.IsNullOrWhiteSpace(fp) && Enum.TryParse(fp, out var fpType)) + if (!string.IsNullOrWhiteSpace(fp)) { - possibleFiles = possibleFiles?.Where(x => x.Metadata.Fp == fpType); + possibleFiles = possibleFiles?.Where( + x => x.Metadata.Fp != null && x.Metadata.Fp.Equals(fp, StringComparison.OrdinalIgnoreCase) + ); } - if (!string.IsNullOrWhiteSpace(size) && Enum.TryParse(size, out var modelSize)) + if (!string.IsNullOrWhiteSpace(size)) { - possibleFiles = possibleFiles?.Where(x => x.Metadata.Size == modelSize); + possibleFiles = possibleFiles?.Where(x => x.Metadata.Size != null && x.Metadata.Size == size); } possibleFiles = possibleFiles?.ToList(); diff --git a/StabilityMatrix.Core/Models/Api/CivitFileMetadata.cs b/StabilityMatrix.Core/Models/Api/CivitFileMetadata.cs index 04846ff6..81d1e8c0 100644 --- a/StabilityMatrix.Core/Models/Api/CivitFileMetadata.cs +++ b/StabilityMatrix.Core/Models/Api/CivitFileMetadata.cs @@ -5,11 +5,11 @@ namespace StabilityMatrix.Core.Models.Api; public class CivitFileMetadata { [JsonPropertyName("fp")] - public CivitModelFpType? Fp { get; set; } - + public string? Fp { get; set; } + [JsonPropertyName("size")] - public CivitModelSize? Size { get; set; } - + public string? Size { get; set; } + [JsonPropertyName("format")] public CivitModelFormat? Format { get; set; } }