ComfyUI > Nodes > ComfyUI-ModelQuantizer > Save Model as SafeTensor

ComfyUI Node: Save Model as SafeTensor

Class Name

SaveAsSafeTensor

Category
Model Quantization/Save
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

Save Model as SafeTensor Description

Facilitates secure saving of quantized model state dictionaries in `.safetensors` format for efficient storage and performance optimization.

Save Model as SafeTensor:

The SaveAsSafeTensor node is designed to facilitate the secure and efficient saving of quantized model state dictionaries into the .safetensors format. This node is particularly beneficial for AI artists and developers who work with machine learning models, as it ensures that the model's data is stored in a format that is both safe and optimized for performance. The .safetensors format is known for its ability to handle large tensor data efficiently, making it an ideal choice for saving model weights and parameters. By using this node, you can ensure that your model's data is saved in a way that minimizes the risk of data corruption and maximizes compatibility with various machine learning frameworks. The node automatically handles the conversion of tensors to CPU if necessary and creates the required directory structure for saving the file, providing a seamless and user-friendly experience.

Save Model as SafeTensor Input Parameters:

quantized_model_state_dict

This parameter is a dictionary containing the state of the quantized model, where each key-value pair represents a layer name and its corresponding tensor. The function of this parameter is to provide the node with the necessary data to be saved in the .safetensors format. It is crucial for the execution of the node, as it directly impacts the content of the saved file. There are no specific minimum, maximum, or default values for this parameter, but it must be a valid dictionary of tensors.

absolute_save_path

This parameter specifies the file path where the .safetensors file will be saved. It is essential for determining the location and name of the output file. The path must be a valid string, and if it does not end with .safetensors, the node will automatically append this extension. There are no specific minimum, maximum, or default values, but the path must be non-empty and valid.

Save Model as SafeTensor Output Parameters:

ui

The ui output parameter provides feedback on the operation's success or failure. It is a dictionary containing a text key, which holds a list of messages. These messages inform you whether the file was saved successfully or if an error occurred during the process. This output is crucial for understanding the result of the node's execution and for debugging purposes if any issues arise.

Save Model as SafeTensor Usage Tips:

  • Ensure that the quantized_model_state_dict is a valid dictionary of tensors before using the node to avoid errors.
  • Always provide a valid and non-empty absolute_save_path to ensure the file is saved correctly. If you forget to add the .safetensors extension, the node will handle it for you.

Save Model as SafeTensor Common Errors and Solutions:

Error: Input invalid.

  • Explanation: This error occurs when the quantized_model_state_dict is not a valid dictionary or is empty.
  • Solution: Verify that the input is a properly formatted dictionary containing the model's state tensors.

Error: Path empty.

  • Explanation: This error is triggered when the absolute_save_path is not provided or is an empty string.
  • Solution: Ensure that you specify a valid file path where the .safetensors file should be saved.

Error saving: <error_message>

  • Explanation: This error indicates that an exception occurred during the saving process, with <error_message> providing details about the specific issue.
  • Solution: Check the error message for clues, such as permission issues or invalid paths, and address the underlying problem accordingly.

Save Model as SafeTensor 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.