From 59da88687514ff983fa73e4175058b78fe35a6cf Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Mon, 20 Feb 2023 20:53:11 +0100 Subject: [PATCH] Fix compilation for iOS --- Diffusion/ModelInfo.swift | 4 ++++ Diffusion/Views/TextToImage.swift | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Diffusion/ModelInfo.swift b/Diffusion/ModelInfo.swift index de93638..eab1ee4 100644 --- a/Diffusion/ModelInfo.swift +++ b/Diffusion/ModelInfo.swift @@ -41,8 +41,12 @@ struct ModelInfo { extension ModelInfo { static var defaultAttention: AttentionVariant { guard runningOnMac else { return .splitEinsum } + #if os(macOS) guard Capabilities.hasANE else { return .original } return Capabilities.performanceCores >= 8 ? .original : .splitEinsum + #else + return .splitEinsum + #endif } var bestAttention: AttentionVariant { diff --git a/Diffusion/Views/TextToImage.swift b/Diffusion/Views/TextToImage.swift index 1c5e1ad..a97562b 100644 --- a/Diffusion/Views/TextToImage.swift +++ b/Diffusion/Views/TextToImage.swift @@ -88,6 +88,8 @@ struct ImageWithPlaceholder: View { }) case .failed(_): return AnyView(Image(systemName: "exclamationmark.triangle").resizable()) + case .userCanceled: + return AnyView(Text("Generation canceled")) } } }