Class ModelPatternTokens
- Namespace
- CivitaiSharp.Tools.Downloads.Patterns
- Assembly
- CivitaiSharp.Tools.dll
Defines valid tokens for model file path patterns and extracts token values from model files.
public static class ModelPatternTokens
- Inheritance
-
ModelPatternTokens
- Inherited Members
Properties
AllTokens
The set of all valid token names when both ModelFile and ModelVersion are available.
public static FrozenSet<string> AllTokens { get; }
Property Value
FileOnlyTokens
The set of valid token names when only a ModelFile is available.
public static FrozenSet<string> FileOnlyTokens { get; }
Property Value
Methods
ExtractTokenValues(ModelFile)
Extracts token values from a model file for use in path pattern processing.
public static Dictionary<string, string> ExtractTokenValues(ModelFile file)
Parameters
fileModelFileThe model file to extract values from.
Returns
- Dictionary<string, string>
A dictionary mapping token names to their values.
ExtractTokenValues(ModelFile, ModelVersion)
Extracts token values from a model file and model version for use in path pattern processing.
public static Dictionary<string, string> ExtractTokenValues(ModelFile file, ModelVersion version)
Parameters
fileModelFileThe model file to extract values from.
versionModelVersionThe model version providing additional context.
Returns
- Dictionary<string, string>
A dictionary mapping token names to their values.
GetValidTokens(bool)
Determines the appropriate set of valid tokens based on whether a version is provided.
public static FrozenSet<string> GetValidTokens(bool hasVersion)
Parameters
hasVersionboolWhether a ModelVersion is available.