r/StableDiffusion • • 21h ago

Resource - Update Introducing XEIRON: a new quantization method that stores model weights in polar form

Update: several of you asked about int8convrot. I measured it, and the results are at the bottom (short version: it is faster, XEIRON at 4 bits is much smaller and uses less VRAM).

I would like to share XEIRON, a new way of quantizing models that I built with one goal: keeping the image as close as possible to the original while making generation faster and lighter on memory.

In my tests, the improvement shows in both: images that stay faithful to the original model, and less waiting for each one. Don't just take my word for it: look at the comparisons below, try it yourself, and tell me what you think.

The idea

GGUF and most other methods store each weight as a small integer on a uniform scale. XEIRON stores weights in pairs, in polar form: an angle and a radius. Four weights give two angles, which is a point on the Clifford torus.

  • A sine and a cosine rebuild each weight on the GPU, right before the multiplication, so the full model is never expanded in memory.
  • The matrix multiplications run in int8 on the tensor cores.
  • Bits are allocated per tensor according to how much its error damages the output.
  • The .xeiron file is signed (Ed25519) and carries SHA-256 hashes and per-tensor quality figures.

Quality vs GGUF

RTX 5090, 100 generations per model (95 distinct prompts), PSNR against the original bf16 image, paired per prompt, 95% confidence intervals.

Model: XEIRON vs GGUF Bits/weight PSNR (dB) Difference
Z-Image A4-L vs Q4_K_M 4.79 / 5.01 21.99 / 22.60 -0.61 (worse)
Z-Image A5-S vs Q4_K_M 5.28 / 5.01 23.56 / 22.60 +0.96 (better)
Z-Image A6-L vs Q6_K 6.75 / 7.00 27.89 / 27.64 +0.26 (not significant)
Z-Image A8-S vs Q8_0 8.22 / 9.39 31.21 / 31.07 +0.14 (not significant)
Krea-2 A4-S vs Q4_K_M 4.48 / 4.67 19.86 / 19.80 +0.06 (not significant)
Krea-2 A4-L vs Q4_K_M 4.82 / 4.67 21.36 / 19.80 +1.55 (better)
Krea-2 A6-S vs Q6_K 6.28 / 6.61 24.58 / 24.16 +0.42 (not significant)
Krea-2 A8-S vs Q8_0 8.23 / 8.55 27.06 / 26.58 +0.48 (not significant)

Speed and memory

At 4 and 6 bits, each image is generated 1.5x to 1.9x faster than with GGUF (1.8x to 2.4x with fused kernels applied to both).

RTX 5090, time per image, no fusion:

Model and level Original bf16 XEIRON GGUF
Z-Image A4-L vs Q4_K_M 2.84 s 2.34 s 4.19 s
Z-Image A5-S vs Q4_K_M 2.84 s 2.37 s 4.19 s
Z-Image A6-L vs Q6_K 2.84 s 2.61 s 4.07 s
Z-Image A8-S vs Q8_0 2.84 s 3.04 s 3.10 s
Krea-2 A4-S vs Q4_K_M 6.30 s 5.21 s 8.44 s
Krea-2 A4-L vs Q4_K_M 6.30 s 5.22 s 8.44 s
Krea-2 A6-S vs Q6_K 6.30 s 5.41 s 8.90 s
Krea-2 A8-S vs Q8_0 6.30 s 6.68 s 7.09 s

RTX 5090, with fused kernels applied to all three formats:

Model and level Original bf16 XEIRON GGUF
Z-Image A4-L vs Q4_K_M 2.04 s 1.78 s 3.75 s
Z-Image A5-S vs Q4_K_M 2.04 s 1.80 s 3.75 s
Z-Image A6-L vs Q6_K 2.04 s 2.02 s 3.63 s
Z-Image A8-S vs Q8_0 2.04 s 2.41 s 2.47 s
Krea-2 A4-S vs Q4_K_M 5.09 s 4.28 s 7.52 s
Krea-2 A4-L vs Q4_K_M 5.09 s 4.28 s 7.52 s
Krea-2 A6-S vs Q6_K 5.09 s 4.46 s 7.99 s
Krea-2 A8-S vs Q8_0 5.09 s 5.65 s 5.76 s

RTX 5070 Ti (16 GB), no fusion:

