Skip to content
CAI
Software that uses CAICheck a score

huggingface/swift-coreml-diffusers

40.4

Weak · 30 September 2026

2.5k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Diffusion is a cross-platform native application for iOS and macOS that performs local image generation using Stable Diffusion models. It provides a unified interface for managing model downloads, configuring generation parameters, and viewing real-time progress, while abstracting the underlying pipeline to support SDXL and SD3 architectures. The system handles platform-specific optimizations for Apple Silicon and Intel Macs, allowing users to generate images via the Neural Engine, GPU, or CPU with options to save or share the results.

How it got here

2022 — macOS support and iOS refinements

7 changes.

The project expanded to support macOS by adding a dedicated target and platform-specific UI components, while refining iOS image handling and entitlements. Legacy pipeline abstractions were removed in favor of improved generation feedback and error handling across both platforms.

2023 — macOS app launch and pipeline unification

5 changes.

This period focused on releasing the first native macOS application for Diffusion, featuring a SwiftUI interface and optimized compute support for Apple Silicon and Intel Macs. The underlying architecture was significantly refactored to introduce a unified pipeline abstraction, enabling support for Stable Diffusion XL and SD3 models while centralizing common infrastructure for image generation and model management.

Features

Initial macOS application release

Diffusion is now available as a native macOS app, bringing the Stable Diffusion image generation capabilities to Apple Silicon and Intel Macs. The application features a SwiftUI interface for managing model downloads, configuring generation parameters (such as prompt, guidance scale, and seed), and viewing progress with live previews. Users can generate images using the Neural Engine, GPU, or CPU, with the app automatically selecting the best compute units for the hardware. Generated images can be saved to disk or copied to the clipboard, and the app includes built-in help documentation for models and settings.

Diffusion-macOS · high confidence

New common infrastructure for image generation and model management

This change introduces a new Diffusion/Common module that centralizes core data models and utilities for the application. It adds DiffusionImage to track generated images and their associated generation parameters (such as seed, prompts, and scheduler), and ModelInfo to define and manage Stable Diffusion model variants (including SDXL and SD3 support) with platform-specific attention and compute unit optimizations. The module also includes State.swift for managing generation context and user settings, Utils.swift for helper functions, and refactors Downloader.swift to support authenticated downloads and background task management while removing the external Path dependency.

Diffusion/Common · high confidence

Unified pipeline abstraction with SDXL and SD3 support

The Diffusion/Common/Pipeline module now provides a unified \Pipeline\ class that abstracts the underlying Stable Diffusion implementation, enabling support for both Stable Diffusion XL (SDXL) and Stable Diffusion 3 (SD3) models. This change introduces specific configuration handling for SDXL (adjusting encoder/decoder scale factors and using Karras timestep spacing) and SD3 (adjusting scale/shift factors and timestep shift), while maintaining backward compatibility with standard Stable Diffusion models. The \PipelineLoader\ has been refactored to use \FileManager\ instead of the removed \Path\ package, manages model variants based on compute units, and loads the appropriate pipeline protocol (\StableDiffusionPipelineProtocol\) to support these different model architectures.

Diffusion/Common/Pipeline · high confidence

macOS app support added to Diffusion

The project now includes a dedicated macOS target (Diffusion-macOS) alongside the existing iOS app. This adds macOS-specific entry points (Diffusion\_macOSApp.swift), UI components (ContentView, ControlsView, StatusView, GeneratedImageView), and platform-specific source files (DiffusionImage+macOS.swift, Utils\_macOS.swift) to the build configuration, enabling the application to run on macOS.

Diffusion.xcodeproj · high confidence

Removals

Removal of legacy Stable Diffusion pipeline wrapper

The \Pipeline.swift\ file, which previously wrapped the \StableDiffusionPipeline\ to manage generation progress and image output, has been removed from the codebase. This change eliminates the legacy abstraction layer that handled CoreML-based diffusion tasks, indicating a shift in how image generation is architected within the application.

Diffusion/Pipeline · high confidence

Behavioural changes

Centralized build configuration and disabled macOS code signing

Build settings for the macOS application have been reorganized into dedicated xcconfig files. A new common configuration file defines the product name, versioning (1.5), and bundle identifier, while a debug configuration file includes these common settings and explicitly disables code signing for macOS SDKs, simplifying the local development and testing workflow.

config · high confidence

Improved generation feedback and platform-specific save options

The Diffusion app now provides more detailed feedback during image generation, including preview progress images and the elapsed time interval for completed generations. On macOS, users can explicitly save generated images via a dedicated Save button, while iOS/iPadOS users retain the standard Share functionality. Additionally, the app now handles generation errors and cancellations gracefully, displaying appropriate status messages instead of failing silently.

Diffusion/Views · high confidence

Prompt input field now displays real-time token usage

The prompt text input view now calculates and displays the number of tokens generated from the user's text against the model's maximum limit (77 tokens). As users type, the character count updates dynamically, and the text color changes from green to orange to red to indicate proximity to the token limit, helping users manage prompt length effectively across both iOS and macOS platforms.

Diffusion/Common/Views · high confidence

iOS-specific image handling and entitlements for memory and file access

This change introduces iOS-specific implementation details for the Diffusion app, including a new \DiffusionImage+iOS.swift\ file that handles saving generated images to the file system and enabling pasteboard sharing. It adds an \Info.plist\ with a usage description for the Photo Library and updates \Diffusion.entitlements\ to request extended virtual addressing and increased memory limits, as well as read-write file access. Additionally, \DiffusionApp.swift\ now includes logic to detect if the app is running on Mac Catalyst and checks device memory to determine support for quantization, while \Utils\_iOS.swift\ provides a helper to convert image data to CGImage.

Diffusion · high confidence

Test coverage

Added license header to DiffusionTests

The DiffusionTests module now includes a license header referencing the swift-coreml-diffusers project license, ensuring proper attribution and compliance for the test code.

DiffusionTests · high confidence

Dependencies

Updated Swift Package Manager dependencies

The project's resolved package dependencies have been updated to specific revisions and versions. This includes updating \swift-argument-parser\ to version 1.4.0, \ZIPFoundation\ to version 0.9.18, and refreshing the pinned commits for \CompactSlider\ and \ml-stable-diffusion\ to their latest main branch states.

(dependencies) · high confidence

Housekeeping

License header added to UI test files

The DiffusionUITests files now include a reference to the project license, ensuring legal compliance for the test suite.

DiffusionUITests · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 44 → 40 (-3.4)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 97 → 95 (-2.5)
  • Architecture 94 → 96 (+1.4)
  • Maturity 34 → 34 (+0.0)
  • Readiness 17 → 13 (-4.3)
  • Security 100 → 100 (+0.0)

Resolved (2)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)

New (9)

  • ControlsView.body (cognitive 27) (Diffusion-macOS/ControlsView.swift)
  • ControlsView.body (cyclomatic 17) (Diffusion-macOS/ControlsView.swift)
  • Duplicated block (18–19 lines × 2) (Diffusion-macOS/GeneratedImageView.swift)
  • Duplicated block (6 lines × 2) (Diffusion-macOS/ControlsView.swift)
  • Floating branch dependency: compactslider
  • Floating branch dependency: ml-stable-diffusion
  • MethodTooLong: ControlsView.body (Diffusion-macOS/ControlsView.swift)
  • Outdated: swift-argument-parser
  • Outdated: zipfoundation

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

huggingface/swift-coreml-diffusers was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a561fae8b47707efa68f70e2fa1fea5ab4462ab9 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.