Open zethriller opened 1 year ago
Having the exact same issue & haven't been able to solve it yet, would be nice if someone could chime in to tell us noobs what we're doing wrong, or if it's just broken lol
ouch I'm not using A1111 anymore and right now I'm not sure what went wrong. I'm sorry that you guys can't use it. I will take a look into it during the upcoming month if possible!
It does function with the Midas model, although I can not get a suitable image out of it, but the script appears to be broken with the other models.
Changing the lines of code at : automatic1111\repositories\midas\midas\backbones\beit.py", line 102, in block_forward -
FROM
x = x + self.drop_path(self.attn(self.norm1(x), resolution, shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path(self.mlp(self.norm2(x)))
else:
x = x + self.drop_path(self.gamma_1 * self.attn(self.norm1(x), resolution,
shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path(self.gamma_2 * self.mlp(self.norm2(x)))
TO:
x = x + self.drop_path1(self.attn(self.norm1(x), resolution, shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path2(self.mlp(self.norm2(x)))
else:
x = x + self.drop_path1(self.gamma_1 * self.attn(self.norm1(x), resolution,
shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path2(self.gamma_2 * self.mlp(self.norm2(x)))
(manually adding path#s is really all.)
Seems to brute force a fix however, it seems the brute forcing of it this way causes a memory leak as it will go from successful runs, to OOM exceptions immediately before it even renders 1 pre-image.
I honestly don't know a lot of python, just know how to follow traces and stacks while guessing syntax along the way, so no idea if the changes made are just bad, or if this is close to a solution or not.
another thought: This is in the beit.py file, the model for midas beit, that is 512 (the big one.) perhaps changing to a different model (swin2) will resolve? thats on my todo at least if I cannot resolve beit.
Note: this may be me not knowing how to use it, please explain if needed - this is a very basic test, haven't found either how to position foreground items.
Testing extension with background + 2 foreground characters Model: dynavisionXL, image size 832x1216 Settings:
After generating correctly the background and the two foreground images, preview dissapears and an error shows up instead: "AttributeError: 'Block' object has no attribute 'drop_path' "
Traceback: