Skip to content

The-Igor/coreml-stable-diffusion-swift

Repository files navigation

CoreML stable diffusion image generation

The package is a mediator between Apple's Core ML Stable Diffusion implementation and your app that let you run text-to-image or image-to-image models

How to use the package

1. Create GenerativeManager

   let manager = GenerativeManager()

2. Run async method generate

       let images: [CGImage?] = try await manager.generate(
                with: config, 
                by: pipeline
            )

Performance

The speed can be unpredictable. Sometimes a model will suddenly run a lot slower than before. It appears as if Core ML is trying to be smart in how it schedules things, but doesn’t always optimal.

SwiftUI example

CoreML stable diffusion image generation

The concept

The concept

Documentation(API)

  • You need to have Xcode 13 installed in order to have access to Documentation Compiler (DocC)
  • Go to Product > Build Documentation or ⌃⇧⌘ D

Used packages

Releases

No releases published

Packages

No packages published

Languages