30 lines
959 B
Python
30 lines
959 B
Python
"""INT-Crush: INT4/INT8 quantized inference for ComfyUI diffusion models.
|
|
|
|
Exports ConvLinear4bit for standalone use, registers INT4/INT8 layout
|
|
classes with ComfyUI's QuantizedTensor dispatch, and exposes loader
|
|
node mappings for the ComfyUI graph.
|
|
"""
|
|
|
|
import logging
|
|
|
|
try:
|
|
from .convlinear import ConvLinear4bit
|
|
__all__ = ["ConvLinear4bit"]
|
|
except ImportError:
|
|
ConvLinear4bit = None
|
|
__all__ = []
|
|
|
|
# Register INT4/INT8 layout classes so QuantizedTensor can dispatch to them.
|
|
try:
|
|
from .quant_layout import register_intcrush_layouts
|
|
register_intcrush_layouts()
|
|
except Exception as e:
|
|
logging.warning(f"INT-Crush: layout registration failed: {e}")
|
|
|
|
# Expose ComfyUI node mappings so the host can discover loader nodes.
|
|
try:
|
|
from .comfy_nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
|
|
__all__ += ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|
|
except (ImportError, RuntimeError): # noqa: BLE001
|
|
pass
|