How to Save an SDXL Model into a Single File safetensors file

A member of my team has trained a custom SDXL model. To use this custom model we must create a single file that can replace this file in the official SDXL 1.0 Hugging Face repository.

However, I can not find documentation on how to create a single file like this one in the official SDXL repository that includes the UNet, CLIP, and VAE weights saved into a single safetensors format file.

How can I create a file that can serve as a drop-in replacement for sd_xl_base_1.0.safetensors?

This code example does not produce any single file containing the UNet, CLIP, and VAE weights:

pipe = StableDiffusionXLPipeline.from_pretrained(


For additional context, these Hugging Face loaders exist to load single file models but I can not find corresponding methods to write/save hugging face diffuser models in this format: Single files