Skip to content

Commit 47e20d8

Browse files
committed
Update README.md
1 parent ce48d27 commit 47e20d8

File tree

1 file changed

+27
-33
lines changed

1 file changed

+27
-33
lines changed

README.md

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RunveyKit is an unofficial Swift SDK for the RunwayML REST API, designed for qui
1414
## Requirements
1515

1616
- Swift 6.0+
17-
- iOS 13.0+, macOS 13.0+, tvOS 13.0+, watchOS 8.0+, visionOS 1.0+
17+
- iOS 14.0+, macOS 13.0+, tvOS 14.0+, watchOS 8.0+, visionOS 1.0+
1818

1919
## Installation
2020

@@ -26,65 +26,59 @@ dependencies: [
2626
]
2727
```
2828

29-
## Configuration
29+
## Important Note
3030

31-
Before using the library, make sure to set your RunwayML API key:
32-
33-
```swift
34-
RunwayML.apiKey = "YOUR_API_KEY_HERE"
35-
```
36-
37-
**Important Note:** This library is intended for quick prototyping and development purposes only. For production use, it is highly recommended to implement a more secure and controlled approach to managing API keys, such as using environment variables or a secure key management service.
31+
This library is intended for quick prototyping and development purposes only. For production use, it is highly recommended to implement a more secure and controlled approach to managing API keys, such as using environment variables or a secure key management service.
3832

3933
## Usage
4034

4135
Here is a basic example of how to use RunveyKit to generate an image:
4236

43-
```swift
37+
````swift
38+
// Start of Selection
4439
import RunveyKit
4540

46-
do {
47-
let prompt = "Dynamic tracking shot: The camera glides through the iconic Shibuya Crossing in Tokyo at night, capturing the bustling intersection bathed in vibrant neon lights. Countless pedestrians cross the wide intersection as towering digital billboards illuminate the scene with colorful advertisements. The wet pavement reflects the dazzling lights, creating a cinematic urban atmosphere."
48-
let imageURL = URL(string: "https://images.unsplash.com/photo-1542051841857-5f90071e7989?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D")!
49-
50-
let taskID = try await RunwayML.generateImage(
51-
prompt: prompt,
52-
imageURL: imageURL,
53-
duration: .long, // 10 seconds
54-
aspectRatio: .widescreen, // 16:9 ratio
55-
watermark: false,
56-
seed: 42
57-
)
58-
59-
print("Image generation task started with ID: \(taskID)")
60-
} catch {
61-
print("Error generating image: \(error)")
62-
}
63-
```
41+
do {
42+
let prompt = "Dynamic tracking shot: The camera glides through the iconic Shibuya Crossing in Tokyo at night, capturing the bustling intersection bathed in vibrant neon lights. Countless pedestrians cross the wide intersection as towering digital billboards illuminate the scene with colorful advertisements. The wet pavement reflects the dazzling lights, creating a cinematic urban atmosphere."
43+
let imageURL = URL(string: "https://images.unsplash.com/photo-1542051841857-5f90071e7989?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D")!
44+
45+
let runveyKit = RunveyKit(apiKey: "YOUR_API_KEY_HERE")
46+
let taskID = try await runveyKit.generateImage(
47+
prompt: prompt,
48+
imageURL: imageURL,
49+
duration: .long, // 10 seconds
50+
aspectRatio: .widescreen, // 16:9 ratio
51+
)
52+
53+
print("Image generation task started with ID: \(taskID)")
54+
} catch {
55+
print("Error generating image: \(error)")
56+
}
6457

6558
And here's an example of how to retrieve task details and process them into a human-readable description:
6659

6760
```swift
6861
import RunveyKit
6962

7063
do {
64+
let runveyKit = RunveyKit(apiKey: "YOUR_API_KEY_HERE")
7165
let taskId = "17f20503-6c24-4c16-946b-35dbbce2af2f"
72-
let taskDetails = try await RunwayML.getTaskDetails(id: taskId)
73-
let description = RunwayML.processTaskResponse(taskDetails)
74-
print(description)
66+
let taskDetails = try await RunveyKit.getTaskDetails(id: taskId)
67+
print(taskDetails)
7568
} catch {
7669
print("Error: \(error)")
7770
}
78-
```
71+
````
7972

8073
And here's an example of how to cancel or delete a task:
8174

8275
```swift
8376
import RunveyKit
8477

8578
do {
79+
let runveyKit = RunveyKit(apiKey: "YOUR_API_KEY_HERE")
8680
let taskId = "17f20503-6c24-4c16-946b-35dbbce2af2f"
87-
try await RunwayML.cancelOrDeleteTask(id: taskId)
81+
try await RunveyKit.cancelOrDeleteTask(id: taskId)
8882
print("Task \(taskId) has been successfully canceled or deleted.")
8983
} catch {
9084
print("Error canceling or deleting task: \(error)")

0 commit comments

Comments
 (0)