Table of Contents

Class ImageJobControlNet

Namespace
CivitaiSharp.Sdk.Models.Jobs
Assembly
CivitaiSharp.Sdk.dll

Configuration for a ControlNet to apply during generation.

public sealed class ImageJobControlNet
Inheritance
ImageJobControlNet
Inherited Members

Remarks

Either ImageUrl or BlobKey must be provided, but not both.

Properties

BlobKey

Gets or sets the blob key referencing an already-uploaded control image.

[JsonPropertyName("blobKey")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? BlobKey { get; init; }

Property Value

string

Remarks

Provide either this property or ImageUrl, not both. Use this when the image has been pre-uploaded to Civitai's blob storage.

EndStep

Gets or sets the ending step for ControlNet influence. Range: 0.0-1.0.

[JsonPropertyName("endStep")]
public decimal? EndStep { get; init; }

Property Value

decimal?

ImageUrl

Gets or sets the URL of the control image.

[JsonPropertyName("imageUrl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ImageUrl { get; init; }

Property Value

string

Remarks

Provide either this property or BlobKey, not both.

Preprocessor

Gets or sets the preprocessor to apply to the control image.

[JsonPropertyName("preprocessor")]
[JsonConverter(typeof(NullableControlNetPreprocessorConverter))]
public ControlNetPreprocessor? Preprocessor { get; init; }

Property Value

ControlNetPreprocessor?

StartStep

Gets or sets the starting step for ControlNet influence. Range: 0.0-1.0.

[JsonPropertyName("startStep")]
public decimal? StartStep { get; init; }

Property Value

decimal?

Weight

Gets or sets the weight/influence of this ControlNet. Range: 0.0-2.0, default: 1.0.

[JsonPropertyName("weight")]
public decimal? Weight { get; init; }

Property Value

decimal?

Methods

Validate()

Validates that exactly one of ImageUrl or BlobKey is provided.

public void Validate()

Exceptions

InvalidOperationException

Thrown when neither or both properties are provided.