Skip to content

Commit 59da886

Browse files
committed
Fix compilation for iOS
1 parent 1084ea7 commit 59da886

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diffusion/ModelInfo.swift

+4
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ struct ModelInfo {
4141
extension ModelInfo {
4242
static var defaultAttention: AttentionVariant {
4343
guard runningOnMac else { return .splitEinsum }
44+
#if os(macOS)
4445
guard Capabilities.hasANE else { return .original }
4546
return Capabilities.performanceCores >= 8 ? .original : .splitEinsum
47+
#else
48+
return .splitEinsum
49+
#endif
4650
}
4751

4852
var bestAttention: AttentionVariant {

Diffusion/Views/TextToImage.swift

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ struct ImageWithPlaceholder: View {
8888
})
8989
case .failed(_):
9090
return AnyView(Image(systemName: "exclamationmark.triangle").resizable())
91+
case .userCanceled:
92+
return AnyView(Text("Generation canceled"))
9193
}
9294
}
9395
}

0 commit comments

Comments
 (0)