v0xie / sd-webui-incantations

Enhance Stable Diffusion image quality, prompt following, and more through multiple implementations of novel algorithms for Automatic1111 WebUI.
GNU General Public License v3.0
130 stars 8 forks source link

Add Perturbed Attention Guidance #8

Closed v0xie closed 5 months ago

v0xie commented 5 months ago

WIP implementation of https://arxiv.org/abs/2403.17377

TODO:

xyz_grid-2969-705575713-a picture of a cute puppy

v0xie commented 5 months ago

Still grappling with the pag_scale parameter persisting between jobs. Temporary solution is to use a global.

both PAG+CFG

v1-5-pruned-emaonly.safetensors [6ce0161689] xyz_grid-3004-1-a cute puppy

Aidv210AnimeIllustDiffusion_aidv210.safetensors [4efd47fad9] xyz_grid-3013-1-1girl, best quality, masterpiece, Reimu, touhou

v0xie commented 5 months ago

Major cleanup and a test implementation for SD XL.

I didn't see anything in the paper about SD XL so I'd be interested to see ablation results for perturbing different layers. Currently perturbing the same layer as recommended for SD 1.5.

Interesting results when negating the guidance scale. For some seeds/prompts, the negative guidance scale produces something subjectively better than the positive guidance scale does.

sd_xl_base_1.0_0.9vae.safetensors [e6bb9ea85b] xyz_grid-3025-676025504-a cute puppy and a cute cat on the moon