We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am creating a package with this command
ml-stable-diffusion-main % python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --model-version "diffusers/stable-diffusion-xl-1.0-inpainting-0.1" -o "/Users/cm/Documents/VisionOS/StableDiPackage/Sources/StableDiPackage/Models" --attention-implementation ORIGINAL --bundle-resources-for-swift-cli
and using it in Swift with
import Foundation import StableDiffusion import CoreImage import CoreML @available(macCatalyst 17.0, *) public struct StableDIService { let pipeline : StableDiffusionXLPipeline public init() throws { print("\(type(of: self)) :: \(#function)") let url = Bundle.module.resourceURL! print("\(type(of: self)) :: \(#function) :: \(url)") let config = MLModelConfiguration() config.computeUnits = .cpuAndGPU pipeline = try StableDiffusionXLPipeline( resourcesAt: url, configuration: config, reduceMemory: false) print("\(type(of: self)) :: \(#function) :: post pipeline") try pipeline.loadResources() print("\(type(of: self)) :: \(#function) :: post load resources") } public func generateImage(image: CGImage) throws -> CIImage { print("\(type(of: self)) :: \(#function)") var prompt : PipelineConfiguration = .init(prompt: "Fill in blank area") prompt.imageCount = 1 prompt.startingImage = image print("\(type(of: self)) :: \(#function) :: post pipeline config") let images = try pipeline.generateImages(configuration: .init(prompt: "Fill in blank area"), progressHandler: { progress in print(progress.step) return true }) guard let image = images.first else { return .red } print("\(type(of: self)) :: \(#function) :: post generate") return CIImage(cgImage: image!) } }
I am getting a crash in
public struct Unet: ResourceManaging {
at line 74
model.modelDescription.inputDescriptionsByName["time_ids"]!
Am I missing something?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am creating a package with this command
ml-stable-diffusion-main % python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --model-version "diffusers/stable-diffusion-xl-1.0-inpainting-0.1" -o "/Users/cm/Documents/VisionOS/StableDiPackage/Sources/StableDiPackage/Models" --attention-implementation ORIGINAL --bundle-resources-for-swift-cli
and using it in Swift with
I am getting a crash in
public struct Unet: ResourceManaging {
at line 74
model.modelDescription.inputDescriptionsByName["time_ids"]!
Am I missing something?
The text was updated successfully, but these errors were encountered: