replicate-api 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a596e76f9ab64a522810b88fa4d816f4e3e465938ae9601a9d349c9e4d35bfef
4
- data.tar.gz: 191eca1fd5545dea9127146d36f0aabe8c2ebf552a5647c2a4e43791f46729b7
3
+ metadata.gz: 5a86da01d90280b14db97b1c67c4c61e438e2964e4a9a2be15149821f16572eb
4
+ data.tar.gz: 8b36770242eb9520b88081b4887413e2986fa58d0f3f41d8002b2c4b8ddc1909
5
5
  SHA512:
6
- metadata.gz: 93e354f2cd6dcf5897d5222a0438c04c726a3c0e0d9eb9b6f83c5a5e543b3fe2ce04ca78470a3469de9369f2e5d2b3747b7007cf7aa5107dd26ae03ef3800ee9
7
- data.tar.gz: 58b2128c462a265cc7a65ec98b7ece9c43d6e25b354a7b39a9bd256a4b043e5884b6ec600b4fbb281d9c4bccaca18aa09c72a5b7c40fd9aab7b468a9f13215be
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
- model.predict(prompt="a 19th century portrait of a wombat gentleman")
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
@@ -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=512, width=512)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Replicate
4
- VERSION = "0.1.3"
4
+ VERSION = "0.2.1"
5
5
  end
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.3
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-06 00:00:00.000000000 Z
11
+ date: 2022-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday