Table of Contents

Class ImageMeta

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

Generation metadata and parameters for an image.

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

Remarks

The meta object has a HIGHLY variable structure depending on the generation workflow (ComfyUI, A1111, etc.). This record captures common fields, but the full JSON may contain many additional fields. Use ExtensionData to access any fields not explicitly modeled.

Important: The variability and potential inconsistencies in this metadata are not caused by Civitai.com. This data originates from the program that created, edited, or generated the media (such as Automatic1111, ComfyUI, InvokeAI, or other generation tools). Each tool embeds its own metadata format, which Civitai passes through without modification.

This type uses init-only properties instead of a positional record to support JsonExtensionDataAttribute, which is incompatible with constructor parameters when using System.Text.Json source generation.

Properties

AdditionalResources

Additional resources used in the generation.

[JsonPropertyName("additionalResources")]
public IReadOnlyList<object>? AdditionalResources { get; init; }

Property Value

IReadOnlyList<object>

Remarks

This property uses IReadOnlyList<object> because the Civitai API returns highly variable structures for additional resources depending on the generation workflow. This is fine since the JSON structure is not documented by the API, nor is the data consistent.

BaseModel

The base model type (e.g., "Flux.1", "SDXL 1.0", "Pony").

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

Property Value

string

CivitaiResources

Civitai resources with type, model version ID, version name, and weight.

[JsonPropertyName("civitaiResources")]
public IReadOnlyList<CivitaiResource>? CivitaiResources { get; init; }

Property Value

IReadOnlyList<CivitaiResource>

ClipSkip

The number of tokens to skip in the CLIP model.

[JsonPropertyName("clipSkip")]
public int? ClipSkip { get; init; }

Property Value

int?

ComfyUiWorkflow

Raw ComfyUI workflow JSON for complex multi-step generations.

[JsonPropertyName("comfy")]
public string? ComfyUiWorkflow { get; init; }

Property Value

string

Remarks

The API property is named "comfy", but this C# property is named "ComfyUiWorkflow" for better readability and to clearly indicate it contains a ComfyUI workflow definition.

ConfigurationScale

The classifier-free guidance scale controlling prompt influence.

[JsonPropertyName("cfgScale")]
public decimal? ConfigurationScale { get; init; }

Property Value

decimal?

Remarks

The JSON property name is "cfgScale" from generation tools, but this C# property uses the full name "ConfigurationScale" for clarity.

ControlNets

ControlNet configurations used in generation.

[JsonPropertyName("controlNets")]
public IReadOnlyList<object>? ControlNets { get; init; }

Property Value

IReadOnlyList<object>

Remarks

This property uses IReadOnlyList<object> because the Civitai API returns highly variable structures for ControlNet configurations depending on the generation workflow. This is fine since the JSON structure is not documented by the API, nor is the data consistent.

CreatedDate

The date when the image was created (ISO format).

[JsonPropertyName("Created Date")]
public string? CreatedDate { get; init; }

Property Value

string

Denoise

The denoising strength for inpainting or image-to-image operations.

[JsonPropertyName("denoise")]
public decimal? Denoise { get; init; }

Property Value

decimal?

DenoisingStrength

The denoising strength applied during upscaling.

[JsonPropertyName("Denoising strength")]
public string? DenoisingStrength { get; init; }

Property Value

string

Draft

Indicates whether the image is a draft version.

[JsonPropertyName("draft")]
public bool? Draft { get; init; }

Property Value

bool?

ExtensionData

Contains any additional properties not explicitly modeled in this record. This handles the highly variable nature of generation metadata.

[JsonExtensionData]
public Dictionary<string, JsonElement>? ExtensionData { get; set; }

Property Value

Dictionary<string, JsonElement>

Extra

Extra metadata such as remix information.

[JsonPropertyName("extra")]
public ImageMetaExtra? Extra { get; init; }

Property Value

ImageMetaExtra

FluxMode

The Flux mode URN if using Flux generation.

[JsonPropertyName("fluxMode")]
public string? FluxMode { get; init; }

Property Value

string

GenerationType

The generation workflow type (e.g., "txt2img", "img2img").

[JsonPropertyName("workflow")]
public string? GenerationType { get; init; }

Property Value

string

Remarks

The API property is named "workflow", but this C# property is named "GenerationType" for clarity, as it describes the type of generation performed rather than a complete workflow definition.

Hashes

Dictionary of model and LoRA hashes used in generation.

[JsonPropertyName("hashes")]
public IReadOnlyDictionary<string, string>? Hashes { get; init; }

Property Value

IReadOnlyDictionary<string, string>

Height

The height of the generated image in pixels.

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

Property Value

int?

HiresSteps

The number of steps used in high-resolution upscaling.

[JsonPropertyName("Hires steps")]
public string? HiresSteps { get; init; }

Property Value

string

HiresUpscale

The upscaling factor for high-resolution generation.

[JsonPropertyName("Hires upscale")]
public string? HiresUpscale { get; init; }

Property Value

string

HiresUpscaler

The upscaling algorithm used (e.g., "Latent", "RealESRGAN").

[JsonPropertyName("Hires upscaler")]
public string? HiresUpscaler { get; init; }

Property Value

string

IsNsfw

Indicates whether the image has not-safe-for-work content.

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

Property Value

bool?

ModelHash

The hash identifier of the model used.

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

Property Value

string

ModelIds

Array of model IDs used to generate the image.

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

Property Value

IReadOnlyList<long>

ModelName

The name of the base model used for generation.

[JsonPropertyName("Model")]
public string? ModelName { get; init; }

Property Value

string

Remarks

The API property is named "Model", but this C# property is named "ModelName" for clarity, as "Model" could be confused with model types or AIR identifiers elsewhere in the codebase.

Models

Model configurations used in generation.

[JsonPropertyName("models")]
public IReadOnlyList<object>? Models { get; init; }

Property Value

IReadOnlyList<object>

Remarks

This property uses IReadOnlyList<object> because the Civitai API returns highly variable structures for model configurations depending on the generation workflow. This is fine since the JSON structure is not documented by the API, nor is the data consistent.

NegativePrompt

The negative prompt text describing what to avoid in the generated image.

[JsonPropertyName("negativePrompt")]
public string? NegativePrompt { get; init; }

Property Value

string

PositivePrompt

The positive prompt text used to guide image generation.

[JsonPropertyName("prompt")]
public string? PositivePrompt { get; init; }

Property Value

string

Remarks

The JSON property name is "prompt" from generation tools, but this C# property is named "PositivePrompt" for consistency with NegativePrompt.

Quantity

The number of images generated in this batch.

[JsonPropertyName("quantity")]
public int? Quantity { get; init; }

Property Value

int?

Resources

Resources used in generation (typically from A1111 workflows).

[JsonPropertyName("resources")]
public IReadOnlyList<ImageMetaResource>? Resources { get; init; }

Property Value

IReadOnlyList<ImageMetaResource>

RngType

The random number generator type used.

[JsonPropertyName("RNG")]
public string? RngType { get; init; }

Property Value

string

Remarks

The API property is named "RNG", but this C# property is named "RngType" to follow standard naming conventions and improve clarity.

Sampler

The sampling algorithm used (e.g., "DPM++ 2M", "Euler").

[JsonPropertyName("sampler")]
public string? Sampler { get; init; }

Property Value

string

ScheduleType

The noise schedule type (e.g., "Karras").

[JsonPropertyName("Schedule type")]
public string? ScheduleType { get; init; }

Property Value

string

Scheduler

The noise scheduler used during generation (e.g., "Karras", "Normal").

[JsonPropertyName("scheduler")]
public string? Scheduler { get; init; }

Property Value

string

Seed

The random seed used for generation.

[JsonPropertyName("seed")]
public long? Seed { get; init; }

Property Value

long?

Size

The image size as a string (e.g., "896x1152").

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

Property Value

string

Steps

The number of denoising steps used in generation.

[JsonPropertyName("steps")]
public int? Steps { get; init; }

Property Value

int?

Upscalers

Array of upscaler names used in post-processing.

[JsonPropertyName("upscalers")]
public IReadOnlyList<string>? Upscalers { get; init; }

Property Value

IReadOnlyList<string>

Vae

The Variational Auto-Encoder (VAE) used for encoding/decoding.

[JsonPropertyName("VAE")]
public string? Vae { get; init; }

Property Value

string

VariationalAutoEncoders

Array of Variational Auto-Encoder names used in generation.

[JsonPropertyName("vaes")]
public IReadOnlyList<string>? VariationalAutoEncoders { get; init; }

Property Value

IReadOnlyList<string>

Version

The version identifier of the generation software.

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

Property Value

string

VersionIds

Array of model version IDs used to generate the image.

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

Property Value

IReadOnlyList<long>

Width

The width of the generated image in pixels.

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

Property Value

int?