Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354---license: otherlicense_name: unspecified-upstreambase_model: GrayShine/WeGen2pipeline_tag: text-to-imagetags: - nvfp4 - text-to-image - image-editing - pixel-space - mixture-of-experts---
# WeGen2, NVFP4 single file
An unofficial conversion of [GrayShine/WeGen2](https://huggingface.co/GrayShine/WeGen2) (49 BF16 shards, 123 GB) intoone 39.6 GB safetensors file. The routed experts are quantized to NVFP4; everything else is the original BF16. The model,its tokenizer and its pixel patchify and unpatchify are all in the one file.
> **Disclaimer.** This is a community conversion, not a WeChat Vision release. It was uploaded as soon as the> conversion finished, before any image was generated from it. The routed experts are 4-bit, so images will differ from> the original model's. It is not loadable by the `wegen2` package, Diffusers or `transformers`: it is written for the> [comfyui-backend-but-rust](https://github.com/BetaDoggo/comfyui-backend-but-rust) engine's own loader. Use at your own> risk.
The prompt enhancer that the original repository ships in `prompt_enhancer/` (an unchanged[Qwen3-VL-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-30B-A3B-Instruct)) is not included.
## License
The original repository states no license for the WeGen2 weights. This conversion is shared on the same terms as theoriginal; check with its authors before any use that needs a license. Model by WeChat Vision, Tencent, with SJTU andMMLab @ SIAT (Shaobin Zhuang, Zhipeng Huang, Canmiao Fu et al.), [arXiv:2612.01618](https://arxiv.org/abs/2612.01618).
## What the file holds
| Tensors | Format ||---|---|| Routed experts, `language_model.model.layers.N.mlp_{und,gen}.experts.{gate_up_proj,down_proj}`, shipped as BF16 `[E, N, K]` | NVFP4, each expert scaled on its own: the tensor itself is U8 `[E, N, K/2]`, two E2M1 values a byte, element 2i in the low nibble; `<name>_scale` is F8_E4M3 `[E, N, K/16]`, row major, one scale per 16 columns; `<name>_scale_2` is F32 `[E]`, one per expert. A value is `e2m1 * f32(e4m3) * scale_2[e]`. Each 16-value block's scale is picked from 12 candidates at or below its absolute maximum, for the least squared error. `gate_up_proj` keeps the gate's rows first || Everything else: attention, shared experts, routers, norms, AttnRes projections, embeddings, `lm_head`, the patchify convolutions, `llm2pixel` and the time embedder | BF16 as shipped, under the original names || `tokenizer.json` | The text tokenizer's JSON file, as U8 bytes |
The `__metadata__` holds `wegen2` (the format, `wegen2-nvfp4-v1`) and `config` (the original `config.json`).
## Making it yourself
The conversion script downloads up to eight original shards at a time into RAM, converts each and drops it, so it needsonly the output's disk space. It needs Python with torch and a CUDA GPU. The two scripts are included here and live inthe engine's repository as `tools/wegen2_convert.py` and `tools/nemotron_image_convert.py` (whose download, NVFP4 andwriter code it shares):
```python wegen2_convert.py WeGen2-nvfp4.safetensors```README.mdAdded+54