Skip to content
Haoming edited this page Apr 22, 2024 · 1 revision

For API usages, this Extension takes 7 parameters:

enable: Boolean = true
mode: String = "Basic" | "Advanced" | "Mask"
separator: String = ""
direction: String = "Horizontal" | "Vertical" | null
background: String = "None" | "First Line" | "Last Line" | null
background_weight: Number = 0.1 ~ 1.0 | null
mapping: Array = list[list] | list[dict] | null

To use the Extension with API, add the following example object to the alwayson_scripts entry of your payload

Basic

Usage is basically the same as on the Webui

  • direction is required
  • If background is not set to "None", then background_weight is also required
  • mapping can just be null
payload
"forge couple": {
    "args": [
        true,
        "Basic",
        "\n",
        "Horizontal",
        "None",
        null,
        null
    ]
}

Advanced

Usage is basically the same as on the Webui

  • direction, background, background_weight can just be null
  • mapping is an array of array. Each array corresponds to a region, with 3 values: x, y, weight. The rules for the values are the same.
payload
"forge couple": {
    "args": [
        true,
        "Advanced",
        "\n",
        null,
        null,
        null,
        [
            [
                "0.00:0.50",
                "0.00:1.00",
                "1.0"
            ],
            [
                "0.50:1.00",
                "0.00:1.00",
                "1.0"
            ]
        ]
    ]
}

Mask

This is an API-only mode

  • direction can just be null
  • If background is not set to "None", then background_weight is also required
  • mapping is an array of dictionary. Each dictionary corresponds to a region, with 2 values: mask, weight. The mask is a grayscale image, with white color meaning active while black color meaning inactive, encoded in base64.
payload
"forge couple": {
    "args": [
        true,
        "Mask",
        "\n",
        null,
        "None",
        null,
        [
            {
                "mask": "<mask in base64>",
                "weight": 1.0
            },
            {
                "mask": "<mask in base64>",
                "weight": 1.0
            }
        ]
    ]
}
Clone this wiki locally