92 Commits

Author SHA1 Message Date
comfyanonymous
11606962cf Add a T5TokenizerOptions node to set options for the T5 tokenizer. (#7803) 2025-04-25 19:36:00 -04:00
comfyanonymous
df67f25c28 More flexible long clip support.
Add clip g long clip support.

Text encoder refactor.

Support llama models with different vocab sizes.
2025-04-15 10:32:21 -04:00
comfyanonymous
3951cded84 Fix some things breaking when embeddings fail to apply. 2025-03-06 13:31:55 -05:00
comfyanonymous
e8b45ac4be Support llava clip vision model. 2025-03-06 00:24:43 -05:00
comfyanonymous
4857e9b863 Make applying embeddings more efficient.
Adding new tokens no longer makes a whole copy of the embeddings weight
which can be massive on certain models.
2025-03-05 17:34:38 -05:00
comfyanonymous
843b5c22b3 Make it easier to set a custom template for hunyuan video. 2025-03-04 09:26:05 -05:00
comfyanonymous
e03a640306 Support Lumina 2 model. 2025-02-04 04:16:30 -05:00
comfyanonymous
fd4d654129 Remove unsafe embedding load for very old pytorch. 2025-01-15 04:32:23 -05:00
Chenlei Hu
917717a0a4 Replace print with logging (#6138)
* Replace print with logging

* nit

* nit

* nit

* nit

* nit

* nit
2024-12-20 16:24:55 -05:00
City
a3a893abeb Add PixArt model support (#6055)
* PixArt initial version

* PixArt Diffusers convert logic

* pos_emb and interpolation logic

* Reduce  duplicate code

* Formatting

* Use optimized attention

* Edit empty token logic

* Basic PixArt LoRA support

* Fix aspect ratio logic

* PixArtAlpha text encode with conds

* Use same detection key logic for PixArt diffusers
2024-12-20 15:25:00 -05:00
comfyanonymous
5ea21ff2b2 Properly tokenize the template for hunyuan video. 2024-12-17 16:22:02 -05:00
comfyanonymous
2b49852ca2 Basic Hunyuan Video model support. 2024-12-16 19:35:40 -05:00
Chenlei Hu
efca88cfb3 Lint all unused variables (#5989)
* Enable F841

* Autofix

* Remove all unused variable assignment
2024-12-12 17:59:16 -05:00
comfyanonymous
baafbc0b32 Fix a few things in text enc code for models with no eos token. 2024-12-10 23:07:26 -05:00
comfyanonymous
4afc0f000a Support different types of tokenizers.
Support tokenizers without an eos token.

Pass full sentences to tokenizer for more efficient tokenizing.
2024-12-10 15:03:39 -05:00
comfyanonymous
567711396b Support scaled fp8 t5xxl model. 2024-10-20 22:27:00 -04:00
comfyanonymous
1ee9bd22e9 Revert "Fix Transformers FutureWarning (#5140)"
This reverts commit 2d77c6fec951bb8077fca6b3894d1d2153cc300d.
2024-10-16 12:36:19 -04:00
svdc
2d77c6fec9 Fix Transformers FutureWarning (#5140)
* Update sd1_clip.py

Fix Transformers FutureWarning

* Update sd1_clip.py

Fix comment
2024-10-14 20:12:20 -04:00
comfyanonymous
36ffa50637 Remove useless argument. 2024-10-12 07:16:21 -04:00
comfyanonymous
28b12fb344 Long CLIP L support for SDXL, SD3 and Flux.
Use the *CLIPLoader nodes.
2024-09-15 07:59:38 -04:00
comfyanonymous
2062f06e50 Properly set if clip text pooled projection instead of using hack. 2024-08-20 10:46:36 -04:00
comfyanonymous
03c874ec6e Add model_options for text encoder. 2024-08-17 11:17:20 -04:00
comfyanonymous
7c94219393 Fix bundled embed. 2024-08-07 13:30:45 -04:00
comfyanonymous
04f70b853e Support format for embeddings bundled in loras. 2024-08-07 03:45:25 -04:00
comfyanonymous
4e9abfb0d5 Lower CLIP memory usage by a bit. 2024-07-31 01:32:35 -04:00
comfyanonymous
671fba8c0d Fix potential issue with non clip text embeddings. 2024-07-30 14:41:13 -04:00
comfyanonymous
15a95668ae Let tokenizers return weights to be stored in the saved checkpoint. 2024-07-25 10:52:09 -04:00
comfyanonymous
33e584b3bc Make it possible to load tokenizer data from checkpoints. 2024-07-24 16:43:53 -04:00
comfyanonymous
238efd021c More flexibility with text encoder return values.
Text encoders can now return other values to the CONDITIONING than the cond
and pooled output.
2024-07-10 20:06:50 -04:00
comfyanonymous
27226fb151 Support returning text encoder attention masks. 2024-07-10 19:31:22 -04:00
comfyanonymous
002954b124 Rename clip_t5base to t5base for stable audio text encoder. 2024-07-08 08:53:55 -04:00
comfyanonymous
b9b3986c45 Allow specifying the padding token for the tokenizer. 2024-07-06 00:06:49 -04:00
comfyanonymous
fc982c3e43 Allow zeroing out of embeds with unused attention mask. 2024-07-05 23:48:17 -04:00
Mario Klingemann
c39be91219 Update sd1_clip.py (#3684)
Made token instance check more flexible so it also works with integers from numpy arrays or long tensors
2024-06-19 16:42:41 -04:00
comfyanonymous
917810a2c6 Load the SD3 T5xxl model in the same dtype stored in the checkpoint. 2024-06-11 17:03:26 -04:00
comfyanonymous
a2a20c27f4 Support zeroing out text embeddings with the attention mask. 2024-06-09 16:51:58 -04:00
comfyanonymous
add86d4eb5 Use the end token for the text encoder attention mask. 2024-06-07 03:05:23 -04:00
comfyanonymous
35d0fd9a5d Replace prints with logging and add --verbose argument. 2024-03-10 12:14:23 -04:00
comfyanonymous
13fb082928 Add a min_length property to tokenizer class. 2024-02-26 21:36:37 -05:00
comfyanonymous
c8556665f0 Make return_projected_pooled setable from the __init__ 2024-02-25 14:49:13 -05:00
comfyanonymous
766b45c2c1 Always return unprojected pooled output for gligen. 2024-02-25 07:33:13 -05:00
comfyanonymous
9e5c5a0ad3 Move text projection into the CLIP model code.
Fix issue with not loading the SSD1B clip correctly.
2024-02-25 01:41:08 -05:00
comfyanonymous
b102d65c41 StableCascade CLIP model support. 2024-02-16 13:29:04 -05:00
comfyanonymous
2f33a09886 Cleanup some unused imports. 2024-01-21 21:51:22 -05:00
comfyanonymous
58b39151a4 Switch text encoder to manual cast.
Use fp16 text encoder weights for CPU inference to lower memory usage.
2023-12-10 23:00:54 -05:00
comfyanonymous
63349484b8 Make --gpu-only put intermediate values in GPU memory instead of cpu. 2023-12-08 02:35:45 -05:00
comfyanonymous
782cf4f295 Cleaner CLIP text encoder implementation.
Use a simple CLIP model implementation instead of the one from
transformers.

This will allow some interesting things that would too hackish to implement
using the transformers implementation.
2023-12-06 23:50:03 -05:00
comfyanonymous
9002e58ce5 Less useless downcasting. 2023-12-04 12:53:46 -05:00
comfyanonymous
35b7304ac5 Fix last pr. 2023-11-14 14:41:31 -05:00
Jianqi Pan
58a23fc106 fix: adaptation to older versions of pytroch 2023-11-14 14:32:05 +09:00