Closed ramyma closed 2 months ago
Hmm. I modified it so that background
is not necessary for Mask
mode.
In the example provided in Wiki, I simply used 2 masks that occupy half of the image each, and it worked for me.
In theory, it should also work if you specify it to use background
.
It didn't work for me when I passed background First Line
, mode Mask
, a background weight and a prompt with GLOBAL <SEP> REGION 1 <SEP> REGION 2
AssertionError: [Couple] Masks contain non-filled areas...
{
"args": [
true,
"Mask",
"<SEP>",
"Horizontal",
"None",
0.3,
[
{
"mask": MASK,
"weight": 1
}
]
]
}
prompt: test
In my previous tests, the code used to fail if the there's no background (global) prompt
Keep in mind that the masks most likely won't cover all the image space, so, without a global prompt the attention math won't work properly here: https://github.com/Haoming02/sd-forge-couple/blob/main/scripts/attention_couple.py#L25
I believe the changes in this PR solves the issue, I tested it with my integration and it's looking good.
Keep in mind that the masks most likely won't cover all the image space
It's up to the user to fill the entire image, or just use background
.
But yes, the validation logics were wrong.
I found that after the last update that the mask mapping validation is not correct. Mask mapping will always have a background, so I took the liberty to distill down the checks with the expected values.
Fixes #29