ComfyUI Node
Calibration Data Collector
Collect per-layer Hessians (and optionally activation amax) for external quantization. No weights are modified.
Calibration Data Collector
- model
- conditioning
- calibration_path
◄num_steps4►
◄num_samples16►
◄seed0►
◄hessian_block_size128►
◄hessian_formatdlr_nystrom►
◄dlr_rank128►
◄collect_amaxtrue►
◄output_path/tmp/ComfyUI/output/calibration.pt►
◄latent_height64►
◄latent_width64►
◄convrotfalse►
◄rot_size256►
◄rpbhfalse►
◄rpbh_seed42►
◄rpbh_block_size256►
◄permuquantfalse►
◄pisofalse►
◄sigma_min0.00►
◄sigma_max1.00►
◄force_cpu_hookfalse►
◄timestep_channel_amaxfalse►
◄timestep_buckets4►
Categorymodel/quantization
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Loaded diffusion model (FP16/BF16/FP32). | |
| conditioning | CONDITIONING | Pre-encoded conditioning from CLIPTextEncode or similar. | |
| num_steps | INT | 41–50 | Denoising steps per sample. |
| num_samples | INT | 161–4096 | Independent samples to accumulate over. 16-128 recommended. |
| seed | INT | 00–4294967295 | Seed for noise and timestep sampling. |
| hessian_block_size | INT | 1280–1024 | 0 = full H (paper-accurate, auto memory-mapped to disk). 128 = diagonal blocks (default, saves RAM). Ignored when hessian_format='dlr'. |
| hessian_format | COMBO | dlr_nystrom | Hessian storage format. 'block' = diagonal blocks (use hessian_block_size). 'full' = full Hessian (memory-mapped). 'dlr' = Diagonal + Low-Rank via FrequentDirections (streaming, exact diagonal, repeated SVD). 'dlr_nystrom' = DLR via randomized Nyström (streaming, exact diagonal, ~100× faster construction — recommended default). |
| dlr_rank | INT | 1281–4096 | Rank for DLR Hessian (only used when hessian_format is 'dlr' or 'dlr_nystrom'). Same memory budget as block_size=rank. Recommended: 64-256. |
| collect_amax | BOOLEAN | true | Also collect max(abs(x)) per layer. Required for activation quantization; not used by weight-only GPTQ. |
| output_path | STRING | /tmp/ComfyUI/output/calibration.pt | Where to save the calibration .pt file. |
| latent_heightopt | INT | 648–1024 | Latent spatial height. 128 for 1024px, 64 for 512px. |
| latent_widthopt | INT | 648–1024 | Latent spatial width. 128 for 1024px, 64 for 512px. |
| convrotopt | BOOLEAN | false | Enable ConvRot Hadamard rotation. Collects Hessians in rotated space for better block-diagonal approximation. |
| rot_sizeopt | INT | 25616–4096 | Hadamard group size (must be power of 2). 256 recommended for ConvRot. |
| rpbhopt | BOOLEAN | false | Enable RPBH (Randomized Permuted Block-Hadamard) rotation. Mutually exclusive with ConvRot. Spreads outliers via random permutation + block Hadamard + sign flip. Uses per-layer auto-detected block size (largest power-of-2 dividing in_features). Best paired with DLR Hessian format — block format is lossy because RPBH's permutation destroys block-diagonal structure. Not recommended with PermuQuant. |
| rpbh_seedopt | INT | 420–2147483647 | Random seed for RPBH permutation and signs. The converter must use the same seed to regenerate matching rotation parameters for weight folding. |
| rpbh_block_sizeopt | INT | 2560–65536 | RPBH Hadamard block size. 0 = auto-detect (largest power-of-2 dividing in_features, default). Set to 256 for uniform block size across all layers — smaller blocks give finer-grained outlier spreading. Must be a power of 2 if non-zero. The converter must use the same block size. |
| permuquantopt | BOOLEAN | false | Enable PermuQuant channel reordering. Runs a second calibration pass with channels sorted by second moment for better quantization. |
| pisoopt | BOOLEAN | false | Collect Hessian diagonal for PiSO data-aware scale optimization. Adds a small overhead to store diag(X^T X) per layer, which the converter uses to compute optimal per-row scales instead of absmax. |
| sigma_minopt | FLOAT | 0.000–1 | Lower bound of the sigma range to sample. Set to 0.875 with Wan 2.2 high-noise expert, or 0.0 for full range (default). |
| sigma_maxopt | FLOAT | 1.000–1 | Upper bound of the sigma range to sample. Set to 0.875 with Wan 2.2 low-noise expert, or 1.0 for full range (default). |
| force_cpu_hookopt | BOOLEAN | false | Force hook-side processing to CPU. Enable only if you hit GPU OOM during calibration — the GPU-fast path uses ~20-50 MB of transient VRAM per layer. |
| timestep_channel_amaxopt | BOOLEAN | false | Collect per-timestep-bucket per-channel amax in addition to overall per-channel amax. Enables the converter to analyse time-varying channel imbalance for static-dynamic decomposition (ViDiT-Q Section 4.2). Automatically enables per-channel amax collection. Adds 'channel_amax_by_timestep' to the output. |
| timestep_bucketsopt | INT | 41–64 | Number of timestep buckets for per-timestep channel amax. 4 = divide denoising into 4 equal ranges (ViDiT-Q paper default). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| calibration_path | STRING | — |