Model and level Original bf16 XEIRON GGUF Q4_K_M
Z-Image A5-S 6.91 s 5.69 s 10.70 s
Krea-2 A4-L 39.66 s (RAM offload) 10.85 s 19.60 s

Compared with bf16, weights take 70% less space (A4-L) and peak VRAM drops by 59 to 63%.

Where it does not win

  • Against GGUF there is little or no memory advantage at similar quality, except at 8 bits.
  • At 8 bits, quality and speed are about the same as Q8_0, although XEIRON uses fewer bits.
  • Z-Image A4-L loses to Q4_K_M.
  • Only two image models, two Blackwell GPUs, Linux, no FlashAttention. The only measured comparison here is against GGUF.
  • PSNR measures closeness to the original model's image, not how good the picture is.

Update: comparison with int8convrot

First, context: this is not the same league. int8convrot is 8-bit INT8 with a rotation. XEIRON's target is maximum quality with the lowest VRAM and the highest speed possible at 6, 4, 3 and even 2 bits, and my original yardstick was GGUF and other 4-bit quantizers.

RTX 5070 Ti (16 GB), Windows 11, ComfyUI 0.47, torch 2.14.1, Triton 3.9. 1024x1024, 8 steps, seed 4386, 10 prompts, same embeddings, noise and sigmas. Transformer time only.

Model and variant File size Seconds per image GPU VRAM
Z-Image-Turbo int8convrot 5.87 GiB 2.94 8.2 GiB
Z-Image-Turbo XEIRON A4-L 3.43 GiB 4.28 6.1 GiB
Krea-2-Turbo int8convrot 12.57 GiB 5.71 15.2 GiB*
Krea-2-Turbo XEIRON A4-L 7.20 GiB 9.69 10.4 GiB

*int8convrot uses ComfyUI's DynamicVRAM, which takes the free memory it finds, so this is not its minimum.

  • int8convrot is 1.46x faster on Z-Image and 1.70x faster on Krea-2 than XEIRON A4-L.
  • XEIRON A4-L is about 42% smaller on disk and uses roughly 2 GiB less VRAM on Z-Image and 5 GiB less on Krea-2.
  • At 8 bits XEIRON has no advantage.
  • My ComfyUI plugin is not optimized or integrated enough yet, and my ComfyUI and its environment were outdated in the first tests (with torch 2.9 / Triton 3.5 XEIRON was up to 30% slower). Part of the gap may come from that, and part from my kernel decoding the packed bits on every call. I have not separated the two.
  • I have not measured quality against a bf16 reference yet, only looked at the images by eye. One GPU, Windows only.

Status and what is coming

  • The converter is not included yet. The repository currently contains only the inference side, so you cannot build your own .xeiron files for now. This is on purpose: at this early stage the goal is to test inference on many different computers, and releasing the converter now would fill the place with badly built versions of models. I want to see the community's test results first.
  • Planned soon: the Qwen text encoders used by Z-Image and Krea-2, as .xeiron files for these DiT models.
  • Planned soon: Qwen 3.8 27B.
  • Work in progress: Qwen4-35B-A3B.

If you try it, I would love to know your GPU and how it goes.

Links

Full HTML Evaluations: Inside each model repository on Hugging Face under the evaluations/ folder (full metric tables and comparison images; download the entire folder to open locally in a browser).

Criticism is very welcome, especially of the benchmark methodology.

76 Upvotes

25 comments sorted by

56

u/Apprehensive_Sky892 20h ago

Thanks for sharing this.

But the one comparison that is most relevant to us ComfyUI users is (as few people uses GGUF with ComfyUI):

How does it compare against int8convrot in terms of speed, quality, and VRAM usage?

26

u/blueblood09 20h ago

Exactly. Ever since I discovered int8convrot, I haven't looked elsewhere.

3

u/Aishor 18h ago

Makes sense, it's a strong option. int8convrot is 8-bit, while XEIRON also offers 4- to 6-bit levels with smaller files, so the trade-off may be different. I'd rather measure it directly than guess.

8

u/Aishor 18h ago

Good point, and thanks. I haven't compared against int8convrot yet, so I can't claim anything about speed, quality, or VRAM against it. I'm setting up that exact comparison now (same prompts and seeds) and I'll post the numbers either way.

4

u/Apprehensive_Sky892 17h ago

Thank you, looking forward to the results 🙏

1

u/Aishor 2h ago edited 2h ago

