Skip to content
Haoming edited this page Feb 18, 2025 · 3 revisions

For API usages, this Extension takes 10 parameters:

enable: Boolean = true
disable_hr: Boolean = true | false
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.5 | null
mapping: Array = Array[] | Object[] | null
common_parser: String = "off" | "{ }" | "< >" | null
common_debug: Boolean = true | false | null

To use this Extension with API, add the following example object to the alwayson_scripts entry of your payload, and adjust the parameters as needed.

Common Parameters

  • enable is always true (otherwise why are you here)
  • disable_hr is always required (true recommended)
  • mode is always required
  • separator is always required
    • Pass an empty string ("") to use the newline character
  • common_parser and common_debug can be ignored at the same time (ie. only pass 8 parameters) to use the default values ("{ }", false)

Basic Mode

  • direction is always required
  • background is always required
  • background_weight is required if background is not "None"; can just be null otherwise
  • mapping can just be null
example payload
"forge couple": {
    "args": [
        true,
        true,
        "Basic",
        "",
        "Horizontal",
        "None",
        null,
        null
    ]
}

Advanced Mode

  • direction can just be null
  • background can just be null
  • background_weight can just be null
  • mapping is an array of float arrays
    • Each float array corresponds to a region, with 5 values: x1, x2, y1, y2, and weight
example payload
"forge couple": {
    "args": [
        true,
        true,
        "Advanced",
        "",
        null,
        null,
        null,
        [
            [
                0.0,
                0.5,
                0.0,
                1.0,
                1.0
            ],
            [
                0.5,
                1.0,
                0.0,
                1.0,
                1.0
            ]
        ]
    ]
}

Mask

  • direction can just be null
  • background is always required
  • background_weight is required if background is not "None"; can just be null otherwise
  • mapping is an array of dictionary
    • Each dictionary corresponds to a region, with 2 key-value pairs: mask and weight
    • The mask is a grayscale image where white color is active, encoded in base64
      • Masks will be automatically resized to the generation size
    • The weight is a float
example payload
"forge couple": {
    "args": [
        true,
        true,
        "Mask",
        "",
        null,
        "First Line",
        0.5,
        [
            {
                "mask": "<mask in base64>",
                "weight": 1.0
            },
            {
                "mask": "<mask in base64>",
                "weight": 1.0
            }
        ]
    ]
}
Clone this wiki locally