replicate-api 0.1.3 → 0.2.0
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 +1 -1
- 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: 180c9dd2c75f2335a772aedb8064e410c11afd4aba23b16e85c90b9ea415ff49
|
4
|
+
data.tar.gz: 4a2feaf5e3e75f01588b9f1952b847653968358a80ea5c5ddf860c113e10a28f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50b6f576d2c4c8a72df80278c327014da33eda9cb954873e45730fafb809c8b10fd1544123f08ef8a8b0c257f366d94b3006d641f9845862e3972e3c66e087bb
|
7
|
+
data.tar.gz: ad58c277a43eb85171ee303daae1c8142a5543a4071c18c1c76120f4509f2fd5f38166392efc61ed3b70c97a36fa2efe5ab6e5b067ff235f6105c96d302a1c3b
|
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,7 +9,7 @@ module Replicate
|
|
9
9
|
@version_id = response.body["latest_version"]["id"]
|
10
10
|
end
|
11
11
|
|
12
|
-
def predict(prompt, height
|
12
|
+
def predict(prompt: "", height: 512, width: 512, image: "")
|
13
13
|
body = {version: @version_id, input: {prompt: prompt, height: height, width: width}}
|
14
14
|
response = @client.requests(method: "POST", path: "predictions", **body)
|
15
15
|
poll(prediction_id: response.body["id"])
|
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.
|
4
|
+
version: 0.2.0
|
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
|