Swift Diffusers for Mac 1.1 Release

Hugging Face has released version 1.1 of Diffusers for Mac, a native application that enables fast, local text-to-image generation on macOS. By converting community-contributed diffusion models to Core ML, the app optimizes performance across Apple Silicon's CPU, GPU, and Neural Engine (ANE).

Core ML Integration and Native Performance

Diffusers for Mac provides a native alternative to the Python-based diffusers library. While the Python library uses PyTorch's mps accelerator, the native app utilizes Core ML, which offers several technical advantages:

  • Hardware Orchestration: Core ML can distribute model workloads across the CPU, GPU, and Neural Engine simultaneously. In contrast, PyTorch's mps device cannot utilize the Neural Engine.
  • Local Execution: All image generation occurs locally on the user's machine, ensuring data privacy and removing the need for cloud credits or queue times.
  • Native UX: The application is built with Swift and SwiftUI, adhering to Apple's design guidelines to eliminate the need for command-line interfaces or virtual environment management.

Performance Benchmarks and Hardware Optimization

Text-to-image generation in version 1.1 can be up to twice as fast depending on the hardware configuration. Performance varies significantly based on the specific Apple Silicon chip used:

  • Standard M1 Processors: These devices (e.g., Mac Mini) are twice as fast when using the Apple Neural Engine (ANE) compared to the GPU.
  • M1 Max: On high-end chips like the M1 Max, GPU generation is significantly faster than ANE generation due to the higher count of GPU and CPU performance cores relative to the Neural Engine.
  • Memory Impact: Benchmarks indicate that the amount of system memory (e.g., 8GB vs 16GB) does not significantly impact generation performance; rather, the number of CPU and GPU cores is the primary driver.

Benchmark Data Summary

Model name M1 8 GB (ANE) M1 16 GB (ANE) M2 24 GB (ANE) M1 Max 64 GB (GPU)
Stable Diffusion 1.5 18.8 18.7 13.1 9
Stable Diffusion 2 Base 14.5 14.4 10.5 8.3
Stable Diffusion 2.1 Base 14.3 14.3 10.5 8.3
small-stable-diffusion-v0 12.3 12.7 9.1 6.3

Version 1.1 includes heuristics to automatically select the optimal accelerator based on the detected hardware.

Version 1.1 Feature Updates

Beyond performance optimizations, version 1.1 introduces several user-experience and functional improvements:

  • Generation Controls: Users can now adjust the guidance scale, cancel active generations, and optionally disable the safety checker.
  • Workflow Enhancements: The app now includes model download indicators and a shortcut to reuse seeds from previous generations for iterative tweaking.
  • Educational Tooltips: New information has been added to explain the function of various generation settings to make the tool more accessible to non-technical users.

Future Roadmap

Hugging Face intends to expand the capabilities of the Apple ecosystem integration through:

  • Expanded Model Access: Implementing easier access to additional fine-tuned or Dreambooth models from the Hugging Face Hub.
  • Platform Expansion: Developing versions of the application for iOS and iPadOS.

Sources