Add ComfyUI patch, conversion script, license and README
Browse filesFiles changed (5)
- LICENSEAdded+202
- NOTICEAdded+13
- README.md+166
- comfyui-jeveration-v0.46.1.patchAdded+476
- convert_jeveration.pyAdded+103
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.12345678910111213JeverationCopyright 2026 The Jeveration Authors
This product includes software developed by Bytedance Ltd. and/or its affiliates(TA-TiTok, https://github.com/bytedance/1d-tokenizer), licensed under the ApacheLicense, Version 2.0. See THIRD_PARTY_NOTICES.md andjeveration/third_party/tatitok/LICENSE.
---
This repository holds a ComfyUI port of Jeveration (a patch to ComfyUI and a weightconversion script). The NOTICE above is reproduced fromhttps://github.com/Carol-lyh/Jeveration. The files it names are in that repository.123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169---license: apache-2.0base_model: linlinlinlinsdada/Jeverationpipeline_tag: text-to-imagelanguage:- entags:- comfyui- text-to-image---# Jeveration for ComfyUIThis repository adds [Jeveration](https://huggingface.co/linlinlinlinsdada/Jeveration) text-to-image support to[ComfyUI](https://github.com/Comfy-Org/ComfyUI). Jeveration produces a 512 x 512 image in a single forward pass. Itcontains:| File | What ||---|---|| `jeveration_t2i_int8_convrot.safetensors` | ready-made checkpoint (6.7 GB): int8 ConvRot backbone, everything else bf16 || `comfyui-jeveration-v0.46.1.patch` | ComfyUI patch, made against tag `v0.46.1`: model, decoder, text encoder, two nodes || `convert_jeveration.py` | builds a single ComfyUI checkpoint (`.safetensors`) from the original weights || `LICENSE`, `NOTICE` | Apache License 2.0 and the NOTICE of the original Jeveration project |The scope is text-to-image only. The image-to-image and dense-prediction tasks of the original model are not ported.## CreditsAll credit for the model goes to its authors:- **Jeveration**, by Yuhe Liu, Qi Li, Shihua Zhang and Xinchao Wang.[Paper](https://arxiv.org/abs/2611.24738) · [Code](https://github.com/Carol-lyh/Jeveration) ·[Weights](https://huggingface.co/linlinlinlinsdada/Jeveration) · [Project page](https://carol-lyh.github.io/Jeveration/).Apache 2.0.- **Qwen3.5-4B**, by the Qwen team, Alibaba Cloud: [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B), thebackbone. Apache 2.0.- **TA-TiTok**, by ByteDance: [1d-tokenizer](https://github.com/bytedance/1d-tokenizer) and[`turkeyju/tokenizer_tatitok_bl128_vq`](https://huggingface.co/turkeyju/tokenizer_tatitok_bl128_vq), which providethe codebook and the base of the image decoder. Apache 2.0.- **CLIP ViT-L/14-336**, by OpenAI:[`timm/vit_large_patch14_clip_336.openai`](https://huggingface.co/timm/vit_large_patch14_clip_336.openai), thedecoder's text tower. Apache 2.0 (model card).```bibtex@article{liu2026jeveration,title = {Jeveration: System One Models Now Generate},author = {Liu, Yuhe and Li, Qi and Zhang, Shihua and Wang, Xinchao},journal = {arXiv preprint arXiv:2611.24738},year = {2026}}```## 1. Patch ComfyUIThe patch was made against ComfyUI `v0.46.1`. It adds four new files and appends a few lines to six existing ones(`comfy/latent_formats.py`, `comfy/model_base.py`, `comfy/model_detection.py`, `comfy/sd.py`,`comfy/supported_models.py`, `nodes.py`). Nothing is deleted or rewritten.**Fresh install (git):**```bashgit clone https://github.com/Comfy-Org/ComfyUI && cd ComfyUIgit checkout v0.46.1git apply /path/to/comfyui-jeveration-v0.46.1.patchpip install -r requirements.txt # plus PyTorch for your GPU, as in ComfyUI's README```**Existing git install:** commit or stash your own changes first, then put the patch on a branch:```bashcd ComfyUIgit fetch --tagsgit checkout -b jeveration v0.46.1git apply --check /path/to/comfyui-jeveration-v0.46.1.patch # prints nothing if it appliesgit apply /path/to/comfyui-jeveration-v0.46.1.patchpip install -r requirements.txt```On a newer ComfyUI release, try `git apply --3way` instead. It merges small upstream changes around the touched linesand leaves conflict markers where it cannot.**Without git** (for example, an extracted portable or zip release of v0.46.1). Run this from the ComfyUI folder thatcontains `main.py`; with the Windows portable build, that is `ComfyUI_windows_portable/ComfyUI`:```bashpatch -p1 --dry-run < /path/to/comfyui-jeveration-v0.46.1.patch # check firstpatch -p1 < /path/to/comfyui-jeveration-v0.46.1.patch```**Check:** start ComfyUI and search for "Jeveration" in the node library. *Jeveration Sampler* and *Jeveration Decode*should be listed.**Undo:** use `git apply -R /path/to/comfyui-jeveration-v0.46.1.patch` or `patch -p1 -R < ...`, or switch back to yourprevious branch.## 2. Get the checkpointPut `jeveration_t2i_int8_convrot.safetensors` from this repository in `ComfyUI/models/checkpoints/`:```bashhf download messerschmit666/Jeveration_ComfyUI jeveration_t2i_int8_convrot.safetensors --local-dir models/checkpoints```To build it yourself instead, or to build the bf16 variant, download the original weights into one folder:```bashhf download linlinlinlinsdada/Jeveration jeveration.pt decoder512.pt --local-dir weights/jeverationhf download Qwen/Qwen3.5-4B --include "*.safetensors" --local-dir weights/qwen35_4bhf download turkeyju/tokenizer_tatitok_bl128_vq model.safetensors --local-dir weights/tatitokhf download timm/vit_large_patch14_clip_336.openai open_clip_model.safetensors --local-dir weights/clip336```Run the conversion from the ComfyUI root, in ComfyUI's Python environment. Either variant takes a few minutes:```bash# bf16, 10.3 GBpython /path/to/convert_jeveration.py weights models/checkpoints/jeveration_t2i_bf16.safetensors# int8 ConvRot backbone, 6.7 GBpython /path/to/convert_jeveration.py --int8-convrot weights models/checkpoints/jeveration_t2i_int8_convrot.safetensors```The script:- merges the rank-256 LoRA into the Qwen3.5-4B language model in fp32;- adds the image head, the codebook, the TA-TiTok 512 px decoder and the CLIP-L-336 text tower;- writes everything as one checkpoint.The `.pt` files are read with `torch.load(weights_only=True)`. The script uses no network access.`--int8-convrot` stores the backbone's attention, linear-attention and MLP weights in ComfyUI's `int8_tensorwise`format with ConvRot (per-channel scale, Hadamard group 256). They are quantized from the merged fp32 weights. All otherweights stay bf16.## 3. Workflow```Load Checkpoint ─┬─ MODEL ──────────────────────────────────────────┐├─ CLIP ── CLIP Text Encode ── positive ─┐ │└─ VAE ─────────────┐ │ ││ Jeveration Sampler (model, positive, seed, batch_size)│ │ LATENTJeveration Decode (vae, samples, positive) ── IMAGE ── Save Image```Use the stock **Load Checkpoint** and **CLIP Text Encode** nodes. There is no sampler schedule, CFG or step count: theimage comes from one forward pass and one sampling draw. Prompts are English, and only the first 128 Qwen tokens areused.## Accuracy and speedThe port was compared against the reference pipeline on fixed inputs (states, noise and prompts dumped from theoriginal code):| | bf16 | int8 ConvRot ||---|---|---|| Prompt token ids | identical | identical || CLIP guidance cosine | 0.99998 | 0.99998 || Code logits KL vs reference | 3e-3 to 2e-2 | 8e-3 to 9e-2 || Top-1 code agreement | 88–95 % | 77–93 % || Decoder PSNR vs reference image | 46.5–48.4 dB | same decoder (bf16) |The bf16 deviations come from merging the LoRA into bf16 weights and from ComfyUI's backbone kernels; they are notvisible in images. The int8 checkpoint gives the same compositions with small changes in detail.On an RTX 5060 Ti 16 GB, a 512 x 512 image takes 0.6 to 0.8 s once the model is loaded. Batch sizes above 1 and`--lowvram` work.Seeds are deterministic in ComfyUI, but they do not reproduce the exact pixels of the original pipeline for the sameseed number, because the random draws are made differently.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476diff --git a/comfy/latent_formats.py b/comfy/latent_formats.pyindex 1367c5214..e795dc5e0 100644--- a/comfy/latent_formats.py+++ b/comfy/latent_formats.py@@ -1123,6 +1123,10 @@ class MiniMaxMusic3(LatentFormat): latent_dimensions = 1 temporal_downscale_ratio = 512 +class Jeveration(LatentFormat):+ latent_channels = 64+ latent_dimensions = 1+ class ChromaRadiance(LatentFormat): latent_channels = 3 spacial_downscale_ratio = 1diff --git a/comfy/ldm/jeveration/decoder.py b/comfy/ldm/jeveration/decoder.pynew file mode 100644index 000000000..cd1fd54bd--- /dev/null+++ b/comfy/ldm/jeveration/decoder.py@@ -0,0 +1,42 @@+"""Jeveration's 512 px decoder: TA-TiTok's text-aware ViT decoder, 128 code vectors + 77 CLIP text tokens -> RGB."""+import torch+import torch.nn as nn++import comfy.model_management+import comfy.ops+from comfy.clip_model import CLIPEncoder++ops = comfy.ops.disable_weight_init+++class JeverationDecoder(nn.Module):+ def __init__(self, width=1024, layers=24, heads=16, code_dim=64, num_codes=128, text_dim=768, text_len=77, patch_size=16, grid_size=32,+ dtype=None, device=None, operations=ops):+ super().__init__()+ self.patch_size, self.grid_size = patch_size, grid_size+ self.decoder_embed = operations.Linear(code_dim, width, dtype=dtype, device=device)+ self.class_embedding = nn.Parameter(torch.empty(1, width, dtype=dtype, device=device))+ self.positional_embedding = nn.Parameter(torch.empty(grid_size ** 2 + 1, width, dtype=dtype, device=device))+ self.mask_token = nn.Parameter(torch.empty(1, 1, width, dtype=dtype, device=device))+ self.latent_token_positional_embedding = nn.Parameter(torch.empty(num_codes, width, dtype=dtype, device=device))+ self.text_guidance_proj = operations.Linear(text_dim, width, dtype=dtype, device=device)+ self.text_guidance_positional_embedding = nn.Parameter(torch.empty(text_len, width, dtype=dtype, device=device))+ self.ln_pre = operations.LayerNorm(width, dtype=dtype, device=device)+ self.transformer = CLIPEncoder(layers, width, heads, 4 * width, "gelu", dtype, device, operations)+ self.ln_post = operations.LayerNorm(width, dtype=dtype, device=device)+ self.ffn = operations.Conv2d(width, patch_size * patch_size * 3, 1, dtype=dtype, device=device)+ self.conv_out = operations.Conv2d(3, 3, 3, padding=1, dtype=dtype, device=device)++ def decode(self, z, text_guidance):+ """z [B, code_dim, num_codes] code vectors, text_guidance [1 or B, 77, 768] CLIP text tokens -> image [B, 3, 512, 512]"""+ b, g, p = z.shape[0], self.grid_size, self.patch_size+ x = self.decoder_embed(z.transpose(1, 2)) + comfy.ops.cast_to_input(self.latent_token_positional_embedding, z)+ image_tokens = torch.cat([comfy.ops.cast_to_input(self.class_embedding, z).unsqueeze(0).expand(b, -1, -1),+ comfy.ops.cast_to_input(self.mask_token, z).expand(b, g * g, -1)], 1)+ image_tokens = image_tokens + comfy.ops.cast_to_input(self.positional_embedding, z)+ tg = comfy.model_management.cast_to(text_guidance, z.dtype, z.device).expand(b, -1, -1)+ tg = self.text_guidance_proj(tg) + comfy.ops.cast_to_input(self.text_guidance_positional_embedding, z)+ x, _ = self.transformer(self.ln_pre(torch.cat([image_tokens, x, tg], 1)))+ x = self.ln_post(x[:, 1:1 + g * g]).transpose(1, 2).reshape(b, -1, g, g)+ x = self.ffn(x).reshape(b, p, p, 3, g, g).permute(0, 3, 4, 1, 5, 2).reshape(b, 3, g * p, g * p)+ return self.conv_out(x)diff --git a/comfy/ldm/jeveration/model.py b/comfy/ldm/jeveration/model.pynew file mode 100644index 000000000..9e0c218d0--- /dev/null+++ b/comfy/ldm/jeveration/model.py@@ -0,0 +1,146 @@+"""Jeveration text-to-image: Qwen3.5-4B (LoRA merged) answers a prompt with 128 codebook decisions in one forward pass.++[chat prompt] [128 decision tokens from the random state] -> backbone (decision tokens attend to each other in both+directions) -> image head -> logits over the codebook at every position -> one draw -> code vectors [B, 64, 128].+"""+import math++import torch+import torch.nn as nn+import torch.nn.functional as F++import comfy.model_management+import comfy.model_prefetch+import comfy.ops+from comfy.ldm.modules.attention import AttentionTensorContainer, ComfyAttention, optimized_attention, optimized_attention_for_device+from comfy.ldm.modules.diffusionmodules.util import timestep_embedding+from comfy.text_encoders.qwen35 import Qwen35Transformer, _make_config++NUM_CODES = 128+CODE_DIM = 64+CODEBOOK_SIZE = 8192+MASK_PROB = 0.6+STATE_NOISE = 0.1+TIME_DIM = 256+++class TimeMLP(nn.Module):+ def __init__(self, hidden, dtype=None, device=None, operations=None):+ super().__init__()+ self.net = nn.Sequential(operations.Linear(TIME_DIM, hidden, dtype=dtype, device=device), nn.SiLU(),+ operations.Linear(hidden, hidden, dtype=dtype, device=device))++ def forward(self, t, dtype):+ return self.net(timestep_embedding(t, TIME_DIM).to(dtype))+++class CondEmbed(nn.Module):+ def __init__(self, dim=512, dtype=None, device=None, operations=None):+ super().__init__()+ self.net = nn.Sequential(operations.Linear(5 * TIME_DIM, dim, dtype=dtype, device=device), nn.SiLU(),+ operations.Linear(dim, dim, dtype=dtype, device=device))++ def forward(self, t, dtype):+ zero, one = torch.zeros_like(t), torch.ones_like(t)+ return self.net(torch.cat([timestep_embedding(p, TIME_DIM) for p in (t, zero, zero, zero, one)], 1).to(dtype))+++class HeadBlock(nn.Module):+ def __init__(self, width, heads, cdim, dtype=None, device=None, operations=None):+ super().__init__()+ self.heads = heads+ self.n1 = operations.LayerNorm(width, elementwise_affine=False, eps=1e-6, dtype=dtype, device=device)+ self.qkv = operations.Linear(width, 3 * width, dtype=dtype, device=device)+ self.proj = operations.Linear(width, width, dtype=dtype, device=device)+ self.n2 = operations.LayerNorm(width, elementwise_affine=False, eps=1e-6, dtype=dtype, device=device)+ self.mlp = nn.Sequential(operations.Linear(width, 4 * width, dtype=dtype, device=device), nn.GELU(approximate="tanh"),+ operations.Linear(4 * width, width, dtype=dtype, device=device))+ self.ada = operations.Linear(cdim, 6 * width, dtype=dtype, device=device)+ self.comfy_attention = ComfyAttention()++ def forward(self, x, c, transformer_options={}):+ b, n, w = x.shape+ sh1, sc1, g1, sh2, sc2, g2 = self.ada(F.silu(c)).unsqueeze(1).chunk(6, dim=-1)+ q, k, v = self.qkv(torch.addcmul(sh1, self.n1(x), 1 + sc1)).view(b, n, 3, self.heads, w // self.heads).permute(2, 0, 3, 1, 4)+ q, k, v = AttentionTensorContainer(q), AttentionTensorContainer(k), AttentionTensorContainer(v)+ a = optimized_attention(q, k, v, self.heads, skip_reshape=True, preferred_attention=self.comfy_attention, transformer_options=transformer_options)+ x = torch.addcmul(x, g1, self.proj(a))+ return torch.addcmul(x, g2, self.mlp(torch.addcmul(sh2, self.n2(x), 1 + sc2)))+++class ImageHead(nn.Module):+ def __init__(self, in_dim, width=2048, depth=8, heads=16, cdim=512, dtype=None, device=None, operations=None):+ super().__init__()+ self.inp = operations.Linear(in_dim, width, dtype=dtype, device=device)+ self.zin = operations.Linear(CODE_DIM, width, dtype=dtype, device=device)+ self.pos = nn.Parameter(torch.empty(NUM_CODES, width, dtype=dtype, device=device))+ self.blocks = nn.ModuleList([HeadBlock(width, heads, cdim, dtype=dtype, device=device, operations=operations) for _ in range(depth)])+ self.nf = operations.LayerNorm(width, elementwise_affine=False, eps=1e-6, dtype=dtype, device=device)+ self.ada_f = operations.Linear(cdim, 2 * width, dtype=dtype, device=device)+ self.out = operations.Linear(width, CODE_DIM, dtype=dtype, device=device)++ def forward(self, hq, state, c, transformer_options={}):+ x = self.inp(hq) + self.zin(state) + comfy.ops.cast_to_input(self.pos, hq)+ for blk in self.blocks:+ x = blk(x, c, transformer_options)+ sh, sc = self.ada_f(F.silu(c)).unsqueeze(1).chunk(2, dim=-1)+ u = torch.addcmul(sh, self.nf(x), 1 + sc)+ return self.out(u), u+++class Jeveration(nn.Module):+ def __init__(self, image_model=None, dtype=None, device=None, operations=None, **kwargs):+ super().__init__()+ self.dtype = dtype+ self.lm = Qwen35Transformer(_make_config("qwen35_4b"), device=device, dtype=dtype, ops=operations)+ hidden = self.lm.config.hidden_size+ self.z_in = operations.Linear(CODE_DIM, hidden, dtype=dtype, device=device)+ self.z_pos = nn.Parameter(torch.empty(NUM_CODES, hidden, dtype=dtype, device=device))+ self.mask_emb = nn.Parameter(torch.empty(CODE_DIM, dtype=dtype, device=device))+ self.t_mlp = TimeMLP(hidden, dtype=dtype, device=device, operations=operations)+ self.h_mlp = TimeMLP(hidden, dtype=dtype, device=device, operations=operations)+ self.cond = CondEmbed(dtype=dtype, device=device, operations=operations)+ self.head = ImageHead(hidden, dtype=dtype, device=device, operations=operations)+ self.code_head = operations.Linear(CODE_DIM, CODEBOOK_SIZE, dtype=dtype, device=device)+ self.code_wide = operations.Linear(2048, CODEBOOK_SIZE, dtype=dtype, device=device)+ self.register_buffer("codebook", torch.empty(CODEBOOK_SIZE, CODE_DIM, dtype=dtype, device=device))+ self.register_buffer("lat_mean", torch.empty(CODE_DIM, dtype=dtype, device=device))+ self.register_buffer("lat_std", torch.empty(CODE_DIM, dtype=dtype, device=device))++ def random_state(self, masked, rand_ids, noise):+ """masked [B, N] bool, rand_ids [B, N], noise [B, N, C] -> (state [B, N, C] in the dtype of noise, masked share t [B])"""+ dev = noise.device+ mean = comfy.model_management.cast_to(self.lat_mean, torch.float32, dev)+ std = comfy.model_management.cast_to(self.lat_std, torch.float32, dev)+ codes = (comfy.model_management.cast_to(self.codebook, torch.float32, dev)[rand_ids] - mean) / std+ state = torch.where(masked.unsqueeze(-1), comfy.model_management.cast_to(self.mask_emb, torch.float32, dev), codes)+ state = torch.add(STATE_NOISE * noise.float(), state, alpha=math.sqrt(1 - STATE_NOISE ** 2))+ return state.to(noise.dtype), masked.float().mean(1)++ def code_logits(self, input_ids, state, t, transformer_options={}):+ """input_ids [B, L] chat prompt, state [B, N, C] in the compute dtype, t [B] -> logits [B, N, codebook size]"""+ dtype = state.dtype+ emb = self.lm.embed_tokens(input_ids, out_dtype=dtype)+ tail = self.z_in(state) + comfy.ops.cast_to_input(self.z_pos, state) + (self.t_mlp(t, dtype) + self.h_mlp(torch.zeros_like(t), dtype)).unsqueeze(1)+ x = torch.cat([emb, tail], 1)++ length, dev = x.shape[1], x.device+ mask = torch.full((length, length), torch.finfo(dtype).min / 4, dtype=dtype, device=dev).triu_(1)+ mask[length - NUM_CODES:, length - NUM_CODES:] = 0+ freqs_cis = self.lm.compute_freqs_cis(torch.arange(length, device=dev).unsqueeze(0), dev)+ attention = optimized_attention_for_device(dev, mask=True, small_input=True)++ prefetch_queue = comfy.model_prefetch.make_prefetch_queue(list(self.lm.layers), dev, transformer_options)+ for layer in self.lm.layers:+ comfy.model_prefetch.prefetch_queue_pop(prefetch_queue, dev, layer, dtype, malloc_scope="block")+ x, _ = layer(x=x, attention_mask=mask, freqs_cis=freqs_cis, optimized_attention=attention)+ comfy.model_prefetch.prefetch_queue_pop(prefetch_queue, dev, None, malloc_scope="block")++ proj, u = self.head(self.lm.norm(x[:, -NUM_CODES:]), state, self.cond(t, dtype), transformer_options)+ return self.code_head(proj) + self.code_wide(u)++ def forward(self, input_ids, masked, rand_ids, noise, gumbel, transformer_options={}):+ """one joint decision; noise in the compute dtype, gumbel [B, N, K] Gumbel(0, 1) noise -> code vectors [B, C, N]"""+ state, t = self.random_state(masked, rand_ids, noise)+ codes = (self.code_logits(input_ids, state, t, transformer_options).float() + gumbel).argmax(-1)+ return comfy.model_management.cast_to(self.codebook, noise.dtype, codes.device)[codes].transpose(1, 2)diff --git a/comfy/model_base.py b/comfy/model_base.pyindex f44000f52..29fc96543 100644--- a/comfy/model_base.py+++ b/comfy/model_base.py@@ -57,6 +57,7 @@ import comfy.ldm.wan.model_vsr import comfy.ldm.hunyuan3d.model import comfy.ldm.triposplat.model import comfy.ldm.hidream.model+import comfy.ldm.jeveration.model import comfy.ldm.chroma.model import comfy.ldm.chroma_radiance.model import comfy.ldm.pixeldit.model@@ -3144,6 +3145,15 @@ class RT_DETR_v4(BaseModel): super().__init__(model_config, model_type, device=device, unet_model=comfy.ldm.rt_detr.rtdetr_v4.RTv4) +class Jeveration(BaseModel):+ def __init__(self, model_config, model_type=ModelType.FLOW, device=None):+ super().__init__(model_config, model_type, device=device, unet_model=comfy.ldm.jeveration.model.Jeveration)++ def generate_codes(self, input_ids, masked, rand_ids, noise, gumbel):+ transformer_options = {"prefetch_dynamic_vbars": self.current_patcher is not None and self.current_patcher.is_dynamic()}+ return self.diffusion_model(input_ids, masked, rand_ids, noise, gumbel, transformer_options=transformer_options)++ class DepthAnything3(BaseModel): def __init__(self, model_config, model_type=ModelType.FLOW, device=None): super().__init__(model_config, model_type, device=device,diff --git a/comfy/model_detection.py b/comfy/model_detection.pyindex 2c1aead04..15a0c89a4 100644--- a/comfy/model_detection.py+++ b/comfy/model_detection.py@@ -845,6 +845,9 @@ def detect_unet_config(state_dict, key_prefix, metadata=None): if '{}t_embedder1.mlp.0.weight'.format(key_prefix) in state_dict_keys and '{}x_embedder.proj1.weight'.format(key_prefix) in state_dict_keys: # HiDream-O1 return {"image_model": "hidream_o1"} + if '{}code_wide.weight'.format(key_prefix) in state_dict_keys and '{}head.ada_f.weight'.format(key_prefix) in state_dict_keys: # Jeveration+ return {"image_model": "jeveration"}+ vision_key = f"{key_prefix}patch_embed.patch_embedding.weight" query_key = f"{key_prefix}layers.0.self_attn.q_proj.weight" pixel_head_key = f"{key_prefix}head.conv1.weight"diff --git a/comfy/sd.py b/comfy/sd.pyindex 07f6b0048..b8b9166fb 100644--- a/comfy/sd.py+++ b/comfy/sd.py@@ -28,6 +28,7 @@ import comfy.ldm.hunyuan_video.vae import comfy.ldm.mmaudio.vae.autoencoder import comfy.ldm.audio.vae_sa3 import comfy.ldm.minimax_music.dav+import comfy.ldm.jeveration.decoder import comfy.ldm.modules.diffusionmodules.model import comfy.pixel_space_convert import comfy.weight_adapter@@ -554,6 +555,16 @@ class VAE: def _no_encode(*args, **kwargs): raise RuntimeError("MiniMax Music3 DAV cannot encode audio") self.memory_used_encode = _no_encode+ elif "text_guidance_proj.weight" in sd and "latent_token_positional_embedding" in sd: # Jeveration+ self.first_stage_model = comfy.ldm.jeveration.decoder.JeverationDecoder()+ self.latent_channels = 64+ self.latent_dim = 1+ self.process_output = lambda image: image.clamp_(0.0, 1.0)+ self.working_dtypes = [torch.bfloat16, torch.float32]+ self.memory_used_decode = lambda shape, dtype: shape[0] * 200 * 1024 * 1024 * model_management.dtype_size(dtype)+ def _no_encode(*args, **kwargs):+ raise RuntimeError("The Jeveration decoder cannot encode images")+ self.memory_used_encode = _no_encode elif "decoder.mid.block_1.mix_factor" in sd: encoder_config = {'double_z': True, 'z_channels': 4, 'resolution': 256, 'in_channels': 3, 'out_ch': 3, 'ch': 128, 'ch_mult': [1, 2, 4, 4], 'num_res_blocks': 2, 'attn_resolutions': [], 'dropout': 0.0} decoder_config = encoder_config.copy()diff --git a/comfy/supported_models.py b/comfy/supported_models.pyindex a0822bf74..bd453bfb1 100644--- a/comfy/supported_models.py+++ b/comfy/supported_models.py@@ -35,6 +35,7 @@ import comfy.text_encoders.mage_flow import comfy.text_encoders.joyimage import comfy.text_encoders.anima import comfy.text_encoders.ace15+import comfy.text_encoders.jeveration import comfy.text_encoders.yue2 import comfy.text_encoders.longcat_image import comfy.text_encoders.ernie@@ -1789,6 +1790,23 @@ class HiDreamO1(supported_models_base.BASE): comfy.text_encoders.hidream_o1.HiDreamO1TE, ) +class Jeveration(supported_models_base.BASE):+ unet_config = {+ "image_model": "jeveration",+ }++ latent_format = latent_formats.Jeveration+ supported_inference_dtypes = [torch.bfloat16, torch.float32]++ vae_key_prefix = ["vae."]+ text_encoder_key_prefix = ["text_encoders."]++ def get_model(self, state_dict, prefix="", device=None):+ return model_base.Jeveration(self, device=device)++ def clip_target(self, state_dict={}):+ return supported_models_base.ClipTarget(comfy.text_encoders.jeveration.JeverationTokenizer, comfy.text_encoders.jeveration.JeverationTEModel)+ class SenseNovaU15(supported_models_base.BASE): unet_config = { "image_model": "sensenova_u15",@@ -2780,6 +2798,7 @@ models = [ TripoSplat, HiDream, HiDreamO1,+ Jeveration, SenseNovaU15, Chroma, SeedVR2,diff --git a/comfy/text_encoders/jeveration.py b/comfy/text_encoders/jeveration.pynew file mode 100644index 000000000..7c300f50d--- /dev/null+++ b/comfy/text_encoders/jeveration.py@@ -0,0 +1,52 @@+"""Jeveration text encoder: the CLIP-L text tower of OpenAI's ViT-L/14-336 (read by the image decoder) and the Qwen3.5 chat+prompt ids (read by the backbone in diffusion_model)."""+import torch++from comfy import sd1_clip+from comfy.text_encoders.qwen35 import Qwen35Tokenizer++MAX_PROMPT_TOKENS = 128+CHAT_HEAD = "<|im_start|>user\nGenerate an image: "+CHAT_TAIL = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"+++class JeverationTokenizer:+ def __init__(self, embedding_directory=None, tokenizer_data={}):+ self.clip_l = sd1_clip.SDTokenizer(pad_token=0, embedding_directory=embedding_directory, tokenizer_data=tokenizer_data)+ self.qwen = Qwen35Tokenizer(embedding_directory=embedding_directory, tokenizer_data=tokenizer_data).tokenizer+ self.head_ids = self.qwen(CHAT_HEAD, add_special_tokens=False)["input_ids"]+ self.tail_ids = self.qwen(CHAT_TAIL, add_special_tokens=False)["input_ids"]++ def tokenize_with_weights(self, text, return_word_ids=False, **kwargs):+ # The decoder reads exactly one 77 token CLIP window; upstream truncates longer prompts.+ out = {"l": self.clip_l.tokenize_with_weights(text, return_word_ids, disable_weights=True, **kwargs)[:1]}+ prompt_ids = self.qwen(text, add_special_tokens=False)["input_ids"][:MAX_PROMPT_TOKENS]+ out["jeveration"] = self.head_ids + prompt_ids + self.tail_ids+ return out++ def untokenize(self, token_weight_pair):+ return self.clip_l.untokenize(token_weight_pair)++ def state_dict(self):+ return {}+++class JeverationTEModel(torch.nn.Module):+ def __init__(self, device="cpu", dtype=None, model_options={}):+ super().__init__()+ self.clip_l = sd1_clip.SDClipModel(device=device, dtype=dtype, special_tokens={"start": 49406, "end": 49407, "pad": 0},+ return_projected_pooled=False, model_options=model_options)+ self.dtypes = {dtype}++ def set_clip_options(self, options):+ self.clip_l.set_clip_options(options)++ def reset_clip_options(self):+ self.clip_l.reset_clip_options()++ def encode_token_weights(self, token_weight_pairs):+ out, pooled = self.clip_l.encode_token_weights(token_weight_pairs["l"])+ return out, pooled, {"text_input_ids": torch.tensor([token_weight_pairs["jeveration"]], dtype=torch.long)}++ def load_sd(self, sd):+ return self.clip_l.load_sd(sd)diff --git a/comfy_extras/nodes_jeveration.py b/comfy_extras/nodes_jeveration.pynew file mode 100644index 000000000..3df792559--- /dev/null+++ b/comfy_extras/nodes_jeveration.py@@ -0,0 +1,70 @@+from typing_extensions import override++import torch++import comfy.model_management+from comfy.ldm.jeveration.model import CODE_DIM, CODEBOOK_SIZE, MASK_PROB, NUM_CODES+from comfy_api.latest import ComfyExtension, io+++class JeverationSampler(io.ComfyNode):+ @classmethod+ def define_schema(cls):+ return io.Schema(+ node_id="JeverationSampler",+ display_name="Jeveration Sampler",+ category="model/sampling/jeveration",+ description="Generates the codes of a 512x512 image in a single forward pass of a Jeveration model.",+ inputs=[+ io.Model.Input("model"),+ io.Conditioning.Input("positive"),+ io.Int.Input("seed", default=0, min=0, max=0xffffffffffffffff, control_after_generate=True),+ io.Int.Input("batch_size", default=1, min=1, max=4096),+ ],+ outputs=[io.Latent.Output()],+ )++ @classmethod+ def execute(cls, model, positive, seed, batch_size) -> io.NodeOutput:+ generator = torch.Generator().manual_seed(seed)+ masked = torch.rand(batch_size, NUM_CODES, generator=generator) < MASK_PROB+ rand_ids = torch.randint(0, CODEBOOK_SIZE, (batch_size, NUM_CODES), generator=generator)+ noise = torch.randn(batch_size, NUM_CODES, CODE_DIM, generator=generator)+ gumbel = -torch.empty(batch_size, NUM_CODES, CODEBOOK_SIZE).exponential_(generator=generator).log()++ comfy.model_management.load_model_gpu(model)+ device, dtype = model.load_device, model.model.get_dtype_inference()+ input_ids = positive[0][1]["text_input_ids"].expand(batch_size, -1)+ samples = model.model.generate_codes(input_ids.to(device), masked.to(device), rand_ids.to(device), noise.to(device, dtype), gumbel.to(device))+ return io.NodeOutput({"samples": samples.to(comfy.model_management.intermediate_device())})+++class JeverationDecode(io.ComfyNode):+ @classmethod+ def define_schema(cls):+ return io.Schema(+ node_id="JeverationDecode",+ display_name="Jeveration Decode",+ category="model/latent/jeveration",+ description="Decodes Jeveration codes into an image; the decoder also reads the prompt's CLIP text tokens.",+ inputs=[+ io.Vae.Input("vae"),+ io.Latent.Input("samples"),+ io.Conditioning.Input("positive"),+ ],+ outputs=[io.Image.Output()],+ )++ @classmethod+ def execute(cls, vae, samples, positive) -> io.NodeOutput:+ return io.NodeOutput(vae.decode(samples["samples"], vae_options={"text_guidance": positive[0][0]}))+++class JeverationExtension(ComfyExtension):+ @override+ async def get_node_list(self) -> list[type[io.ComfyNode]]:+ return [JeverationSampler, JeverationDecode]+++async def comfy_entrypoint() -> JeverationExtension:+ return JeverationExtension()diff --git a/nodes.py b/nodes.pyindex 5ba3a32a9..f08664dd1 100644--- a/nodes.py+++ b/nodes.py@@ -2551,6 +2551,7 @@ async def init_builtin_extra_nodes(): "nodes_void.py", "nodes_wandancer.py", "nodes_hidream_o1.py",+ "nodes_jeveration.py", "nodes_sensenova.py", "nodes_save_3d.py", "nodes_mesh_io.py",123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103"""Repackage Jeveration text-to-image as one ComfyUI checkpoint.
usage (ComfyUI venv, from the ComfyUI root): python /path/to/convert_jeveration.py <weights dir> models/checkpoints/jeveration_t2i_bf16.safetensors python /path/to/convert_jeveration.py --int8-convrot <weights dir> models/checkpoints/jeveration_t2i_int8_convrot.safetensors
--int8-convrot stores the Qwen3.5 backbone linears (attention, linear attention, MLP) as per-channel int8 with a256-wide Hadamard rotation (ComfyUI "int8_tensorwise" + convrot), quantized from the fp32 LoRA-merged weights.Embeddings, norms, the tiny in_proj_a/b gates, image head, VAE and text encoder stay bf16.
<weights dir> holds: jeveration/{jeveration,decoder512}.pt, qwen35_4b/*.safetensors (Qwen/Qwen3.5-4B),tatitok/model.safetensors (turkeyju/tokenizer_tatitok_bl128_vq), clip336/open_clip_model.safetensors(timm/vit_large_patch14_clip_336.openai)."""import argparseimport globimport jsonimport osimport sys
sys.path.insert(0, os.getcwd())
import torch # noqa: E402from safetensors.torch import load_file, save_file # noqa: E402
import comfy.utils # noqa: E402from comfy.quant_ops import QuantizedTensor # noqa: E402
ap = argparse.ArgumentParser()ap.add_argument("weights")ap.add_argument("out")ap.add_argument("--int8-convrot", action="store_true")args = ap.parse_args()W, OUT = args.weights, args.outDT = torch.bfloat16out = {}QUANT = (".mlp.gate_proj.weight", ".mlp.up_proj.weight", ".mlp.down_proj.weight", ".self_attn.q_proj.weight", ".self_attn.k_proj.weight", ".self_attn.v_proj.weight", ".self_attn.o_proj.weight", ".linear_attn.in_proj_qkv.weight", ".linear_attn.in_proj_z.weight", ".linear_attn.out_proj.weight")QCONF = torch.tensor(list(json.dumps({"format": "int8_tensorwise", "convrot": True, "convrot_groupsize": 256}).encode()), dtype=torch.uint8)DEV = "cuda" if torch.cuda.is_available() else "cpu"
def store_lm(k, w): key = "model.diffusion_model." + k if args.int8_convrot and k.startswith("lm.layers.") and k.endswith(QUANT): qt = QuantizedTensor.from_float(w.to(DEV, torch.float32), "TensorWiseINT8Layout", per_channel=True, convrot=True, convrot_groupsize=256) out.update({n: t.cpu().contiguous() for n, t in qt.state_dict(key).items()}) out[key[:-len("weight")] + "comfy_quant"] = QCONF.clone() else: out[key] = w.to(DT).contiguous()
# ---- model.diffusion_model: Qwen3.5-4B language model with the LoRA merged in, heads, codebook ---------------------------------ck = torch.load(f"{W}/jeveration/jeveration.pt", map_location="cpu", mmap=True, weights_only=True)ema = ck["ema"]lm = {}for f in sorted(glob.glob(f"{W}/qwen35_4b/*.safetensors")): lm.update({"lm." + k[len("model.language_model."):]: v for k, v in load_file(f).items() if k.startswith("model.language_model.")})for k in [k for k in ema if k.endswith(".lora_A")]: base = k[:-len(".lora_A")] + ".weight" store_lm(base, lm.pop(base).float() + ema[k[:-1] + "B"].float() @ ema[k].float()) # alpha == rank: scale 1heads = {k: v for k, v in ema.items() if not (k.startswith("lm.") or k.startswith("dense_"))}
def swap_halves(w, chunks): # upstream sinusoids are [sin, cos], ComfyUI's timestep_embedding gives [cos, sin] parts = [] for c in w.chunk(chunks, dim=1): h = c.shape[1] // 2 parts += [c[:, h:], c[:, :h]] return torch.cat(parts, 1)
for name in ("t_mlp", "h_mlp"): heads[f"{name}.net.0.weight"] = swap_halves(heads[f"{name}.net.0.weight"], 1)heads["cond.net.0.weight"] = swap_halves(heads["cond.net.0.weight"], 5)heads["lat_mean"], heads["lat_std"] = ck["lat_mean"], ck["lat_std"]heads["codebook"] = load_file(f"{W}/tatitok/model.safetensors")["quantize.embedding.weight"].float().half() # fp16, as upstreamfor k, v in {**lm, **heads}.items(): store_lm(k, v)
# ---- vae: TA-TiTok 512 px text-aware decoder, transformer in ComfyUI CLIP layout -------------------------------------------------dec = torch.load(f"{W}/jeveration/decoder512.pt", map_location="cpu", mmap=True, weights_only=True)["ema_plain"]blocks = {"transformer.resblocks." + k[len("transformer."):]: v for k, v in dec.items() if k.startswith("transformer.")}blocks = comfy.utils.transformers_convert(blocks, "", "", 24)assert all(k.startswith("encoder.layers.") for k in blocks), [k for k in blocks if not k.startswith("encoder.layers.")][:5]dec = {k: v for k, v in dec.items() if not k.startswith("transformer.")}dec.update({"transformer.layers." + k[len("encoder.layers."):]: v for k, v in blocks.items()})dec = {("ffn." + k[len("ffn.0."):] if k.startswith("ffn.0.") else k): v for k, v in dec.items()}for k, v in dec.items(): out["vae." + k] = v.to(DT).contiguous()
# ---- text_encoders: CLIP ViT-L/14-336 text tower in HF layout --------------------------------------------------------------------clip = {k: v for k, v in load_file(f"{W}/clip336/open_clip_model.safetensors").items() if not k.startswith("visual.")}clip = comfy.utils.clip_text_transformers_convert(clip, "", "")for k, v in clip.items(): out[("text_encoders.clip_l." if k == "logit_scale" else "text_encoders.clip_l.transformer.") + k] = v.to(DT).contiguous()
print(f"{len(out)} tensors, {sum(v.nbytes for v in out.values()) / 1e9:.2f} GB")for p in ("model.diffusion_model.", "vae.", "text_encoders."): print(f" {p:24s} {sum(v.nbytes for k, v in out.items() if k.startswith(p)) / 1e9:6.2f} GB")save_file(out, OUT, metadata={"source": "linlinlinlinsdada/Jeveration (Apache-2.0), Qwen/Qwen3.5-4B, turkeyju/tokenizer_tatitok_bl128_vq, OpenAI CLIP ViT-L/14-336"})LICENSEAdded+202
NOTICEAdded+13
README.md+166
comfyui-jeveration-v0.46.1.patchAdded+476
convert_jeveration.pyAdded+103