Table of Contents

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

Id long

The unique identifier for the model. Maps to JSON property "id".

Name string

The name of the model. Maps to JSON property "name".

Description string

The description of the model formatted as HTML. Maps to JSON property "description".

Type ModelType

The model type (e.g., "Checkpoint", "TextualInversion", "LORA", "Controlnet"). Maps to JSON property "type".

IsNsfw bool

Indicates whether the model is not safe for work content. Maps to JSON property "nsfw".

NsfwLevel int

The NSFW content level of the model on a numeric scale. Maps to JSON property "nsfwLevel".

Tags IReadOnlyList<string>

Array of tags associated with the model for categorization. Maps to JSON property "tags".

Creator Creator

Information about the creator of this model. Maps to JSON property "creator".

Stats ModelStats

Statistical information about user interactions with this model. Maps to JSON property "stats".

ModelVersions IReadOnlyList<ModelVersion>

List of all versions of this model. Maps to JSON property "modelVersions".

AllowNoCredit bool

Indicates whether the model allows use without giving credit to the creator. Maps to JSON property "allowNoCredit".

AllowDerivatives bool

Indicates whether the model allows creation of derivative works. Maps to JSON property "allowDerivatives".

AllowDifferentLicense bool

Indicates whether derivatives of this model are allowed to have a different license. Maps to JSON property "allowDifferentLicense".

AllowCommercialUse IReadOnlyList<CommercialUsePermission>

Array of commercial use permission types (e.g., "Image", "Rent", "Sell"). Maps to JSON property "allowCommercialUse".

IsPersonOfInterest bool

Indicates whether the model is of a person of interest. Maps to JSON property "poi".

Minor bool

Indicates whether the model involves a minor. Maps to JSON property "minor".

IsSafeForWorkOnly bool

Indicates whether the model is safe for work content only. Maps to JSON property "sfwOnly".

Availability Availability?

The availability status of the model (e.g., "Public", "Archived"). Maps to JSON property "availability".

Cosmetic string

Cosmetic information or display metadata for the model. Maps to JSON property "cosmetic".

SupportsGeneration bool

Indicates whether this model supports generation capabilities. Maps to JSON property "supportsGeneration".

UserId long?

The user ID of the creator who uploaded this model. Maps to JSON property "userId".

DownloadUrl string

Convenience download URL for the model. Maps to JSON property "downloadUrl".

Mode ModelMode?

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

IReadOnlyList<CommercialUsePermission>

AllowDerivatives

Indicates whether the model allows creation of derivative works. Maps to JSON property "allowDerivatives".

[JsonPropertyName("allowDerivatives")]
public bool AllowDerivatives { get; init; }

Property Value

bool

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

bool

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

bool

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

Availability?

Cosmetic

Cosmetic information or display metadata for the model. Maps to JSON property "cosmetic".

[JsonPropertyName("cosmetic")]
public string? Cosmetic { get; init; }

Property Value

string

Creator

Information about the creator of this model. Maps to JSON property "creator".

[JsonPropertyName("creator")]
public Creator? Creator { get; init; }

Property Value

Creator

Description

The description of the model formatted as HTML. Maps to JSON property "description".

[JsonPropertyName("description")]
public string? Description { get; init; }

Property Value

string

DownloadUrl

Convenience download URL for the model. Maps to JSON property "downloadUrl".

[JsonPropertyName("downloadUrl")]
public string? DownloadUrl { get; init; }

Property Value

string

Id

The unique identifier for the model. Maps to JSON property "id".

[JsonPropertyName("id")]
public long Id { get; init; }

Property Value

long

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

bool

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

bool

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

bool

Minor

Indicates whether the model involves a minor. Maps to JSON property "minor".

[JsonPropertyName("minor")]
public bool Minor { get; init; }

Property Value

bool

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

ModelMode?

ModelVersions

List of all versions of this model. Maps to JSON property "modelVersions".

[JsonPropertyName("modelVersions")]
public IReadOnlyList<ModelVersion>? ModelVersions { get; init; }

Property Value

IReadOnlyList<ModelVersion>

Name

The name of the model. Maps to JSON property "name".

[JsonPropertyName("name")]
public string Name { get; init; }

Property Value

string

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

int

Stats

Statistical information about user interactions with this model. Maps to JSON property "stats".

[JsonPropertyName("stats")]
public ModelStats? Stats { get; init; }

Property Value

ModelStats

SupportsGeneration

Indicates whether this model supports generation capabilities. Maps to JSON property "supportsGeneration".

[JsonPropertyName("supportsGeneration")]
public bool SupportsGeneration { get; init; }

Property Value

bool

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

IReadOnlyList<string>

Type

The model type (e.g., "Checkpoint", "TextualInversion", "LORA", "Controlnet"). Maps to JSON property "type".

[JsonPropertyName("type")]
public ModelType Type { get; init; }

Property Value

ModelType

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?