u/Zestyclose_Bake3680

Updated ComfyUI-SeedVR2-VideoUpscaler-with-TensorRT v1.6.6 - Native ConvRot W4A8 Support & DisTorch2 Scope

Updated ComfyUI-SeedVR2-VideoUpscaler-with-TensorRT v1.6.6 - Native ConvRot W4A8 Support & DisTorch2 Scope

The other day, when I published information about v1.5.7, I received a request in the comments regarding support for w4a8.

https://www.reddit.com/r/StableDiffusion/comments/1wuj0rj/updated_updated/

At first, I thought it would be straightforward to implement, but when I actually tried it, I found it quite a struggle.

However, I’ve managed to get it working stable, so I’m releasing it as v1.6.6.

https://github.com/ussoewwin/ComfyUI-SeedVR2-VideoUpscaler-with-TensorRT/releases/tag/v1.6.6

https://huggingface.co/ussoewwin/SeedVR2-ConvRot-INT8-and-w4a8

Firstly, as for the advantages of w4a8, benchmark results clearly show that the quality is superior to that of NVFP4. Yet, the size is equivalent to 4 bits.

https://github.com/ussoewwin/ComfyUI-SeedVR2-VideoUpscaler-with-TensorRT/blob/main/benchmark/benchmark%20result.md

On the other hand, what wasn’t as good as I’d hoped was that VRAM consumption was almost on a par with ConvRot INT8 (though, given that w4a8 expands weights to 8 bits, this was to be expected), and that with Distorch2—which I’d gone to such lengths to implement—VRAM usage actually skyrocketed, rendering it unusable.

It’s simply a matter of not using Distorch2, so it isn’t a fatal flaw, mind you.

...
The on/off function for Norm BF16, which was previously implemented in Distorch2 to counteract VRAM spikes, has now also been implemented in the Legacy Loader. Enabling this feature allows you to suppress VRAM spikes by up to approximately 3GB, albeit at the cost of a slight reduction in image quality.

u/Zestyclose_Bake3680 — 4 days ago

SAM3&3.1 ConvRot INT8 detect node

I’ve discovered some important information!!

It works with the standard loader!!

When I tested it earlier, it threw an error, so I’d assumed it wasn’t compatible with the standard loader. However, after testing it again based on a comment I received, it actually worked perfectly fine with the standard loader.

I’m not sure what caused the error, but it’s highly likely I’d fundamentally overlooked something. Although it turned out that the custom node itself was not necessary, I will keep this post up. Thank you for letting me know in the comments!!

...

I have just made a correction on the GitHub side and deleted the node I had created. However, as it provides useful technical experience, I have retained the history for v3.4.7.

HSWQ v3.4.8 — SAM3 Nodes Removed (Stock Loader Support Confirmed)

Although I have deleted the node registration, I have restored the commit containing the code and commentary relating to SAM3 ConvRot INT8 support, for reference purposes.

HSWQ SAM3 ConvRot INT8 Nodes — Complete Technical Guide

I have published the SAM3/3.1 ‘convRot’ INT8 quantisation node below. However, as the HSWQ repository is not currently published on ComfyUI-Manager, manual installation is required. Furthermore, as this is a work-in-progress repository, I recommend deleting it once quantisation is complete, unless you have a specific need to keep it. I will apply for ComfyUI registration once the project reaches a certain level of completion, but at present it is still very much a work in progress.

How to quantize Text Encoder, ControlNet, Model Patch and SAM 3 / SAM 3.1 (native ConvRot INT8)

Furthermore, as mentioned in the comments section below, it appears that the standard ComfyUI SAM3 detect node does not currently support SAM3. I had submitted a pull request to fix this, but it is unclear whether it will be accepted.

...

The following is information about a custom node that has already been deleted, but I shall keep it on file.

...

I’ve spent days developing code to support ConvRot INT8 up to this point, but it’s been a real struggle.

To put it simply, unlike image generation models, ControlNet and CLIP, the way ConvRot rotations work was a real pain.

It’s less about VRAM and more about saving storage space, I suppose.

I’ve converted everything from CLIP and ControlNet to ConvRot INT8, which freed up about 40 GB on its own.

My SSD is running out of space.

