We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there
I am reading https://replicate.com/docs/guides/swiftui to use swiftui replicate sdk to call the model.
And i find out that some models do not have the version on web page.
seems like in getModel Method, I will use multiple if else because different models need different input
enum StableDiffusion: Predictable { static var modelID = "stability-ai/stable-diffusion" static let versionID = "db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf" struct Input: Codable { let prompt: String } typealias Output = [URL] }
or
let model = try await replicate.getModel("stability-ai/stable-diffusion-3") if let latestVersion = model.latestVersion { let prompt = "a 19th century portrait of a gentleman otter" let prediction = try await replicate.createPrediction(version: latestVersion.id, input: ["prompt": "\(prompt)"], wait: true) print(prediction.id) // "s654jhww3hrm60ch11v8t3zpkg" print(prediction.output) // ["https://replicate.delivery/yhqm/bh9SsjWXY3pGKJyQzYjQlsZPzcNZ4EYOeEsPjFytc5TjYeNTA/R8_SD3_00001_.webp"] }
In enum Predictable, how can I receive input image?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there
I am reading https://replicate.com/docs/guides/swiftui to use swiftui replicate sdk to call the model.
And i find out that some models do not have the version on web page.
Question1
seems like in getModel Method, I will use multiple if else because different models need different input
or
Question2
In enum Predictable, how can I receive input image?
The text was updated successfully, but these errors were encountered: