diffusers
A diffusion model library released by Hugging Face for image and video generation, supporting memory optimization techniques such as CPU offload.
Core Facts
Hugging Face has released a series of supporting open-source libraries including transformers, datasets, and diffusers.
diffusers is an open-source Python library maintained by Hugging Face, specifically designed for loading and running various diffusion models and flow matching models.
Timeline (last 90 days)
The diffusers enable_model_cpu_offload() strategy is based on the idea of 'keeping the model on CPU and moving it to GPU only at runtime', but on UMA this strategy may not effectively reduce memory pressure.
When the author ran Qwen-Image-2.1 at 1024×1024 resolution on the same Mac, the process footprint never exceeded 18.5 GB, but swap grew by 3.5 GB during the denoising stage and by 9.6 GB during the VAE decoding stage, and finally the memory guard actively terminated the run before writing out the image.
In a run of Qwen-Image-2.1 with diffusers model CPU offload, the footprint on a 48 GB M5 Pro never exceeded 18.5 GB, while swap space grew by 9.6 GB.
When encountering out-of-memory errors, strategies such as quantization (fp8/nf4 checkpoints), model offloading (enabling device_map=auto in the diffusers library), and tiled generation can be employed.
Setting num_inference_steps alone does not override the schedule already saved by Turbo; the sigmas parameter must be explicitly passed in to change the number of steps.
The version of diffusers containing PR #14950 has been released to PyPI with version 0.41.0 and can be run with Turbo via pip install "diffusers>=0.41.0".
All Facts (8)
Hugging Face has released a series of supporting open-source libraries including transformers, datasets, and diffusers.
75%Verifieddiffusers is an open-source Python library maintained by Hugging Face, specifically designed for loading and running various diffusion models and flow matching models.
65%UnverifiedThe diffusers enable_model_cpu_offload() strategy is based on the idea of 'keeping the model on CPU and moving it to GPU only at runtime', but on UMA this strategy may not effectively reduce memory pressure.
50%UnverifiedIn a run of Qwen-Image-2.1 with diffusers model CPU offload, the footprint on a 48 GB M5 Pro never exceeded 18.5 GB, while swap space grew by 9.6 GB.
50%UnverifiedWhen encountering out-of-memory errors, strategies such as quantization (fp8/nf4 checkpoints), model offloading (enabling device_map=auto in the diffusers library), and tiled generation can be employed.
50%UnverifiedSetting num_inference_steps alone does not override the schedule already saved by Turbo; the sigmas parameter must be explicitly passed in to change the number of steps.
50%UnverifiedWhen the author ran Qwen-Image-2.1 at 1024×1024 resolution on the same Mac, the process footprint never exceeded 18.5 GB, but swap grew by 3.5 GB during the denoising stage and by 9.6 GB during the VAE decoding stage, and finally the memory guard actively terminated the run before writing out the image.
50%UnverifiedThe version of diffusers containing PR #14950 has been released to PyPI with version 0.41.0 and can be run with Turbo via pip install "diffusers>=0.41.0".
50%