HeadlinesBriefing favicon HeadlinesBriefing.com

Automatic1111 Metal Optimization: 40% Speedup for SD1.5

Hacker News •
×

A fine-tuned version of Automatic1111 for Apple Silicon achieves substantial speedups—around 40% for SD1.5 on M3 Pro (from 8–10s to 3–7s) and noticeable gains on M1 Mac Mini (13–20s down to 8–10s). These improvements come from multiple targeted optimizations rather than a single change.

The most impactful changes include implementing Metal Flash Attention for specific SD1.x attention shapes rather than universally, and integrating the Metal kernel directly into PyTorch's MPS stream to avoid committing the command buffer after every attention call. This overhead reduction proved critical at short generation times.

Memory management adapts to Apple's unified architecture: the fork estimates attention memory costs against available system memory and dynamically sizes fallback chunking. An online-softmax approach is used for sub-quadratic attention, discarding partial K/V chunks after merging to keep memory scale bounded.

Additionally, outdated MPS workarounds—like unnecessary clones and FP32 conversions—were removed as the PyTorch backend improved. The result is a faster, predictable, and fully compatible Automatic1111 that preserves all extensions and workflows.