coreml-stable-diffusion-swift

main

swift coreml stable diffusion image generation with example in SwiftUI macos ios image to image, image generation, ios, text to image
igor11191708/coreml-stable-diffusion-swift

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

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

Last updated: Fri Oct 18 2024 12:03:32 GMT-0900 (Hawaii-Aleutian Daylight Time)