You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
860 B
29 lines
860 B
using System; |
|
using StabilityMatrix.Avalonia.ViewModels.Inference; |
|
|
|
namespace StabilityMatrix.Avalonia.Models; |
|
|
|
public enum InferenceProjectType |
|
{ |
|
Unknown, |
|
TextToImage, |
|
ImageToImage, |
|
Inpainting, |
|
Upscale |
|
} |
|
|
|
public static class InferenceProjectTypeExtensions |
|
{ |
|
public static Type? ToViewModelType(this InferenceProjectType type) |
|
{ |
|
return type switch |
|
{ |
|
InferenceProjectType.TextToImage => typeof(InferenceTextToImageViewModel), |
|
InferenceProjectType.ImageToImage => typeof(InferenceImageToImageViewModel), |
|
InferenceProjectType.Inpainting => null, |
|
InferenceProjectType.Upscale => typeof(InferenceImageUpscaleViewModel), |
|
InferenceProjectType.Unknown => null, |
|
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null) |
|
}; |
|
} |
|
}
|
|
|