int8convrot is faster. XEIRON at 4 bits gives a much smaller file and uses less VRAM.

Before the numbers, an important point: these two are not in the same league, and this is not the comparison I built XEIRON for. int8convrot is plain 8-bit INT8 with a rotation. XEIRON is a quantization method whose goal is maximum quality with the lowest VRAM and the highest speed possible at 6, 4, 3 and even 2 bits. My original yardstick was GGUF and other 4-bit quantizers, which is what the first post compared against. Setting an 8-bit format against my 4-bit levels was always going to favor the 8-bit one in speed, so please read the results with that in mind.

How I measured

  • RTX 5070 Ti (16 GB), Windows 11, ComfyUI 0.47, torch 2.14.1, Triton 3.9.
  • 1024x1024, 8 Euler steps, seed 4386, 10 prompts per model.
  • Same precomputed text embeddings for every variant, same initial noise, same sigmas.
  • Only the transformer time (the 8 forward passes). VAE and text encoder are not included.
  • A fresh ComfyUI process per variant, warm-up passes discarded, one measured pass per prompt.

Z-Image-Turbo (mean of 10 prompts)

VariantFile sizeSeconds per imageGPU VRAM
int8convrot5.87 GiB2.948.2 GiB
XEIRON A4-L3.43 GiB4.286.1 GiB
XEIRON A8-S5.89 GiB4.308.4 GiB

Krea-2-Turbo (mean of 10 prompts)

VariantFile sizeSeconds per imageGPU VRAM
int8convrot12.57 GiB5.7115.2 GiB*
XEIRON A4-L7.20 GiB9.6910.4 GiB
XEIRON A8-S12.29 GiB9.7115.3 GiB

*int8convrot uses ComfyUI's DynamicVRAM, which takes whatever free memory it finds, so this is not its minimum.

Example images

Same prompt, seed and noise. Left is int8convrot, right is XEIRON A4-L. The compositions differ slightly because tiny differences change the trajectory of an 8-step generation, so this is not a measure of quality. Judge by eye.

What this means

  • int8convrot is 1.46x faster on Z-Image and 1.70x faster on Krea-2 than XEIRON A4-L.
  • XEIRON A4-L is about 42% smaller on disk, and uses roughly 2 GiB less VRAM on Z-Image and 5 GiB less on Krea-2.
  • At 8 bits (A8-S) XEIRON has no advantage: the file is the same size and it is not faster. Its interest is in the 4-bit variants.
  • Outside ComfyUI, in my own test engine on Windows, A4-L takes 4.04 s (Z-Image) and 9.03 s (Krea-2), about 6-7% less than inside ComfyUI. I did not measure int8convrot with that engine.

Caveats about my own setup

  • My ComfyUI plugin is not optimized or integrated enough yet. int8convrot runs on ComfyUI's native kernels, while XEIRON goes through my own Triton kernel inside a plugin that still needs work. Part of the speed gap may come from the integration, although my kernel also decodes the packed bits on every call, while int8convrot works on weights that are already plain int8. I have not separated the two effects.
  • During these first tests I found my ComfyUI and its environment were outdated. With the older versions (torch 2.9 / Triton 3.5) XEIRON was up to 30% slower, and I did not separate which of the two caused it. The numbers above use up-to-date versions.
  • Not the same league. int8convrot is an 8-bit format. XEIRON's target is 6, 4, 3 and 2 bits, where the file and VRAM savings are the point. At 8 bits I do not expect an advantage, and the results confirm it.

What I have NOT measured

  • Quality against a bf16 reference. I only looked at the images by eye, so I am not claiming they are equivalent.
  • Other GPUs, or any system other than Windows.
  • Only one measured pass per prompt, so there is some spread between prompts (about 0.2 s on Z-Image and 0.7 s on Krea-2).

If you see a flaw in the method, tell me and I will repeat it. Quality comparison against the original model is the next thing I want to measure.

1

u/ChemistryEnough5496 2h ago

testing against 8-bit formats is tough at the 4-bit mark though, since the whole appeal of the lower bitrates is fitting the model onto midrange cards without offloading

1

u/Aishor 2h ago

Agreed, that's a big part of it. The point of the 4-bit levels is fitting on mid-range cards: in my test, Z-Image-Turbo A4-L used about 6 GiB of VRAM and Krea-2-Turbo about 10 GiB, both entirely on a 16 GB card with no offload. Comparing against 8-bit mostly shows the speed side, which is why I said it's not the same league.

