stability_sdk 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 401df5c1aa6c7c458a171cc6e7f437a420d56a17f394236c42afe6b7114986bc
4
- data.tar.gz: 744723a641d79456d255a0120118f8d218137d0901c760ede079d9dc51301f50
3
+ metadata.gz: 355759d5ba4bcb0ba3b688e85cc87651303710b7f79be7c63233b87f55c76696
4
+ data.tar.gz: 6f216e291a32250132cc07ba6c9083eefa2927332c3fefefef19971f412d80c8
5
5
  SHA512:
6
- metadata.gz: f37b8db84a96fb1df551ef789e43138eb80adb8e8540a7b3619e44b66bed7b193aeb704ab8099daaf64f761c3e92bfd90088faf3285c9a1ffc07a06e457ae20a
7
- data.tar.gz: 7b8b4bec82c39a5046bbe805e213fe5f4c5ddb0dd279352bd619768a711fc17a0254a958ddeac46d3835a76e75e7578ab11e82fdda9cb77d477d62ba5677c222
6
+ metadata.gz: 8f36ca048b79f3f79723427b7613bba2af9cb2f992796a7354b2b74a0c76ff6c72419aabf9c5dd0f64d8ee32b240fb1795e8a7c55d2b67e2b7f0f380c46ca4ab
7
+ data.tar.gz: 4b1ddbfc50e40a39b201082a606a9d6960b6b93b6233fa031d7e2dfc961f8d31abca1a6b180aab84727ef4c04b43692233776dba84f0750e54c63128eb5e1515
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stability_sdk (0.2.1)
4
+ stability_sdk (0.2.3)
5
5
  grpc (>= 1.0.0)
6
6
  mime-types (>= 3.0.0)
7
7
 
@@ -1,5 +1,6 @@
1
1
  require "grpc"
2
2
  require "generation_services_pb"
3
+ require "pry"
3
4
 
4
5
  module StabilitySDK
5
6
  class Client
@@ -31,7 +32,12 @@ module StabilitySDK
31
32
  call_creds = GRPC::Core::CallCredentials.new(proc { { "authorization" => "Bearer #{options[:api_key]}" } })
32
33
  creds = channel_creds.compose(call_creds)
33
34
 
34
- @stub = Gooseai::GenerationService::Stub.new(host, creds)
35
+ stub_params = {}
36
+ [:channel_override, :timeout, :propagate_mask, :channel_args, :interceptors].each do |kw|
37
+ stub_params[kw] = options[kw] if options.has_key?(kw)
38
+ end
39
+
40
+ @stub = Gooseai::GenerationService::Stub.new(host, creds, **stub_params)
35
41
  end
36
42
 
37
43
  def generate(prompt, options, &block)
@@ -39,7 +45,7 @@ module StabilitySDK
39
45
  height = options.has_key?(:height) ? options[:height].to_i : DEFAULT_IMAGE_HEIGHT
40
46
  samples = options.has_key?(:num_samples) ? [:num_samples].to_i : DEFAULT_SAMPLE_SIZE
41
47
  steps = options.has_key?(:steps) ? options[:steps].to_i : DEFAULT_STEPS
42
- seed = options.has_key?(:seed) ? [options[:seed]] : [rand(4294967295)]
48
+ seed = options.has_key?(:seed) ? [options[:seed].to_i] : [rand(4294967295)]
43
49
  transform = Gooseai::TransformType.new(
44
50
  diffusion: options.has_key?(:sampler) ? sampler_algorithms[options[:sampler]] : DEFAULT_SAMPLER_ALGORITHM,
45
51
  )
@@ -1,3 +1,3 @@
1
1
  module StabilitySDK
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stability_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosei Moriyama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-09 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc