lzell / AIProxySwift

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

Add support for Replicate model fofr/sdxl-fresh-ink #71

Closed lzell closed 3 weeks ago

lzell commented 3 weeks ago

How to generate an SDXL Fresh Ink image by fofr, using Replicate

import AIProxy

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

do {
    let input = ReplicateSDXLFreshInkInputSchema(
        prompt: "A fresh ink TOK tattoo of monument valley, Utah",
        negativePrompt: "ugly, broken, distorted"
    )
    let urls = try await replicateService.createSDXLFreshInkImageURLs(
        input: input
    )
    print("Done creating SDXL fresh ink image: ", urls.first ?? "")
}  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
    print("Received \(statusCode) status code with response body: \(responseBody)")
} catch {
    print("Could not create SDXL fresh ink image: \(error.localizedDescription)")
}

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