Everything just keeps getting bigger and bigger.

With HSWQ, saving VRAM is one thing,

but more than that, I really need to free up some storage space.

...

ComfyUI loader and detector nodes for ConvRot / TensorWise INT8-quantized SAM3 &3.1(Segment Anything 3&3.1) checkpoints. Loads the SAM3 model directly into VRAM in 8-bit precision (QuantizedTensor / TensorWiseINT8Layout) and executes via comfy_kitchen's high-speed int8_linear kernel with online activation rotation (convrot).

Includes automatic hardware safety fallback for unaligned layers (such as boxRPB_embed_x with K=2), dynamically dequantizing non-multiple-of-4 dimensions while running all heavy backbone and transformer blocks in accelerated INT8 Tensor Core precision.

Features

  • Native INT8 VRAM Retention: Keeps weights in 8-bit precision in VRAM with TensorWiseINT8Layout, cutting memory requirements significantly
  • Fast Execution: Uses comfy_kitchen int8_linear GEMM kernel with online activation rotation for ConvRot layers
  • Automatic Fallback Protection: Layers with unaligned dimensions (K) safely compute in float precision without crashing cuBLAS INT8 GEMM
  • Seamless Compatibility: Produces standard MODEL output compatible with HSWQ SAM3 Detect and stock ComfyUI SAM3 detection/tracking nodes

Nodes

HSWQ SAM3 Detect — category HSWQ/Detection

  • Inputs
    • model (MODEL): SAM3 model (from HSWQ SAM3 Loader or CheckpointLoaderSimple)
    • image (IMAGE): input image (batches supported)
    • conditioning (CONDITIONING, optional): text prompts, e.g. CLIPTextEncode "person"
    • bboxes (BBOXES, optional): boxes to segment within
    • positive_coords / negative_coords (STRING, optional): point prompts as JSON [{"x": int, "y": int}, ...] (pixel coords)
    • threshold (default 0.50): detection score threshold
    • refine_iterations (default 2): SAM decoder refinement passes (0 = raw detector masks)
    • individual_masks (default false): output per-object masks instead of union
  • Outputs
    • masks (MASK): binary segmentation masks
    • bboxes (BBOXES): detected boxes with scores
    • image (IMAGE): pass-through input image

Example workflow

  1. CheckpointLoaderSimple (same checkpoint) → CLIPTextEncode ("person") for text-conditioned detection
  2. HSWQ SAM3 Detect → connect model, image, and conditioning
  3. MaskPreview+ → visualize the masks output

FP16 compatibility

Both nodes fully support standard FP16 SAM3 checkpoints (e.g. sam3.1_multiplex_fp16.safetensors):

  • HSWQ SAM3 Detect runs identically on FP16 and INT8 models — the runtime weight guard dequantizes INT8 layers to FP16 internally, so both paths produce equivalent masks
  • FP16 checkpoints also work through the stock CheckpointLoaderSimple thanks to the HSWQ CLIP remap patch (no "clip missing" warning)
u/Zestyclose_Bake3680 — 2 months ago
▲ 15 r/comfyui

Updated ComfyUI-Nunchaku QwenImage&ZImageTurboLoraStack v2.5.5 - Krea2 OpenPose LoRA ControlNet support

The ControlNet models for KREA2 are available as LoRA types, with Depth and OpenPose existing as separate formats.

We have made it possible to use both of these with the existing node format. However, the term ‘existing node’ here refers to the Diffsynth ControlNet Loader for Qwen Image and Z Image.

https://github.com/ussoewwin/ComfyUI-QwenImageLoraLoader

In other words, this node can be used with the following standards:

・Nunchaku Qwen image/Z Image Diffsynth ControlNet

・Normal Qwen Image/Z Image Diffsynth ControlNet

・Krea2 Depth/Openpose ControlNet LoRA

For the benefit of AMD GPU users, we have made improvements to ensure that the CUDA-specific Nunchaku node is disabled when using an AMD GPU.

u/Zestyclose_Bake3680 — 2 months ago
▲ 15 r/comfyui

Major updated A1111 for Python3.14

Once again, I am reaffirming the great achievements left behind by the legacy technology known as Automatic1111.

