Browse Source

Add Diffusers model format and unknown handling

pull/298/head
Ionite 12 months ago
parent
commit
9e3e6a9c29
No known key found for this signature in database
  1. 1
      StabilityMatrix.Avalonia/App.axaml.cs
  2. 6
      StabilityMatrix.Core/Models/Api/CivitModelFormat.cs

1
StabilityMatrix.Avalonia/App.axaml.cs

@ -424,6 +424,7 @@ public sealed class App : Application
jsonSerializerOptions.Converters.Add(new ObjectToInferredTypesConverter());
jsonSerializerOptions.Converters.Add(new DefaultUnknownEnumConverter<CivitFileType>());
jsonSerializerOptions.Converters.Add(new DefaultUnknownEnumConverter<CivitModelType>());
jsonSerializerOptions.Converters.Add(new DefaultUnknownEnumConverter<CivitModelFormat>());
jsonSerializerOptions.Converters.Add(
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)
);

6
StabilityMatrix.Core/Models/Api/CivitModelFormat.cs

@ -1,12 +1,14 @@
using System.Text.Json.Serialization;
using StabilityMatrix.Core.Converters.Json;
namespace StabilityMatrix.Core.Models.Api;
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(DefaultUnknownEnumConverter<CivitModelFormat>))]
public enum CivitModelFormat
{
Unknown,
SafeTensor,
PickleTensor,
Diffusers,
Other
}

Loading…
Cancel
Save