Class ModelVersion
- Namespace
- CivitaiSharp.Core.Models
- Assembly
- CivitaiSharp.Core.dll
Represents a model version. When embedded in a Model response, some fields may be null. When fetched directly via /model-versions/:id, additional fields like Model and ModelId are populated.
public sealed record ModelVersion : IEquatable<ModelVersion>
- Inheritance
-
ModelVersion
- Implements
- Inherited Members
- Extension Methods
Constructors
ModelVersion(long, int?, long?, string, string, string?, string?, DateTime, DateTime?, DateTime?, string?, Availability?, int, string?, bool, IReadOnlyList<string>?, string?, JsonElement?, DateTime?, JsonElement?, string?, string?, string?, ModelVersionModel?, IReadOnlyList<ModelFile>?, IReadOnlyList<ModelVersionImage>?, ModelVersionStats?)
Represents a model version. When embedded in a Model response, some fields may be null. When fetched directly via /model-versions/:id, additional fields like Model and ModelId are populated.
public ModelVersion(long Id, int? Index, long? ModelId, string Name, string BaseModel, string? BaseModelType, string? Description, DateTime CreatedAt, DateTime? UpdatedAt, DateTime? PublishedAt, string? Status, Availability? Availability, int NsfwLevel, string? DownloadUrl, bool SupportsGeneration, IReadOnlyList<string>? TrainedWords, string? TrainingStatus, JsonElement? TrainingDetails, DateTime? EarlyAccessEndsAt, JsonElement? EarlyAccessConfig, string? UploadType, string? UsageControl, string? AirIdentifier, ModelVersionModel? Model, IReadOnlyList<ModelFile>? Files, IReadOnlyList<ModelVersionImage>? Images, ModelVersionStats? Stats)
Parameters
IdlongThe unique identifier for the model version. Maps to JSON property "id".
Indexint?The index/order of this version among all versions of the parent model. Maps to JSON property "index".
ModelIdlong?The unique identifier of the parent model. Maps to JSON property "modelId".
NamestringThe name of the model version. Maps to JSON property "name".
BaseModelstringThe base model this version was trained on (e.g., "SDXL 1.0", "SD 1.5", "Pony"). Maps to JSON property "baseModel".
BaseModelTypestringThe base model type classification. Maps to JSON property "baseModelType".
DescriptionstringThe description of the version, usually a changelog of updates. Maps to JSON property "description".
CreatedAtDateTimeThe date and time when this version was created. Maps to JSON property "createdAt".
UpdatedAtDateTime?The date and time when this version was last updated. Maps to JSON property "updatedAt".
PublishedAtDateTime?The date and time when this version was published. Maps to JSON property "publishedAt".
StatusstringThe publication status of the version (e.g., "Published", "Draft"). Maps to JSON property "status".
AvailabilityAvailability?The availability status of the version. Maps to JSON property "availability".
NsfwLevelintThe NSFW content level of the version on a numeric scale. Maps to JSON property "nsfwLevel".
DownloadUrlstringDirect download URL for this specific version. Maps to JSON property "downloadUrl".
SupportsGenerationboolIndicates whether this version supports generation capabilities. Maps to JSON property "supportsGeneration".
TrainedWordsIReadOnlyList<string>Array of trigger words or phrases used to activate this model in generation. Maps to JSON property "trainedWords".
TrainingStatusstringThe status of any ongoing training job for this version. Maps to JSON property "trainingStatus".
TrainingDetailsJsonElement?Detailed metadata about the training process if applicable. Maps to JSON property "trainingDetails".
This property uses JsonElement because the Civitai API returns highly variable structures for training details depending on the training workflow. The JSON structure is not documented by the API, nor is the data consistent. Use TryGetProperty(string, out JsonElement) to safely access nested values.
EarlyAccessEndsAtDateTime?The date and time when early access restrictions end for this version. Maps to JSON property "earlyAccessEndsAt".
EarlyAccessConfigJsonElement?Configuration settings for early access restrictions. Maps to JSON property "earlyAccessConfig".
This property uses JsonElement because the Civitai API returns highly variable structures for early access configuration. The JSON structure is not documented by the API, nor is the data consistent. Use TryGetProperty(string, out JsonElement) to safely access nested values.
UploadTypestringThe method by which this version was uploaded (e.g., "Created", "Imported"). Maps to JSON property "uploadType".
UsageControlstringThe usage control type for this version (e.g., "Download"). Maps to JSON property "usageControl".
AirIdentifierstringThe AIR artifact identifier for this version. Maps to JSON property "air".
ModelModelVersionModelAbbreviated information about the parent model. Maps to JSON property "model".
FilesIReadOnlyList<ModelFile>List of files included in this model version. Maps to JSON property "files".
ImagesIReadOnlyList<ModelVersionImage>Gallery images showcasing example outputs from this model version. Maps to JSON property "images".
StatsModelVersionStatsStatistical information about user interactions with this model version. Maps to JSON property "stats".
Properties
AirIdentifier
The AIR artifact identifier for this version. Maps to JSON property "air".
[JsonPropertyName("air")]
public string? AirIdentifier { get; init; }
Property Value
Availability
The availability status of the version. Maps to JSON property "availability".
[JsonPropertyName("availability")]
public Availability? Availability { get; init; }
Property Value
BaseModel
The base model this version was trained on (e.g., "SDXL 1.0", "SD 1.5", "Pony"). Maps to JSON property "baseModel".
[JsonPropertyName("baseModel")]
public string BaseModel { get; init; }
Property Value
BaseModelType
The base model type classification. Maps to JSON property "baseModelType".
[JsonPropertyName("baseModelType")]
public string? BaseModelType { get; init; }
Property Value
CreatedAt
The date and time when this version was created. Maps to JSON property "createdAt".
[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; init; }
Property Value
Description
The description of the version, usually a changelog of updates. Maps to JSON property "description".
[JsonPropertyName("description")]
public string? Description { get; init; }
Property Value
DownloadUrl
Direct download URL for this specific version. Maps to JSON property "downloadUrl".
[JsonPropertyName("downloadUrl")]
public string? DownloadUrl { get; init; }
Property Value
EarlyAccessConfig
Configuration settings for early access restrictions. Maps to JSON property "earlyAccessConfig".
This property uses JsonElement because the Civitai API returns highly variable structures for early access configuration. The JSON structure is not documented by the API, nor is the data consistent. Use TryGetProperty(string, out JsonElement) to safely access nested values.
[JsonPropertyName("earlyAccessConfig")]
public JsonElement? EarlyAccessConfig { get; init; }
Property Value
EarlyAccessEndsAt
The date and time when early access restrictions end for this version. Maps to JSON property "earlyAccessEndsAt".
[JsonPropertyName("earlyAccessEndsAt")]
public DateTime? EarlyAccessEndsAt { get; init; }
Property Value
Files
List of files included in this model version. Maps to JSON property "files".
[JsonPropertyName("files")]
public IReadOnlyList<ModelFile>? Files { get; init; }
Property Value
Id
The unique identifier for the model version. Maps to JSON property "id".
[JsonPropertyName("id")]
public long Id { get; init; }
Property Value
Images
Gallery images showcasing example outputs from this model version. Maps to JSON property "images".
[JsonPropertyName("images")]
public IReadOnlyList<ModelVersionImage>? Images { get; init; }
Property Value
Index
The index/order of this version among all versions of the parent model. Maps to JSON property "index".
[JsonPropertyName("index")]
public int? Index { get; init; }
Property Value
- int?
Model
Abbreviated information about the parent model. Maps to JSON property "model".
[JsonPropertyName("model")]
public ModelVersionModel? Model { get; init; }
Property Value
ModelId
The unique identifier of the parent model. Maps to JSON property "modelId".
[JsonPropertyName("modelId")]
public long? ModelId { get; init; }
Property Value
- long?
Name
The name of the model version. Maps to JSON property "name".
[JsonPropertyName("name")]
public string Name { get; init; }
Property Value
NsfwLevel
The NSFW content level of the version on a numeric scale. Maps to JSON property "nsfwLevel".
[JsonPropertyName("nsfwLevel")]
public int NsfwLevel { get; init; }
Property Value
PublishedAt
The date and time when this version was published. Maps to JSON property "publishedAt".
[JsonPropertyName("publishedAt")]
public DateTime? PublishedAt { get; init; }
Property Value
Stats
Statistical information about user interactions with this model version. Maps to JSON property "stats".
[JsonPropertyName("stats")]
public ModelVersionStats? Stats { get; init; }
Property Value
Status
The publication status of the version (e.g., "Published", "Draft"). Maps to JSON property "status".
[JsonPropertyName("status")]
public string? Status { get; init; }
Property Value
SupportsGeneration
Indicates whether this version supports generation capabilities. Maps to JSON property "supportsGeneration".
[JsonPropertyName("supportsGeneration")]
public bool SupportsGeneration { get; init; }
Property Value
TrainedWords
Array of trigger words or phrases used to activate this model in generation. Maps to JSON property "trainedWords".
[JsonPropertyName("trainedWords")]
public IReadOnlyList<string>? TrainedWords { get; init; }
Property Value
TrainingDetails
Detailed metadata about the training process if applicable. Maps to JSON property "trainingDetails".
This property uses JsonElement because the Civitai API returns highly variable structures for training details depending on the training workflow. The JSON structure is not documented by the API, nor is the data consistent. Use TryGetProperty(string, out JsonElement) to safely access nested values.
[JsonPropertyName("trainingDetails")]
public JsonElement? TrainingDetails { get; init; }
Property Value
TrainingStatus
The status of any ongoing training job for this version. Maps to JSON property "trainingStatus".
[JsonPropertyName("trainingStatus")]
public string? TrainingStatus { get; init; }
Property Value
UpdatedAt
The date and time when this version was last updated. Maps to JSON property "updatedAt".
[JsonPropertyName("updatedAt")]
public DateTime? UpdatedAt { get; init; }
Property Value
UploadType
The method by which this version was uploaded (e.g., "Created", "Imported"). Maps to JSON property "uploadType".
[JsonPropertyName("uploadType")]
public string? UploadType { get; init; }
Property Value
UsageControl
The usage control type for this version (e.g., "Download"). Maps to JSON property "usageControl".
[JsonPropertyName("usageControl")]
public string? UsageControl { get; init; }