Class Model
- Namespace
- CivitaiSharp.Core.Models
- Assembly
- CivitaiSharp.Core.dll
Model returned by the public API. This type mirrors the commonly returned fields from the /models endpoints including nested information such as creator, statistics and model versions so callers can inspect returned JSON without losing data.
public sealed record Model : IEquatable<Model>
- Inheritance
-
Model
- Implements
- Inherited Members
- Extension Methods
Constructors
Model(long, string, string?, ModelType, bool, int, IReadOnlyList<string>?, Creator?, ModelStats?, IReadOnlyList<ModelVersion>?, bool, bool, bool, IReadOnlyList<CommercialUsePermission>?, bool, bool, bool, Availability?, string?, bool, long?, string?, ModelMode?)
Model returned by the public API. This type mirrors the commonly returned fields from the /models endpoints including nested information such as creator, statistics and model versions so callers can inspect returned JSON without losing data.
public Model(long Id, string Name, string? Description, ModelType Type, bool IsNsfw, int NsfwLevel, IReadOnlyList<string>? Tags, Creator? Creator, ModelStats? Stats, IReadOnlyList<ModelVersion>? ModelVersions, bool AllowNoCredit, bool AllowDerivatives, bool AllowDifferentLicense, IReadOnlyList<CommercialUsePermission>? AllowCommercialUse, bool IsPersonOfInterest, bool Minor, bool IsSafeForWorkOnly, Availability? Availability, string? Cosmetic, bool SupportsGeneration, long? UserId, string? DownloadUrl, ModelMode? Mode)
Parameters
IdlongThe unique identifier for the model. Maps to JSON property "id".
NamestringThe name of the model. Maps to JSON property "name".
DescriptionstringThe description of the model formatted as HTML. Maps to JSON property "description".
TypeModelTypeThe model type (e.g., "Checkpoint", "TextualInversion", "LORA", "Controlnet"). Maps to JSON property "type".
IsNsfwboolIndicates whether the model is not safe for work content. Maps to JSON property "nsfw".
NsfwLevelintThe NSFW content level of the model on a numeric scale. Maps to JSON property "nsfwLevel".
TagsIReadOnlyList<string>Array of tags associated with the model for categorization. Maps to JSON property "tags".
CreatorCreatorInformation about the creator of this model. Maps to JSON property "creator".
StatsModelStatsStatistical information about user interactions with this model. Maps to JSON property "stats".
ModelVersionsIReadOnlyList<ModelVersion>List of all versions of this model. Maps to JSON property "modelVersions".
AllowNoCreditboolIndicates whether the model allows use without giving credit to the creator. Maps to JSON property "allowNoCredit".
AllowDerivativesboolIndicates whether the model allows creation of derivative works. Maps to JSON property "allowDerivatives".
AllowDifferentLicenseboolIndicates whether derivatives of this model are allowed to have a different license. Maps to JSON property "allowDifferentLicense".
AllowCommercialUseIReadOnlyList<CommercialUsePermission>Array of commercial use permission types (e.g., "Image", "Rent", "Sell"). Maps to JSON property "allowCommercialUse".
IsPersonOfInterestboolIndicates whether the model is of a person of interest. Maps to JSON property "poi".
MinorboolIndicates whether the model involves a minor. Maps to JSON property "minor".
IsSafeForWorkOnlyboolIndicates whether the model is safe for work content only. Maps to JSON property "sfwOnly".
AvailabilityAvailability?The availability status of the model (e.g., "Public", "Archived"). Maps to JSON property "availability".
CosmeticstringCosmetic information or display metadata for the model. Maps to JSON property "cosmetic".
SupportsGenerationboolIndicates whether this model supports generation capabilities. Maps to JSON property "supportsGeneration".
UserIdlong?The user ID of the creator who uploaded this model. Maps to JSON property "userId".
DownloadUrlstringConvenience download URL for the model. Maps to JSON property "downloadUrl".
ModeModelMode?The current mode of the model (e.g., "Archived", "TakenDown"). Maps to JSON property "mode".
Properties
AllowCommercialUse
Array of commercial use permission types (e.g., "Image", "Rent", "Sell"). Maps to JSON property "allowCommercialUse".
[JsonPropertyName("allowCommercialUse")]
public IReadOnlyList<CommercialUsePermission>? AllowCommercialUse { get; init; }
Property Value
AllowDerivatives
Indicates whether the model allows creation of derivative works. Maps to JSON property "allowDerivatives".
[JsonPropertyName("allowDerivatives")]
public bool AllowDerivatives { get; init; }
Property Value
AllowDifferentLicense
Indicates whether derivatives of this model are allowed to have a different license. Maps to JSON property "allowDifferentLicense".
[JsonPropertyName("allowDifferentLicense")]
public bool AllowDifferentLicense { get; init; }
Property Value
AllowNoCredit
Indicates whether the model allows use without giving credit to the creator. Maps to JSON property "allowNoCredit".
[JsonPropertyName("allowNoCredit")]
public bool AllowNoCredit { get; init; }
Property Value
Availability
The availability status of the model (e.g., "Public", "Archived"). Maps to JSON property "availability".
[JsonPropertyName("availability")]
public Availability? Availability { get; init; }
Property Value
Cosmetic
Cosmetic information or display metadata for the model. Maps to JSON property "cosmetic".
[JsonPropertyName("cosmetic")]
public string? Cosmetic { get; init; }
Property Value
Creator
Information about the creator of this model. Maps to JSON property "creator".
[JsonPropertyName("creator")]
public Creator? Creator { get; init; }
Property Value
Description
The description of the model formatted as HTML. Maps to JSON property "description".
[JsonPropertyName("description")]
public string? Description { get; init; }
Property Value
DownloadUrl
Convenience download URL for the model. Maps to JSON property "downloadUrl".
[JsonPropertyName("downloadUrl")]
public string? DownloadUrl { get; init; }
Property Value
Id
The unique identifier for the model. Maps to JSON property "id".
[JsonPropertyName("id")]
public long Id { get; init; }
Property Value
IsNsfw
Indicates whether the model is not safe for work content. Maps to JSON property "nsfw".
[JsonPropertyName("nsfw")]
public bool IsNsfw { get; init; }
Property Value
IsPersonOfInterest
Indicates whether the model is of a person of interest. Maps to JSON property "poi".
[JsonPropertyName("poi")]
public bool IsPersonOfInterest { get; init; }
Property Value
IsSafeForWorkOnly
Indicates whether the model is safe for work content only. Maps to JSON property "sfwOnly".
[JsonPropertyName("sfwOnly")]
public bool IsSafeForWorkOnly { get; init; }
Property Value
Minor
Indicates whether the model involves a minor. Maps to JSON property "minor".
[JsonPropertyName("minor")]
public bool Minor { get; init; }
Property Value
Mode
The current mode of the model (e.g., "Archived", "TakenDown"). Maps to JSON property "mode".
[JsonPropertyName("mode")]
public ModelMode? Mode { get; init; }
Property Value
ModelVersions
List of all versions of this model. Maps to JSON property "modelVersions".
[JsonPropertyName("modelVersions")]
public IReadOnlyList<ModelVersion>? ModelVersions { get; init; }
Property Value
Name
The name of the model. Maps to JSON property "name".
[JsonPropertyName("name")]
public string Name { get; init; }
Property Value
NsfwLevel
The NSFW content level of the model on a numeric scale. Maps to JSON property "nsfwLevel".
[JsonPropertyName("nsfwLevel")]
public int NsfwLevel { get; init; }
Property Value
Stats
Statistical information about user interactions with this model. Maps to JSON property "stats".
[JsonPropertyName("stats")]
public ModelStats? Stats { get; init; }
Property Value
SupportsGeneration
Indicates whether this model supports generation capabilities. Maps to JSON property "supportsGeneration".
[JsonPropertyName("supportsGeneration")]
public bool SupportsGeneration { get; init; }
Property Value
Tags
Array of tags associated with the model for categorization. Maps to JSON property "tags".
[JsonPropertyName("tags")]
public IReadOnlyList<string>? Tags { get; init; }
Property Value
Type
The model type (e.g., "Checkpoint", "TextualInversion", "LORA", "Controlnet"). Maps to JSON property "type".
[JsonPropertyName("type")]
public ModelType Type { get; init; }
Property Value
UserId
The user ID of the creator who uploaded this model. Maps to JSON property "userId".
[JsonPropertyName("userId")]
public long? UserId { get; init; }
Property Value
- long?