Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Skip SAG when latent is too small.

comfyanonymousb4e915e74560
diff --git a/comfy_extras/nodes_sag.py b/comfy_extras/nodes_sag.py
index b307b4f56..bbd380807 100644
--- a/comfy_extras/nodes_sag.py
+++ b/comfy_extras/nodes_sag.py
@@ -143,6 +143,8 @@ class SelfAttentionGuidance:
sigma = args["sigma"]
model_options = args["model_options"]
x = args["input"]
+ if min(cfg_result.shape[2:]) <= 4: #skip when too small to add padding
+ return cfg_result
# create the adversarially blurred image
degraded = create_blur_map(uncond_pred, uncond_attn, sag_sigma, sag_threshold)