14 Commits

Author SHA1 Message Date
comfyanonymous
2a2872227b proper fix for sag. 2024-11-10 00:10:45 -05:00
DenOfEquity
3770508be9 fix for SAG with Kohya HRFix/ Deep Shrink (#5546)
now works with arbitrary downscale factors
2024-11-08 18:16:29 -05:00
fgdfgfthgr-fox
fccdd04ee7 Lower SAG scale step for finer control (#4158)
* Lower SAG step for finer control

Since the introduction of cfg++ which uses very low cfg value, a step of 0.1 in SAG might be too high for finer control. Even SAG of 0.1 can be too high when cfg is only 0.6, so I change the step to 0.01.

* Lower PAG step as well.

* Update nodes_sag.py
2024-08-02 10:29:03 -04:00
comfyanonymous
93094050bb Remove some unused imports. 2024-05-27 19:08:27 -04:00
comfyanonymous
e02598e417 Fix SAG. 2024-05-14 18:02:27 -04:00
comfyanonymous
1ba93001e4 Refactor calc_cond_uncond_batch into calc_cond_batch.
calc_cond_batch can take an arbitrary amount of cond inputs.

Added a calc_cond_uncond_batch wrapper with a warning so custom nodes
won't break.
2024-04-01 18:07:47 -04:00
comfyanonymous
abdd5c3f33 Skip SAG when latent is too small. 2024-01-10 04:08:43 -05:00
comfyanonymous
528df49b57 Round up to nearest power of 2 in SAG node to fix some resolution issues. 2024-01-09 15:12:12 -05:00
comfyanonymous
bf90151704 Fix SAG not working with cfg 1.0 2023-12-18 17:03:32 -05:00
comfyanonymous
73d62af037 Fix SAG not working on certain resolutions. 2023-12-16 01:29:57 -05:00
comfyanonymous
99f61f753a Remove useless code. 2023-12-15 01:28:16 -05:00
comfyanonymous
9f728f9e00 cleanup. 2023-12-14 20:11:46 -05:00
comfyanonymous
b83523b241 Refactor and improve the sag node.
Moved all the sag related code to comfy_extras/nodes_sag.py
2023-12-13 16:11:26 -05:00
Rafie Walker
58df1767b4 Implement Self-Attention Guidance (#2201)
* First SAG test

* need to put extra options on the model instead of patcher

* no errors and results seem not-broken

* Use @ashen-uncensored formula, which works better!!!

* Fix a crash when using weird resolutions. Remove an unnecessary UNet call

* Improve comments, optimize memory in blur routine

* SAG works with sampler_cfg_function
2023-12-13 15:52:11 -05:00