11

u/level10orc 20h ago

Just a nitpick..can we name things according to what they actually do? I think most people prefer reading either real words or acronyms that mean something.

3

u/Aishor 20h ago

Fair point. XEIRON is just the project name, so on its own it doesn't tell you much. What it does is polar quantization: weights are stored in pairs as an angle and a radius. And in the level names, the number is the approximate bit level and S/L are the smaller and larger versions.

That said, I'm not sure what exactly you're referring to. I can't phrase everything in a way that is clear to everyone. What I'm trying to describe and test is simple: I have another quantization method that works and is faster. As for the quality and size comparisons, they are all made at similar bit levels, and the real bits per weight of each file are listed in the table.

1

u/level10orc 19h ago

Yeah I just wonder about the name since there's literally a battery company I saw out there named xeiron. Maybe just Polar. Or polar quants. It's really no biggie. Just thinking out loud 😂

4

u/Aishor 19h ago

No worries, and thanks for clarifying. A bit of history: I originally called it APEIRON, from the Greek ἄπειρον (apeiron), "the boundless" or "the infinite", the term the philosopher Anaximander used for the origin of all things. But that name is already used a lot in AI, so I went with XEIRON instead. I didn't know about the battery company. I like "polar quantization" as the description, and I'll put it next to the name so it's clear what it does.

2

u/hugo-the-second 19h ago

"polar quants" sounds good to me

5

u/metal079 19h ago

This is very cool! Did you do any comparisons with int8convrot? I believe thats the most popular quantization right now.

1

u/Aishor 2h ago

Yes, I've measured it now. int8convrot is faster; XEIRON at 4 bits gives a much smaller file and uses less VRAM. All the numbers, the method and the limitations are in the main post, under the "Update" section. Thanks for asking!

4

u/Zalakat 20h ago

Interesting, checking out the paper now.

2

u/Aishor 20h ago

Thanks! If anything is unclear or looks wrong, I'd be glad to hear it.

10

u/leomozoloa 21h ago

Absolute AI slop description, the actual interesting data point is completely buried, it's the fact that on a 5090 it seems to generate at 2x the speed compared to GGUFs at comparable quality SOMETIMES, should have started by that and only put example and left the AI fluff tech talk to the github

9

u/Aishor 21h ago

Thanks for the feedback, noted, and I'm fixing it. I didn't want to sound exaggerated or cocky, so I ended up burying the main result under the technical explanation. I'll lead with the numbers and examples, and leave the details for the GitHub and the paper.

3

u/pandaabear0 17h ago

It's a fine line to walk, for sure. Sometimes people who do what he suggested gets ridiculed on here as well. I think the fact you are thinking about avoiding sounding cocky, etc, is your first win. You will eventually end up with the right approach if you take people's feedback to heart ^^

2

u/metal079 18h ago

u/Aishor I dont see a way to create the models in the repo, I wanted to try it out, https://github.com/Aishor/xeiron is that coming soon or am i missing something?

2

u/Aishor 18h ago

You're not missing anything. The repository currently contains only the inference side; the tool that builds .xeiron files isn't included yet.

That's on purpose at this early stage: the goal right now is to test inference on many different computers. Releasing the converter now would fill the place with many versions of models that aren't built properly, which would pollute the ecosystem and make it hard to tell real problems apart.

You can try it with the ready-made Z-Image-Turbo and Krea-2-Turbo files on Hugging Face (https://huggingface.co/Xeiron); the README explains how to download and run them. If you do, I'd love to know your GPU and how it goes.

1

u/J6j6 2h ago

Can comfy apply dynamic vram with this?cos in gguf it can't

1

u/Aishor 2h ago

Not at the moment. My plugin loads the model through its own loader and runs its own sampling loop instead of using ComfyUI's standard model patcher, and dynamic VRAM only works with that. The plugin has its own VRAM manager, which unloads whole models when it runs out of space; it can't offload layer by layer. It also doesn't work with LoRAs yet.

It could be done, but it's not a small change, and I haven't tried it. It's not a priority right now, since the 4-bit files fit entirely in 16 GB without offload (about 6 GiB of VRAM on Z-Image-Turbo and 10 GiB on Krea-2-Turbo). Dynamic VRAM would matter more for models bigger than the card. If there's demand, I'll look into it.