Nodes/ComfyUI-GPTQ-Calibration/Dual Model Calibration Data Collector
ComfyUI Node

Dual Model Calibration Data Collector

Calibrate two models used together via dual-model CFG. Outputs two .pt files (one per model) for external quantization.

By ThunderFun·Created 2 months ago·Updated about a month ago· 0
Dual Model Calibration Data Collector
  • model
  • model_negative
  • positive
  • negative
  • calibration_path_positive
  • calibration_path_negative
cfg4.0
num_steps4
num_samples16
seed0
hessian_block_size128
hessian_formatdlr_nystrom
dlr_rank128
collect_amaxtrue
output_path_positive/tmp/ComfyUI/output/calibration_positive.pt
output_path_negative/tmp/ComfyUI/output/calibration_negative.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 (28)

NameTypeDefaultDescription
modelMODELPositive (conditional) model.
model_negativeMODELNegative (unconditional) model. For Ideogram 4 this is the image-only expert.
positiveCONDITIONINGPositive conditioning — runs through `model`.
negativeCONDITIONINGNegative conditioning for the uncond model. Leave disconnected for image-only pass (default for Ideogram 4).
cfgFLOAT4.01.01–100CFG value to apply between the two models. Must be > 1.0 to calibrate both models.
num_stepsINT41–50
num_samplesINT161–4096
seedINT00–4294967295
hessian_block_sizeINT1280–10240 = full Hessian, 128 = diagonal blocks. Ignored when hessian_format='dlr'.
hessian_formatCOMBOdlr_nystromHessian storage format. 'dlr_nystrom' = DLR via randomized Nyström (streaming, exact diagonal, ~100× faster — recommended). 'dlr' = DLR via FrequentDirections. 'block' = diagonal blocks. 'full' = full Hessian.
dlr_rankINT1281–4096Rank for DLR Hessian (only used when hessian_format is 'dlr' or 'dlr_nystrom').
collect_amaxBOOLEANtrue
output_path_positiveSTRING/tmp/ComfyUI/output/calibration_positive.ptWhere to save the positive model's calibration .pt file.
output_path_negativeSTRING/tmp/ComfyUI/output/calibration_negative.ptWhere to save the negative model's calibration .pt file.
latent_heightoptINT648–1024
latent_widthoptINT648–1024
convrotoptBOOLEANfalse
rot_sizeoptINT25616–4096
rpbhoptBOOLEANfalseEnable RPBH rotation. Mutually exclusive with ConvRot. Best with DLR Hessian format.
rpbh_seedoptINT420–2147483647Random seed for RPBH. The converter must use the same seed.
rpbh_block_sizeoptINT2560–65536RPBH Hadamard block size. 0 = auto-detect (default). Set to 256 for uniform block size. Must be a power of 2 if non-zero.
permuquantoptBOOLEANfalse
pisooptBOOLEANfalse
sigma_minoptFLOAT0.000–1Lower 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_maxoptFLOAT1.000–1Upper 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_hookoptBOOLEANfalseForce hook-side processing to CPU. Enable if you hit GPU OOM with dual-model calibration.
timestep_channel_amaxoptBOOLEANfalseCollect per-timestep-bucket per-channel amax for both models. Enables time-varying channel imbalance analysis (ViDiT-Q Section 4.2).
timestep_bucketsoptINT41–64Number of timestep buckets for per-timestep channel amax. 4 = paper default.

Outputs (2)

NameTypeDescription
calibration_path_positiveSTRING
calibration_path_negativeSTRING