pamparamm / sd-perturbed-attention

Perturbed-Attention Guidance and Smoothed Energy Guidance for ComfyUI and SD Forge
MIT License
218 stars 14 forks source link

Saliency-adaptive noise fusion for PAG #23

Closed slashedstar closed 3 months ago

slashedstar commented 3 months ago

https://github.com/v0xie/sd-webui-incantations/pull/45 It has the same purpose as Rescale PAG, I couldn't exactly compare both because PAG seems to work differently on the incantations extension (idk if the implementation is different or if its because of the internal workings of A1111/Forge), frying at much smaller PAG values, but it works really well for getting rid of the artifacts from high PAG values without dampening the effect

pamparamm commented 3 months ago

Looks interesting. I can try to implement this

pamparamm commented 3 months ago

Done, you can use Saliency-adaptive noise fusion by setting rescale_mode to snf

slashedstar commented 3 months ago

tysm, working great 👍

slashedstar commented 3 months ago

Ok, it is a bug since it does work like normal on a1111 and incantations extension First row with Negative guidance minimum sigma: 5 No rescale, Full, SNF Second row with Negative guidance minimum sigma: 0 (disabled) No rescale, Full, SNF 19554

"Ignore negative prompt during early sampling" also may have a similar problem (the preview images show a similar artifacting in the steps its enabled), they are both from this PR https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15607

pamparamm commented 3 months ago

I've fixed that issue by skipping SNF when there's no uncond_pred.

Can you update the extension and check if everything works without artifacts?

slashedstar commented 3 months ago

No artifacts now 👍