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
136 stars 8 forks source link

Support multiple scripts modifying latent #36

Closed v0xie closed 4 months ago

v0xie commented 4 months ago

PAG and the upcoming S-CFG (#35) both modify the latent. Each implementation hijacks the original combine_denoised function which is cumbersome.

This PR defines a new class CFGCombiner which handles patching the combine_denoised function, and adds the guidance from each script in a deterministic way.

Also handles an error in cases where get_xyz_axis_options for scripts referenced in incantation_base are not implemented.

Scripts that wish to modify the latent have their parameters added to the StableDiffusionProcessing incant_cfg_params dict.

v0xie commented 4 months ago

It looks like PAG and SCFG are playing nicely together. xyz_grid-3611-1-A brown stuffed animal laying in the aisle of a retail store