lzell / AIProxySwift

Client for AIProxy
https://www.aiproxy.pro
73 stars 9 forks source link

Add support for Flux-Pro version 1.1 on Replicate #49

Closed lzell closed 1 month ago

lzell commented 1 month ago

How to generate a Flux-Pro image by Black Forest Labs, using Replicate

See the full range of controls for generating an image by viewing ReplicateFluxProInputSchema_v1_1.swift

import AIProxy

let replicateService = AIProxy.replicateService(
    partialKey: "partial-key-from-your-developer-dashboard",
    serviceURL: "service-url-from-your-developer-dashboard"
)

do {
    let input = ReplicateFluxProInputSchema_v1_1(
        prompt: "Monument valley, Utah. High res"
    )
    let output = try await replicateService.createFluxProImage_v1_1(
        input: input
    )
    print("Done creating Flux-Pro image: ", output)
}  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
    print("Received \(statusCode) status code with response body: \(responseBody)")
} catch {
    print("Could not create Flux-Pro image: \(error.localizedDescription)")
}