Releases: fal-ai/fal-swift
0.3.0
What's Changed
- feat: file upload support + better error handling by @drochetti in #6
Full Changelog: 0.2.0...0.3.0
0.2.0
What's Changed
- feat: realtime high fps by @drochetti in #3
Breaking changes
This release is a breaking change from 0.1.x
The untyped API's now rely on the Payload
object instead of plain [String: Any]
dictionaries. Unfortunately, as you all may know, dictionaries in Swift are not Codable
, which makes it hard to serialize/deserialize in some of the scenarios we have in our APIs. But worry not, the Payload
implementation was done in a way to work very similarly to dictionaries, in fact it's way more friendly for optional chaining and can also be converted to [String: Any]
.
For those who know libraries like SwiftyJSON
, it is very similar to that, but we have our own type because we also want to be able to hold binary data and transform it later, there the JSON implementations our there do not fit our use-case.
For those migrating, here's a snippet that shows the difference when reading results:
// Instead of this
if let images = result["images"] as? [[String: Any]] {
imageUrl = images[0]["url"] as? String
// Do this - you can chain subscript access regardless if there are nil values in the way
if case let .string(url) = result["images"][0]["url"] {
imageUrl = url
}
For inputs, the Payload
type can be created just like any Dictionary literal, with minor differences when passing variables of specific types, such as .data(Data)
:
try connection.send([
"prompt": .string(prompt),
"image": .data(data),
"num_inference_steps": 3,
"strength": 0.44,
"guidance_scale": 1,
"seed": 224,
])
New platform support matrix
The platform support changed due to underlying dependencies. This is the previous vs current platform support:
Platform | 0.1.3 | 0.2.0 |
---|---|---|
iOS | v15 | v16 |
macOS | v12 | v13 |
macCatalyst | v13 | v16 |
tvOS | v13 | v16 |
watchOS | v8 | v9 |
Full Changelog: 0.1.3...0.2.0
0.1.1
0.1.0
What's Changed
- chore: add build workflow by @drochetti in #1
- feat: realtime support by @drochetti in #2
New Contributors
- @drochetti made their first contribution in #1
Full Changelog: https://github.com/fal-ai/serverless-client-swift/commits/0.1.0