ComfyUI/comfy/ldm/modules
Jukka Seppänen be95871adc
feat: Gemma4 text generation support (CORE-30) (#13376)
* initial gemma4 support

* parity with reference implementation

outputs can 100% match transformers with same sdpa flags, checkpoint this and then optimize

* Cleanup, video fixes

* cleanup, enable fused rms norm by default

* update comment

* Cleanup

* Update sd.py

* Various fixes

* Add fp8 scaled embedding support

* small fixes

* Translate think tokens

* Fix image encoder attention mask type

So it works with basic attention

* Handle thinking tokens different only for Gemma4

* Code cleanup

* Update nodes_textgen.py

* Use embed scale class instead of buffer

Slight difference to HF, but technically more accurate and simpler code

* Default to fused rms_norm

* Update gemma4.py
2026-05-02 22:46:15 -04:00
..
diffusionmodules feat: SUPIR model support (CORE-17) (#13250) 2026-04-18 23:02:01 -04:00
distributions Small optimizations. 2024-12-18 18:23:28 -05:00
encoders Remove dead code. (#13251) 2026-04-01 20:22:06 -04:00
attention.py feat: Gemma4 text generation support (CORE-30) (#13376) 2026-05-02 22:46:15 -04:00
ema.py New Year ruff cleanup. (#11595) 2026-01-01 22:06:14 -05:00
sdpose.py SDPose: resize input always (#13349) 2026-04-10 11:26:55 -10:00
sub_quadratic_attention.py Widen OOM_EXCEPTION to AcceleratorError form (#12835) 2026-03-10 00:41:02 -04:00
temporal_ae.py Basic Hunyuan Video model support. 2024-12-16 19:35:40 -05:00