[PR #3] [MERGED] Add int8 ConvRot and full-block quantization to the SeedVR2 converter #1

Closed
opened 2026-10-26 22:28:45 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-model-tools/pull/3
Author: @pollockjj
Created: 7/2/2026
Status: ✅ Merged
Merged: 7/2/2026
Merged by: @pollockjj

Base: main ← Head: seedvr2-full-block-quantization


📝 Commits (1)

  • c488de5 Add int8 ConvRot and full-block quantization to the SeedVR2 converter

📊 Changes

2 files changed (+115 additions, -57 deletions)

View changed files

📝 README.md (+2 -2)
📝 seedvr2_convert.py (+113 -55)

📄 Description

Summary

Adds an int8 ConvRot precision to the SeedVR2 converter, removes the last-DiT-block fp16 exemption from the nvfp4 and mxfp8 paths, and removes the fp8_e4m3fn_mixed_block35_fp16 mode entirely, so every quantized format quantizes all eligible blocks.

The exemption and the mixed fp8 mode dated from early fp8 line and tile artifacts on 7B. Re-measured on the current ComfyUI SeedVR2 runtime (RTX 5090, three-video pooled PSNR over 291 frames against canonical references), full-block conversions land within 0.03 dB of the mixed variants for every format and above them for mxfp8 and fp8, with no per-frame artifact signature, while the fp16 tail block costs real sampler time: 43.6 s to 39.4 s for mxfp8 and 37.2 s to 36.5 s for nvfp4 on a 109-frame single-step latent.

Changes

Single file, seedvr2_convert.py.

  • Added the int8 precision: eligible 2D weights go to TensorWiseINT8Layout with per-channel weight scales and group-wise Hadamard activation rotation (ConvRot, groupsize 256) via comfy_kitchen; high-risk input/output projections and shape-ineligible weights stay fp16.
  • Removed the last-block fp16 exemption from the nvfp4 and mxfp8 policies, the block-detection helper that served it, and the fp8_e4m3fn_mixed_block35_fp16 mode. The mixed-variant model files have been withdrawn from distribution; the modes that produced them are gone with them.
  • Updated the docstring provenance block to the published full-model output set with per-file sha256.

The fp16 and fp8_e4m3fn job paths are untouched and produce identical bytes; nvfp4 and mxfp8 produce different bytes than the current script; int8 is new.

Example

python seedvr2_convert.py --src seedvr2_ema_3b.pth --cond pos_emb.pt,neg_emb.pt \
    --job int8:seedvr2_3b_int8.safetensors:c3dec8bcc5916843a8a858572970597462e1f2dc598d6dfd818f6cd40f53a157

Expected output:

int8 quantized_weights=210 kept_fp16=425 kept_policy=6 kept_shape=0 convrot_groupsize=256
int8                           c3dec8bcc5916843a8a858572970597462e1f2dc598d6dfd818f6cd40f53a157  seedvr2_3b_int8.safetensors  OK

The sha suffix on the job makes the run self-verifying against the published artifact.

Prior art


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-model-tools/pull/3 **Author:** [@pollockjj](https://github.com/pollockjj) **Created:** 7/2/2026 **Status:** ✅ Merged **Merged:** 7/2/2026 **Merged by:** [@pollockjj](https://github.com/pollockjj) **Base:** `main` ← **Head:** `seedvr2-full-block-quantization` --- ### 📝 Commits (1) - [`c488de5`](https://github.com/Comfy-Org/comfy-model-tools/commit/c488de50bb53108035d2b0350d23cb154aea629b) Add int8 ConvRot and full-block quantization to the SeedVR2 converter ### 📊 Changes **2 files changed** (+115 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -2) 📝 `seedvr2_convert.py` (+113 -55) </details> ### 📄 Description ## Summary Adds an int8 ConvRot precision to the SeedVR2 converter, removes the last-DiT-block fp16 exemption from the nvfp4 and mxfp8 paths, and removes the fp8_e4m3fn_mixed_block35_fp16 mode entirely, so every quantized format quantizes all eligible blocks. The exemption and the mixed fp8 mode dated from early fp8 line and tile artifacts on 7B. Re-measured on the current ComfyUI SeedVR2 runtime (RTX 5090, three-video pooled PSNR over 291 frames against canonical references), full-block conversions land within 0.03 dB of the mixed variants for every format and above them for mxfp8 and fp8, with no per-frame artifact signature, while the fp16 tail block costs real sampler time: 43.6 s to 39.4 s for mxfp8 and 37.2 s to 36.5 s for nvfp4 on a 109-frame single-step latent. ## Changes Single file, seedvr2_convert.py. - Added the int8 precision: eligible 2D weights go to TensorWiseINT8Layout with per-channel weight scales and group-wise Hadamard activation rotation (ConvRot, groupsize 256) via comfy_kitchen; high-risk input/output projections and shape-ineligible weights stay fp16. - Removed the last-block fp16 exemption from the nvfp4 and mxfp8 policies, the block-detection helper that served it, and the fp8_e4m3fn_mixed_block35_fp16 mode. The mixed-variant model files have been withdrawn from distribution; the modes that produced them are gone with them. - Updated the docstring provenance block to the published full-model output set with per-file sha256. The fp16 and fp8_e4m3fn job paths are untouched and produce identical bytes; nvfp4 and mxfp8 produce different bytes than the current script; int8 is new. ## Example ``` python seedvr2_convert.py --src seedvr2_ema_3b.pth --cond pos_emb.pt,neg_emb.pt \ --job int8:seedvr2_3b_int8.safetensors:c3dec8bcc5916843a8a858572970597462e1f2dc598d6dfd818f6cd40f53a157 ``` Expected output: ``` int8 quantized_weights=210 kept_fp16=425 kept_policy=6 kept_shape=0 convrot_groupsize=256 int8 c3dec8bcc5916843a8a858572970597462e1f2dc598d6dfd818f6cd40f53a157 seedvr2_3b_int8.safetensors OK ``` The sha suffix on the job makes the run self-verifying against the published artifact. ## Prior art - Source checkpoints: [ByteDance-Seed/SeedVR2-3B](https://huggingface.co/ByteDance-Seed/SeedVR2-3B) and [ByteDance-Seed/SeedVR2-7B](https://huggingface.co/ByteDance-Seed/SeedVR2-7B) (Apache-2.0), revisions pinned in the script docstring. - Converted weights produced by this script, one file per size and precision: https://huggingface.co/pollockjj/SeedVR2 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:28:45 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-model-tools#1
No description provided.