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.
31 lines
967 B
31 lines
967 B
using System; |
|
using StabilityMatrix.Avalonia.ViewModels.Inference; |
|
|
|
namespace StabilityMatrix.Avalonia.Models; |
|
|
|
public enum InferenceProjectType |
|
{ |
|
Unknown, |
|
TextToImage, |
|
ImageToImage, |
|
Inpainting, |
|
Upscale, |
|
ImageToVideo |
|
} |
|
|
|
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.ImageToVideo => typeof(InferenceImageToVideoViewModel), |
|
InferenceProjectType.Unknown => null, |
|
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null) |
|
}; |
|
} |
|
}
|
|
|