ComfyUI > Nodes > ComfyUI-ModelQuantizer > Quantize Model to FP8 Format

ComfyUI Node: Quantize Model to FP8 Format

Class Name

QuantizeFP8Format

Category
Model Quantization/FP8 Direct
Author
lum3on (Account age: 314days)
Extension
ComfyUI-ModelQuantizer
Latest Updated
2025-06-14
Github Stars
0.1K

How to Install ComfyUI-ModelQuantizer

Install this extension via the ComfyUI Manager by searching for ComfyUI-ModelQuantizer
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-ModelQuantizer in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Quantize Model to FP8 Format Description

Facilitates model parameter conversion to FP8 format for memory optimization and faster inference in resource-constrained environments.

Quantize Model to FP8 Format:

The QuantizeFP8Format node is designed to facilitate the conversion of model parameters into the FP8 (Float8) format, which is a compact numerical representation that can significantly reduce the memory footprint of models. This node is particularly useful for AI artists and developers who are looking to optimize their models for deployment on resource-constrained environments, such as mobile devices or edge computing platforms. By converting model weights to FP8, you can achieve faster inference times and lower power consumption without a substantial loss in model accuracy. The node leverages a straightforward quantization method that applies a simple scaling technique to transform the model's state dictionary into the desired FP8 format. This process is efficient and can be seamlessly integrated into existing workflows, making it an essential tool for those looking to enhance the performance and efficiency of their AI models.

Quantize Model to FP8 Format Input Parameters:

model_state_dict

The model_state_dict parameter is a dictionary containing the model's parameters and their corresponding values. It serves as the input data that will be quantized into the FP8 format. This parameter is crucial as it holds the model's learned weights and biases, which are essential for making predictions. The dictionary should be valid and non-empty to ensure successful quantization. If the input is not a dictionary or is empty, the node will not perform the quantization process.

fp8_format

The fp8_format parameter specifies the target FP8 format for quantization. It offers two options: float8_e4m3fn and float8_e5m2, with float8_e5m2 being the default choice. This parameter determines the precision and range of the FP8 representation, impacting the balance between model size reduction and accuracy retention. Selecting the appropriate format is important for achieving the desired trade-off between performance and precision in the quantized model.

Quantize Model to FP8 Format Output Parameters:

quantized_model_state_dict

The quantized_model_state_dict is the output parameter that contains the quantized version of the input model's state dictionary. This dictionary holds the model parameters converted into the specified FP8 format, allowing for reduced memory usage and potentially faster computation. The output is crucial for deploying models in environments where computational resources are limited, as it enables efficient model execution while maintaining a reasonable level of accuracy.

Quantize Model to FP8 Format Usage Tips:

  • Ensure that the model_state_dict is a valid and non-empty dictionary to avoid errors during the quantization process.
  • Choose the fp8_format that best suits your model's requirements. If precision is more critical, consider using float8_e5m2, while float8_e4m3fn may be suitable for more aggressive size reduction.
  • Test the quantized model in your target environment to verify that the performance improvements align with your expectations and that the accuracy remains acceptable.

Quantize Model to FP8 Format Common Errors and Solutions:

Invalid input.

  • Explanation: This error occurs when the model_state_dict is either not a dictionary or is empty, preventing the quantization process from proceeding.
  • Solution: Ensure that the input model_state_dict is a valid dictionary containing the model's parameters and that it is not empty before passing it to the node.

No tensor converted to <fp8_format>.

  • Explanation: This message indicates that none of the tensors in the model's state dictionary were successfully converted to the specified FP8 format.
  • Solution: Verify that the model's parameters are compatible with the FP8 conversion process and that the correct fp8_format is selected. Additionally, check for any issues in the model's state dictionary that might prevent successful conversion.

Quantize Model to FP8 Format Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-ModelQuantizer
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.