Skip to content

Commit e35a987

Browse files
committed
Revert "fix: adjust memory_usage_factor for quantized models"
This reverts commit a07f0fb.
1 parent a07f0fb commit e35a987

2 files changed

Lines changed: 1 addition & 29 deletions

File tree

nodes/loader_nodes.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,6 @@ def load_checkpoint(
124124
clip = out[1]
125125
vae = out[2]
126126

127-
# Adjust memory_usage_factor for quantized models
128-
# Quantized weights use ~1 byte (INT8/FP8) vs 2 bytes (bf16/fp16)
129-
# This prevents ComfyUI from over-estimating memory requirements
130-
if model is not None and quant_format != "auto":
131-
try:
132-
original_factor = model.model.memory_usage_factor
133-
# INT8/FP8 weights are ~2x smaller than fp16/bf16
134-
model.model.memory_usage_factor = original_factor / 2.0
135-
logging.info(
136-
f"QuantizedModelLoader: Adjusted memory_usage_factor from "
137-
f"{original_factor:.2f} to {model.model.memory_usage_factor:.2f}"
138-
)
139-
except AttributeError:
140-
logging.debug("Could not adjust memory_usage_factor")
141-
142127
# Force dequantize if requested (useful for debugging)
143128
if force_dequant and model is not None:
144129
logging.info("QuantizedModelLoader: Force dequantizing model weights")
@@ -231,19 +216,6 @@ def load_unet(self, unet_name, quant_format, kernel_backend):
231216
# Standard loading path
232217
model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options)
233218

234-
# Adjust memory_usage_factor for quantized models
235-
# Quantized weights use ~1 byte (INT8/FP8) vs 2 bytes (bf16/fp16)
236-
if model is not None and quant_format != "auto":
237-
try:
238-
original_factor = model.model.memory_usage_factor
239-
model.model.memory_usage_factor = original_factor / 2.0
240-
logging.info(
241-
f"QuantizedUNETLoader: Adjusted memory_usage_factor from "
242-
f"{original_factor:.2f} to {model.model.memory_usage_factor:.2f}"
243-
)
244-
except AttributeError:
245-
logging.debug("Could not adjust memory_usage_factor")
246-
247219
return (model,)
248220

249221

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "ComfyUI-QuantOps"
33
description = "Extended quantization layouts for ComfyUI (INT8, row/block-wise FP8)"
4-
version = "1.0.4"
4+
version = "1.0.3"
55
readme = "README.md"
66
license = { file = "LICENSE" }
77
requires-python = ">=3.9"

0 commit comments

Comments
 (0)