replicate-api 0.1.3 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/replicate/model.rb +2 -2
- data/lib/replicate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a86da01d90280b14db97b1c67c4c61e438e2964e4a9a2be15149821f16572eb
|
4
|
+
data.tar.gz: 8b36770242eb9520b88081b4887413e2986fa58d0f3f41d8002b2c4b8ddc1909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 591522324d4a384475c6061854a9506ebde3df68b8743e55b9ddbedeb909c0bcfc9541c95aaec135b1363a3f0af88fed259169b23fecd52ab77a00195f3d50b8
|
7
|
+
data.tar.gz: 3e136096552b4cde2aa0bde18e686125c44b59e4a4c055e2e29b1f040940bec2dd6e9789ea1ac26f9981b6c5ab533a19cb33731798bf651784dce74acd210942
|
data/README.md
CHANGED
@@ -27,7 +27,9 @@ You can run a model and get its output:
|
|
27
27
|
```ruby
|
28
28
|
replicate = Replicate::Client.new(token: "#{YOUR API KEY HERE}")
|
29
29
|
model = replicate.models("stability-ai/stable-diffusion")
|
30
|
-
|
30
|
+
height = 786
|
31
|
+
width = 574
|
32
|
+
model.predict(prompt: "a 19th century portrait of a wombat gentleman", width: width, height: height)
|
31
33
|
```
|
32
34
|
|
33
35
|
## Contributing
|
data/lib/replicate/model.rb
CHANGED
@@ -9,8 +9,8 @@ module Replicate
|
|
9
9
|
@version_id = response.body["latest_version"]["id"]
|
10
10
|
end
|
11
11
|
|
12
|
-
def predict(prompt, height
|
13
|
-
body = {version: @version_id, input: {prompt: prompt, height: height, width: width}}
|
12
|
+
def predict(prompt: "", height: 512, width: 512, image: "")
|
13
|
+
body = {version: @version_id, input: {prompt: prompt, height: height, width: width, image: image}}
|
14
14
|
response = @client.requests(method: "POST", path: "predictions", **body)
|
15
15
|
poll(prediction_id: response.body["id"])
|
16
16
|
end
|
data/lib/replicate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: replicate-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivia Li
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|