Browse Source

Cleanup unused

pull/240/head
Ionite 1 year ago
parent
commit
62c083bba3
No known key found for this signature in database
  1. 19
      StabilityMatrix.Avalonia/Models/Inference/FileNameFormatProvider.cs

19
StabilityMatrix.Avalonia/Models/Inference/FileNameFormatProvider.cs

@ -31,8 +31,6 @@ public partial class FileNameFormatProvider
{ "time", () => DateTime.Now.ToString("HH-mm-ss") }
};
public (int Current, int Total)? BatchInfo { get; init; }
/// <summary>
/// Validate a format string
/// </summary>
@ -89,23 +87,8 @@ public partial class FileNameFormatProvider
}
/// <summary>
/// Return a string substituting the variables in the format string
/// Regex for matching contents within a curly brace.
/// </summary>
private string? GetSubstitution(string variable)
{
return variable switch
{
"seed" => GenerationParameters.Seed.ToString(),
"model_name" => GenerationParameters.ModelName,
"model_hash" => GenerationParameters.ModelHash,
"width" => GenerationParameters.Width.ToString(),
"height" => GenerationParameters.Height.ToString(),
"date" => DateTime.Now.ToString("yyyy-MM-dd"),
"time" => DateTime.Now.ToString("HH-mm-ss"),
_ => throw new ArgumentOutOfRangeException(nameof(variable), variable, null)
};
}
[GeneratedRegex(@"\{[a-z_]+\}")]
private static partial Regex BracketRegex();
}

Loading…
Cancel
Save