At present, there is no practical benefit to be gained from inheriting and evolving this UI, but it is, at the very least, extremely useful as a learning resource for myself.

https://github.com/ussoewwin/A1111-for-Python3.14

We have also integrated the main extensions after checking the licences for each one.

In addition, there are some extra features that I developed myself.

...

SDXL Pony/Illustrious Compatibility Fix (v2.0+)

The first A1111 fork to fully support Pony and Illustrious SDXL models — including LoRA.

For years, SDXL derivative models (Pony Diffusion, WAI Illustrious, etc.) were unreliable on A1111. Enthusiasts had to switch to ComfyUI or Forge to use these models properly.

What works now:

  • ✅ Pony series — base generation + LoRA
  • ✅ Illustrious series — base generation + LoRA
  • ✅ Any SDXL model that previously crashed with RuntimeError: attn_mask shape or produced noise

Built-in Extensions

The following popular extensions are built-in and ready to use out of the box:

  • ControlNet (v1.1.455) — integrated at startup with automatic path migration
  • ADetailer (v1.01.0) — face and person detailer with 7 models
  • FreeU — effortless detail enhancement
  • WD14 Tagger — automatic prompt generation from images
  • ReActor (v0.7.1-b3) — face swap
  • Dynamic Thresholding (CFG Scale fix)
  • Aspect Ratio presets (built-in, no extension needed)
  • MultiDiffusion + Tiled VAE — high-resolution upscaling

RES4LYF Samplers

Native support for RES4LYF samplers in the A1111 Sampling method dropdown (100+ advanced RES / Bongmath / hybrid RK methods), plus related schedule types such as beta57 and bong_tangent. Generation runs through an A1111-side shim; the vendored RES4LYF sources under modules/RES4LYF/ are left unmodified.

Python 3.14 Native

Fully ported to Python 3.14. No pkg_resources hacks, no legacy compatibility layers. All dependency conflicts (NumPy, SciPy, clip.py) are handled automatically at startup.

Flash-Attention 2 with Graceful Fallback

Direct Flash-Attention 2 support with staged fallback:

1. FA-2 (Flash-Attention 2.8.4, torch 2.13.0+cu132) — maximum speed
2. SDP (PyTorch scaled_dot_product_attention) — no extra deps
3. sub_quad (built-in) — universal fallback

Windows: prebuilt HF wheel (2.8.4+cu132torch2.13.0 cp314). Linux: builds flash-attn==2.8.4 from source against the same torch==2.13.0+cu132 stack (CUDA toolkit 13.2 + nvcc). macOS skips FA2 (MPS limitation).

SDXL ConvRot INT8 / NVFP4 Checkpoints (v3.0.1+)

Load SDXL checkpoints quantized with Hybrid-Sensitivity-Weighted-Quantization directly in A1111. Weights are offline-dequantized and Hadamard-unrotated at load time, fully isolated from all other model formats.

  • ConvRot INT8 (int8_tensorwise + convrot:true) — plain / ConvRot Linear / ConvRot Conv2d scale layouts
  • ConvRot NVFP4 (E2M1 packed) — mixed-pack checkpoints (Linear = NVFP4, Conv2d = INT8)
  • Strict no-op for checkpoints without .comfy_quant keys — SD1.5 / SD2 / SDXL / fp16 / fp8 are completely unaffected
  • Supported checkpoints: only models quantized with Hybrid-Sensitivity-Weighted-Quantization

Technical details: v3.0.1 Release Notes

...

The HSWQ project is currently developing HSWQ Krea2 mixed NVFP4, which utilises 4-bit quantisation to minimise image degradation.

This quantisation technique utilises, in part, the principles established in Nunchaku, and introduces SVD and cosine formulas in order to ‘discard’ non-essential layers to 4 bits.

A loader for use with ComfyUI is also being developed in parallel.

u/Zestyclose_Bake3680 — 2 months ago

HSWQ SDXL ConvRot NVFP4 Benchmark Test Results

Some might argue that there is little point in testing ConvRot NVFP4 quantisation on the legacy SDXL at this stage… but, based on my own experience at least, I don’t think it was a waste of time.

How to quantize SDXL NVFP4

https://preview.redd.it/0npox70moihh1.png?width=2400&format=png&auto=webp&s=ac53c7b69147dec3d20cd9f6bacf0d83e5d80023

It is also likely to be beneficial in terms of saving storage space.

However, in terms of the degradation compared to full-size fp16, it is clearly at a disadvantage compared to ConvRot INT8.

Furthermore, as ComfyUI does not support ConvRot NVFP4 by default, custom loaders was also required.

I'm currently researching ConvRot NVFP4 for Z Image and Krea2, utilising HSWQ to minimise degradation as much as possible, and our experience with SDXL has proved somewhat useful in this regard.

However, we will likely publish the quantisation techniques for Krea2 HSWQ ConvRot INT8 before those for ConvRot NVFP4.

Although we have only been able to verify their effectiveness on 3 models so far, we have observed a significant improvement in scores for Krea2, which is inherently less resistant to quantisation.

https://preview.redd.it/0406db33gkhh1.png?width=713&format=png&auto=webp&s=c334ad6f2f30ef106d99fadbd76c19bb0dbe132d

...

It may sound rather blunt, but in the case of the NVFP4 block, there were actually instances where disabling ConvRot resulted in a better score.

The list of tests below also includes cases using plain NVFP4 with ConvRot disabled.

...

Benchmark comparison: FP16 reference vs HSWQ ConvRot NVFP4 quantized output.
Lower MSE is better; higher SSIM is better (1.0 = perfect match).

Source: benchmark result/score_convrotnvfp4.txt

Bias correction (column labels from the score log):

Label Meaning
1on Bias correction ON
1off Bias correction OFF

Results

Model Bias correction MSE (↓ better) SSIM (↑ better) NVFP4 TC (hits/fallbacks)
waiIllustriousSDXL_v170 1off 16.9641 0.9596 2425 / 0
waiANIPONYXL_v90 1off 13.4106 0.9259 0 / 0
uwazumimixILL_v50 1on 9.9430 0.9530 0 / 0
unholyDesireMixSinister_v80 1off 9.5110 0.9725 0 / 0
realvisxlV50_v50Bakedvae 1off 16.5263 0.9585 0 / 0
realvisxlV50_v40Bakedvae 1off 18.3663 0.9549 0 / 0
realvisxlV30_v30TurboBakedvae 1on 30.1016 0.9315 0 / 0
prefectIllustriousXL_v8 1off 58.1917 0.9310 2450 / 0
oneObsession_v23 1on 24.7509 0.9490 0 / 0
novaAsianXL_illustriousV70 1on 20.0107 0.9344 0 / 0
novaAnimeXL_ilV190 1on 12.8300 0.9238 2425 / 0
koronemixVpred_v20 1on 29.8958 0.9548 2525 / 0
koronemixIllustrious_v70 1off 14.0383 0.9648 2425 / 0
JANKUTrainedChenkinNoobai_v777 1on 25.7451 0.9398 2525 / 0
epicrealismXL_pureFix 1off 11.5932 0.9677 2550 / 0
ebaraPonyXL_v21 1off 13.2105 0.9382 2600 / 0
animemix_v80 1off 6.8081 0.9829 2450 / 0

HSWQ ConvRot NVFP4 vs Native NVFP4 comparison

Same setup (vs FP16 reference). HSWQ ConvRot NVFP4 vs baseline Native NVFP4.
Lower MSE is better; higher SSIM is better. Δ = baseline − HSWQ (positive Δ MSE ⇒ HSWQ better; negative Δ SSIM ⇒ HSWQ better, since higher SSIM is better).
Native NVFP4 = naive cast NVFP4.

Model Bias correction HSWQ MSE Baseline MSE Δ MSE HSWQ SSIM Baseline SSIM Δ SSIM HSWQ TC Baseline TC Baseline Winner
waiIllustriousSDXL_v170 1off 16.9641 36.7770 +19.8129 0.9596 0.9346 −0.0250 2425 / 0 18575 / 0 Native NVFP4 HSWQ
waiANIPONYXL_v90 1off 13.4106 23.7457 +10.3351 0.9259 0.8935 −0.0324 0 / 0 0 / 0 Native NVFP4 HSWQ
uwazumimixILL_v50 1on 9.9430 38.0450 +28.1020 0.9530 0.8909 −0.0621 0 / 0 0 / 0 Native NVFP4 HSWQ
unholyDesireMixSinister_v80 1off 9.5110 26.6469 +17.1359 0.9725 0.9520 −0.0205 0 / 0 0 / 0 Native NVFP4 HSWQ
realvisxlV50_v50Bakedvae 1off 16.5263 24.4336 +7.9073 0.9585 0.9297 −0.0288 0 / 0 0 / 0 Native NVFP4 HSWQ
realvisxlV50_v40Bakedvae 1off 18.3663 32.2806 +13.9143 0.9549 0.9184 −0.0365 0 / 0 0 / 0 Native NVFP4 HSWQ
realvisxlV30_v30TurboBakedvae 1on 30.1016 62.4464 +32.3448 0.9315 0.9019 −0.0296 0 / 0 0 / 0 Native NVFP4 HSWQ
prefectIllustriousXL_v8 1off 58.1917 99.4071 +41.2154 0.9310 0.9212 −0.0098 2450 / 0 18575 / 0 Native NVFP4 HSWQ
oneObsession_v23 1on 24.7509 81.3796 +56.6287 0.9490 0.9155 −0.0335 0 / 0 18575 / 0 Native NVFP4 HSWQ
novaAsianXL_illustriousV70 1on 20.0107 33.4618 +13.4511 0.9344 0.8866 −0.0478 0 / 0 0 / 0 Native NVFP4 HSWQ
novaAnimeXL_ilV190 1on 12.8300 55.7887 +42.9587 0.9238 0.9119 −0.0119 2425 / 0 18575 / 0 Native NVFP4 HSWQ
koronemixVpred_v20 1on 29.8958 54.1957 +24.2999 0.9548 0.9148 −0.0400 2525 / 0 18575 / 0 Native NVFP4 HSWQ
koronemixIllustrious_v70 1off 14.0383 104.7592 +90.7209 0.9648 0.8854 −0.0794 2425 / 0 18575 / 0 Native NVFP4 HSWQ
JANKUTrainedChenkinNoobai_v777 1on 25.7451 102.9044 +77.1593 0.9398 0.9158 −0.0240 2525 / 0 18575 / 0 Native NVFP4 HSWQ
epicrealismXL_pureFix 1off 11.5932 36.9909 +25.3977 0.9677 0.9590 −0.0087 2550 / 0 18575 / 0 Native NVFP4 HSWQ
ebaraPonyXL_v21 1off 13.2105 88.0444 +74.8339 0.9382 0.8611 −0.0771 2600 / 0 18575 / 0 Native NVFP4 HSWQ
animemix_v80 1off 6.8081 23.3225 +16.5144 0.9829 0.9479 −0.0350 2450 / 0 18575 / 0 Native NVFP4 HSWQ

Winner = better on both MSE and SSIM.

Notes

  • Bias correction: Each HSWQ run in score_convrotnvfp4.txt is tagged 1on or 1off.
    • 1on = bias correction enabled for that convert / bench.
    • 1off = bias correction disabled for that convert / bench.
  • MSE: Mean Squared Error; 0 = perfect match.
  • SSIM: Structural Similarity; 1.0 = perfect match.
  • NVFP4 TC: NVFP4 Tensor Core matmul hits / fallbacks.
reddit.com
u/Zestyclose_Bake3680 — 2 months ago
▲ 20 r/comfyui

Uploaded forked ComfyUI-SeedVR2_VideoUpscale to fix ConvRot INT8/NVFP4 enabled VRAM reduction

I uploaded forked ComfyUI-SeedVR2_VideoUpscale to fix ConvRot INT8/NVFP4 enabled VRAM reduction, however I had only tested on my environment.

Windows11 Python 3.13.13 Pytorch 2.13.0+cu132 RTX5060Ti 16GB Newest ComfyUI.

I am also planning to submit a pull request to the official repository to share these improvements upstream.

For NVFP4, please apply Torch Compile to the VAE only.

The attached image shows benchmark results I have compiled ourselves; whilst the actual performance may not be exactly as shown, VRAM usage will certainly be reduced.

u/Zestyclose_Bake3680 — 3 months ago