Skip to main content
The fal-swift package provides a native Swift interface for calling fal AI models on Apple platforms.

Installation

Add the package via Swift Package Manager:
.package(url: "https://github.com/fal-ai/fal-swift.git", from: "0.5.6")

Quick Start

import FalClient

let result = try await fal.subscribe(
    to: "fal-ai/flux/dev",
    input: [
        "prompt": "a cat",
        "seed": 6252023,
        "image_size": "landscape_4_3",
        "num_images": 4
    ],
    includeLogs: true
) { update in
    if case let .inProgress(logs) = update {
        print(logs)
    }
}

Supported Platforms

  • iOS 16+
  • macOS 13+
  • tvOS 16+
  • watchOS 9+

API Reference

Swift API Reference

Full API documentation on Swift Package Index

GitHub Repository

Source code and examples