Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt authored Dec 15, 2023
1 parent 286ba0b commit 4421aa1
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import Replicate
let replicate = Replicate.Client(token: <#token#>)
```

> **Warning**
>
> [!WARNING]
> Don't store secrets in code or any other resources bundled with your app.
> Instead, fetch them from CloudKit or another server and store them in the keychain.
Expand All @@ -43,9 +42,7 @@ Or fetch a model by name and create a prediction against its latest version:
```swift
let model = try await replicate.getModel("stability-ai/stable-diffusion")
if let latestVersion = model.latestVersion {
let prompt = """
a 19th century portrait of a wombat gentleman
"""
let prompt = "a 19th century portrait of a wombat gentleman"
let prediction = try await replicate.createPrediction(version: latestVersion.id,
input: ["prompt": "\(prompt)"],
wait: true)
Expand Down Expand Up @@ -78,9 +75,7 @@ You can start a model and run it in the background:
```swift
let model = replicate.getModel("kvfrans/clipdraw")

let prompt = """
Watercolor painting of an underwater submarine
"""
let prompt = "watercolor painting of an underwater submarine"
var prediction = replicate.createPrediction(version: model.latestVersion!.id,
input: ["prompt": "\(prompt)"])
print(prediction.status)
Expand All @@ -96,9 +91,7 @@ You can cancel a running prediction:
```swift
let model = replicate.getModel("kvfrans/clipdraw")

let prompt = """
Watercolor painting of an underwater submarine
"""
let prompt = "watercolor painting of an underwater submarine"
var prediction = replicate.createPrediction(version: model.latestVersion!.id,
input: ["prompt": "\(prompt)"])
print(prediction.status)
Expand Down

0 comments on commit 4421aa1

Please sign in to comment.