interface ControlNetUnitRequest {
    control_mode?: ControlMode;
    enabled: boolean;
    guidance_end?: number;
    guidance_start?: number;
    image?: null | string;
    low_vram?: boolean;
    mask?: null | string;
    model?: string;
    module?: string;
    pixel_perfect?: boolean;
    processor_res?: number;
    resize_mode?: ResizeMode;
    threshold_a?: number;
    threshold_b?: number;
    weight?: number;
}

Properties

control_mode?: ControlMode

See the related issue for usage. Defaults to 0. Accepted values:

  • 0 or "Balanced": balanced, no preference between prompt and control model
  • 1 or "My prompt is more important": the prompt has more impact than the model
  • 2 or "ControlNet is more important": the controlnet model has more impact than the prompt
enabled: boolean

This unit enabled or not.

guidance_end?: number

Ratio of generation where this unit stops to have an effect. Defaults to 1.0.

guidance_start?: number

Ratio of generation where this unit starts to have an effect. Defaults to 0.0.

image?: null | string

Image to use in this unit. Defaults to null.

low_vram?: boolean

Whether to compensate low GPU memory with processing time. Defaults to false.

mask?: null | string

Mask pixel_perfect to filter the image. Defaults to null.

model?: string

Name of the model to use for conditioning in this unit. Accepts values returned by the /controlnet/model_list route. Defaults to "None".

module?: string

Preprocessor to use on the image passed to this unit before using it for conditioning. Accepts values returned by the /controlnet/module_list route. Defaults to "none".

pixel_perfect?: boolean

Enable pixel-perfect preprocessor. Defaults to false.

processor_res?: number

Resolution of the preprocessor. Defaults to -1.

resize_mode?: ResizeMode

How to resize the input image so as to fit the output resolution of the generation. Defaults to "Scale to Fit (Inner Fit)". Accepted values:

  • 0 or "Just Resize": simply resize the image to the target width/height
  • 1 or "Scale to Fit (Inner Fit)": scale and crop to fit smallest dimension, preserves proportions
  • 2 or "Envelope (Outer Fit)": scale to fit largest dimension, preserves proportions
threshold_a?: number

First parameter of the preprocessor. Only takes effect when preprocessor accepts arguments. Defaults to -1.

threshold_b?: number

Second parameter of the preprocessor, same as above for usage. Defaults to -1.

weight?: number

Weight of this unit. Defaults to -1.