Sometimes you need to get metadata from a safetensors file. To do this, you can use the Python script attached to this article. This script allows you to output metadata to the console from both a file in the local file system and from a URL, without having to download the safetensors file.
To print local file metadata to the screen, call a command like
python sft_meta.py FluxFusionV2_fp8_unet+clip+vae_checkpoint.safetensorsTo print online file metadata to the screen, call a command like
python sft_meta.py https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/main/I2V/Wan2_2-I2V-A14B-HIGH_fp8_e5m2_scaled_KJ.safetensorsTo save metadata to a file, append
> metadata.json to the end of the command. For example:
python sft_meta.py https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/main/I2V/Wan2_2-I2V-A14B-HIGH_fp8_e5m2_scaled_KJ.safetensors > metadata.jsonIf the Python script does not run, first install the missing modules with the command
pip install requests argparse

