Correctly show safety checker error.

pull/28/head
Pedro Cuenca 2 years ago
parent 9c54eb40f6
commit 9587712609

@ -74,7 +74,7 @@ struct StatusView: View {
case .complete(_, let image, let lastSeed, let interval):
guard let _ = image else {
return HStack {
Text("Safety checker triggered, please try a different prompt or seed")
Text("Safety checker triggered, please try a different prompt or seed.")
Spacer()
}
}

@ -65,8 +65,8 @@ class Pipeline {
let interval = Date().timeIntervalSince(beginDate)
print("Got images: \(images) in \(interval)")
// unwrap the 1 image we asked for
guard let image = images.compactMap({ $0 }).first else { throw "Generation failed" }
// Unwrap the 1 image we asked for, nil means safety checker triggered
let image = images.compactMap({ $0 }).first
return GenerationResult(image: image, lastSeed: theSeed, interval: interval)
}

Loading…
Cancel
Save