Table of Contents

Class Image

Namespace
CivitaiSharp.Core.Models
Assembly
CivitaiSharp.Core.dll

Image returned by the public API.

public sealed record Image : IEquatable<Image>
Inheritance
Image
Implements
Inherited Members

Constructors

Image(long, string, string?, int, int, ImageNsfwLevel?, MediaType?, bool?, int?, DateTime?, long?, ImageStats?, ImageMeta?, string?, string?, IReadOnlyList<long>?)

Image returned by the public API.

public Image(long Id, string Url, string? Hash, int Width, int Height, ImageNsfwLevel? NsfwLevel, MediaType? Type, bool? IsNsfw, int? BrowsingLevel, DateTime? CreatedAt, long? PostId, ImageStats? Stats, ImageMeta? Meta, string? Username, string? BaseModel, IReadOnlyList<long>? ModelVersionIds)

Parameters

Id long

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

Url string

The URL of the image at its source resolution. Maps to JSON property "url".

Hash string

The blurhash of the image for placeholder generation. Maps to JSON property "hash".

Width int

The width of the image in pixels. Maps to JSON property "width".

Height int

The height of the image in pixels. Maps to JSON property "height".

NsfwLevel ImageNsfwLevel?

The NSFW content level of the image (e.g., "None", "Soft", "Mature", "X"). Maps to JSON property "nsfwLevel".

Type MediaType?

The type of media represented by this image (e.g., "image"). Maps to JSON property "type".

IsNsfw bool?

Indicates whether the image has any mature content labels applied. Maps to JSON property "nsfw".

BrowsingLevel int?

The browsing level threshold for viewing this image. Maps to JSON property "browsingLevel".

CreatedAt DateTime?

The date and time when the image was posted. Maps to JSON property "createdAt".

PostId long?

The unique identifier of the post this image belongs to. Maps to JSON property "postId".

Stats ImageStats

Statistical information about user reactions to this image. Maps to JSON property "stats".

Meta ImageMeta

Generation metadata and parameters used to create this image. Maps to JSON property "meta".

Username string

The username of the creator who posted this image. Maps to JSON property "username".

BaseModel string

The base model used for image generation (e.g., "Pony", "Flux.1 D", "SDXL 1.0"). Maps to JSON property "baseModel".

ModelVersionIds IReadOnlyList<long>

Array of model version IDs used to generate this image. Maps to JSON property "modelVersionIds".

Properties

BaseModel

The base model used for image generation (e.g., "Pony", "Flux.1 D", "SDXL 1.0"). Maps to JSON property "baseModel".

[JsonPropertyName("baseModel")]
public string? BaseModel { get; init; }

Property Value

string

BrowsingLevel

The browsing level threshold for viewing this image. Maps to JSON property "browsingLevel".

[JsonPropertyName("browsingLevel")]
public int? BrowsingLevel { get; init; }

Property Value

int?

CreatedAt

The date and time when the image was posted. Maps to JSON property "createdAt".

[JsonPropertyName("createdAt")]
public DateTime? CreatedAt { get; init; }

Property Value

DateTime?

Hash

The blurhash of the image for placeholder generation. Maps to JSON property "hash".

[JsonPropertyName("hash")]
public string? Hash { get; init; }

Property Value

string

Height

The height of the image in pixels. Maps to JSON property "height".

[JsonPropertyName("height")]
public int Height { get; init; }

Property Value

int

Id

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

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

Property Value

long

IsNsfw

Indicates whether the image has any mature content labels applied. Maps to JSON property "nsfw".

[JsonPropertyName("nsfw")]
public bool? IsNsfw { get; init; }

Property Value

bool?

Meta

Generation metadata and parameters used to create this image. Maps to JSON property "meta".

[JsonPropertyName("meta")]
public ImageMeta? Meta { get; init; }

Property Value

ImageMeta

ModelVersionIds

Array of model version IDs used to generate this image. Maps to JSON property "modelVersionIds".

[JsonPropertyName("modelVersionIds")]
public IReadOnlyList<long>? ModelVersionIds { get; init; }

Property Value

IReadOnlyList<long>

NsfwLevel

The NSFW content level of the image (e.g., "None", "Soft", "Mature", "X"). Maps to JSON property "nsfwLevel".

[JsonPropertyName("nsfwLevel")]
public ImageNsfwLevel? NsfwLevel { get; init; }

Property Value

ImageNsfwLevel?

PostId

The unique identifier of the post this image belongs to. Maps to JSON property "postId".

[JsonPropertyName("postId")]
public long? PostId { get; init; }

Property Value

long?

Stats

Statistical information about user reactions to this image. Maps to JSON property "stats".

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

Property Value

ImageStats

Type

The type of media represented by this image (e.g., "image"). Maps to JSON property "type".

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

Property Value

MediaType?

Url

The URL of the image at its source resolution. Maps to JSON property "url".

[JsonPropertyName("url")]
public string Url { get; init; }

Property Value

string

Username

The username of the creator who posted this image. Maps to JSON property "username".

[JsonPropertyName("username")]
public string? Username { get; init; }

Property Value

string

Width

The width of the image in pixels. Maps to JSON property "width".

[JsonPropertyName("width")]
public int Width { get; init; }

Property Value

int