mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-23 12:17:52 +08:00
Fix SAG not working on certain resolutions.
This commit is contained in:
parent
778dd90076
commit
73d62af037
@ -58,7 +58,7 @@ def create_blur_map(x0, attn, sigma=3.0, threshold=1.0):
|
|||||||
attn = attn.reshape(b, -1, hw1, hw2)
|
attn = attn.reshape(b, -1, hw1, hw2)
|
||||||
# Global Average Pool
|
# Global Average Pool
|
||||||
mask = attn.mean(1, keepdim=False).sum(1, keepdim=False) > threshold
|
mask = attn.mean(1, keepdim=False).sum(1, keepdim=False) > threshold
|
||||||
ratio = round(math.sqrt(lh * lw / hw1))
|
ratio = math.ceil(math.sqrt(lh * lw / hw1))
|
||||||
mid_shape = [math.ceil(lh / ratio), math.ceil(lw / ratio)]
|
mid_shape = [math.ceil(lh / ratio), math.ceil(lw / ratio)]
|
||||||
|
|
||||||
# Reshape
|
# Reshape
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user