stability_sdk 0.2.12 → 0.3.1

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: d5aac33cb8d504aab26b515dc2fa6bd9d76c70829a0aa706eabc6be39043b143
4
- data.tar.gz: ca6a3cd1cd24763a9f9427132a4e8fde4c688d9bc9d3409ef921139fa62fa232
3
+ metadata.gz: eb4bcef5f20a0b7147814c3c3cd90df2b39a54dc162d207a6c7f91141888cdb3
4
+ data.tar.gz: 77aa1b30334169b9437ca8798334fb081b7ff1c4305d09c69128bc5348768ba6
5
5
  SHA512:
6
- metadata.gz: 95b76f6caf8e5a32af792cc0d284f81b76c7e38c682b24a5fc91204b3373096a47a98ab1ee6f0e32cbbd2039ad6b57c920c262661cda221c54eac529bd54e51a
7
- data.tar.gz: f196c8b879b36e69c84d40c2528fd9fbf7f07e1ae6eec9c4a996a66a8a73841ea50d73d8ca941b7813ca9d5fbada94140143619bdb841de4ce9f71316af1303e
6
+ metadata.gz: d82e9bd6fdc0cec8b74e6ef774a82bd0d922327d99adae5b8ecccb55e7c7b3111e59d99c46fba8576aacbfd65fd4b3ea0c69a6e691b4b9967319a67b8a778b3f
7
+ data.tar.gz: 11ea3112c72f6a4a76fa6cd21457bf3808fddfa6956ffa170e7eebfdbdaca58f2e91dc68accb813b91bda6d82874c73b5d3fc4cf59025acdf96b969f98305904
data/README.md CHANGED
@@ -107,23 +107,29 @@ client.generate(prompt, options) do |answer|
107
107
  end
108
108
  ```
109
109
 
110
- ### [Unstable] Dashboard API
111
-
112
- **This feature is in a very early stage of development.**
110
+ ### Dashboard API
113
111
 
114
112
  Dashboard API is a way to interact with DreamStudio Web UIs, such as getting user info, payment info, etc.
115
113
 
116
- Currently, there is no canonical way to get the API key for the Dashboard API. You can retrieve the key by logging in to the [DreamStudio Web page](https://beta.dreamstudio.ai/dream) and inspect request the authorization header with Chrome Developer Tool. Please be aware that how to refresh the key or an expiration period is unknown. See also https://github.com/Stability-AI/stability-sdk/issues/23
114
+ Currently, the API key is only allowed as read-only. And this client supports only GetMe and GetOrganization actions. See also https://github.com/Stability-AI/stability-sdk/issues/23
117
115
 
118
116
  ```sh
119
117
  # get user info
120
- STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client-unstable get_me
118
+ STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client get_me
121
119
 
122
120
  # get organization info
123
- STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client-unstable get_organization
121
+ STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client get_organization
124
122
 
125
123
  # i.e, get remaining balance
126
- STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client-unstable get_organization | jq .paymentInfo.balance
124
+ STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client get_organization | jq .paymentInfo.balance
125
+ ```
126
+
127
+ ```ruby
128
+ require "stability_sdk"
129
+
130
+ client = StabilitySDK::DashboardClient.new(api_key: "your api key")
131
+ res = client.get_organization
132
+ p res.payment_info.balance # prints a remaining balance
127
133
  ```
128
134
 
129
135
  ## Development
@@ -142,9 +148,13 @@ cd api-interfaces
142
148
 
143
149
  # checkout some branch/commit you need
144
150
  git fetch
145
- git reset --hard origin/some_branch
151
+ git checkout origin/some_branch # or `git reset --hard origin/some_branch`
146
152
 
147
153
  cd ..
154
+ git add
155
+
156
+ # if you need to follow the updates of submodules inside the Stability-AI/api-interfaces, you have to update submodules recursively
157
+ git submodule update --init --recursive
148
158
  ```
149
159
 
150
160
  - build
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ task :default => :test
11
11
 
12
12
  desc "Parse proto file and generate output"
13
13
  task :protoc do
14
- sh "grpc_tools_ruby_protoc -I api-interfaces/src/proto/ --ruby_out=lib --grpc_out=lib api-interfaces/src/proto/generation.proto"
14
+ sh "grpc_tools_ruby_protoc -I api-interfaces/src/proto/ -I api-interfaces/src/tensorizer/proto/ --ruby_out=lib --grpc_out=lib api-interfaces/src/proto/generation.proto"
15
15
  end
16
16
 
17
17
  desc "Compile a dashboard proto file"
@@ -33,7 +33,7 @@ class CLI < Thor
33
33
  api_key = ENV["STABILITY_SDK_DASHBOARD_API_KEY"] if ENV["STABILITY_SDK_DASHBOARD_API_KEY"]
34
34
  raise StabilitySDK::InsufficientParameter, "api key is required" if api_key.nil?
35
35
 
36
- return StabilitySDK::Unstable::DashboardClient.new(api_key: api_key)
36
+ return StabilitySDK::DashboardClient.new(api_key: api_key)
37
37
  end
38
38
  end
39
39
 
data/lib/generation_pb.rb CHANGED
@@ -3,6 +3,8 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
+ require 'tensors_pb'
7
+
6
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
9
  add_file("generation.proto", :syntax => :proto3) do
8
10
  add_message "gooseai.Token" do
@@ -28,6 +30,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
30
  optional :text, :string, 6
29
31
  optional :tokens, :message, 7, "gooseai.Tokens"
30
32
  optional :classifier, :message, 11, "gooseai.ClassifierParameters"
33
+ optional :tensor, :message, 14, "tensors.Tensor"
31
34
  end
32
35
  end
33
36
  add_message "gooseai.PromptParameters" do
@@ -48,6 +51,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
48
51
  proto3_optional :latent_channels, :uint64, 3
49
52
  proto3_optional :downsampling_factor, :uint64, 4
50
53
  proto3_optional :cfg_scale, :float, 5
54
+ proto3_optional :init_noise_scale, :float, 6
51
55
  end
52
56
  add_message "gooseai.ConditionerParameters" do
53
57
  proto3_optional :vector_adjust_prior, :string, 1
@@ -108,6 +112,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
108
112
  proto3_optional :steps, :uint64, 5
109
113
  proto3_optional :transform, :message, 6, "gooseai.TransformType"
110
114
  repeated :parameters, :message, 7, "gooseai.StepParameter"
115
+ proto3_optional :masked_area_init, :enum, 8, "gooseai.MaskedAreaInit"
116
+ proto3_optional :weight_method, :enum, 9, "gooseai.WeightMethod"
111
117
  end
112
118
  add_message "gooseai.ClassifierConcept" do
113
119
  optional :concept, :string, 1
@@ -186,6 +192,17 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
186
192
  value :ARTIFACT_EMBEDDING, 5
187
193
  value :ARTIFACT_CLASSIFICATIONS, 6
188
194
  value :ARTIFACT_MASK, 7
195
+ value :ARTIFACT_LATENT, 8
196
+ value :ARTIFACT_TENSOR, 9
197
+ end
198
+ add_enum "gooseai.MaskedAreaInit" do
199
+ value :MASKED_AREA_INIT_ZERO, 0
200
+ value :MASKED_AREA_INIT_RANDOM, 1
201
+ value :MASKED_AREA_INIT_ORIGINAL, 2
202
+ end
203
+ add_enum "gooseai.WeightMethod" do
204
+ value :TEXT_ENCODER, 0
205
+ value :CROSS_ATTENTION, 1
189
206
  end
190
207
  add_enum "gooseai.DiffusionSampler" do
191
208
  value :SAMPLER_DDIM, 0
@@ -196,6 +213,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
196
213
  value :SAMPLER_K_DPM_2, 5
197
214
  value :SAMPLER_K_DPM_2_ANCESTRAL, 6
198
215
  value :SAMPLER_K_LMS, 7
216
+ value :SAMPLER_K_DPMPP_2S_ANCESTRAL, 8
217
+ value :SAMPLER_K_DPMPP_2M, 9
199
218
  end
200
219
  add_enum "gooseai.Upscaler" do
201
220
  value :UPSCALER_RGB, 0
@@ -278,6 +297,8 @@ module Gooseai
278
297
  ChainRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.ChainRequest").msgclass
279
298
  FinishReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.FinishReason").enummodule
280
299
  ArtifactType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.ArtifactType").enummodule
300
+ MaskedAreaInit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.MaskedAreaInit").enummodule
301
+ WeightMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.WeightMethod").enummodule
281
302
  DiffusionSampler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.DiffusionSampler").enummodule
282
303
  Upscaler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.Upscaler").enummodule
283
304
  GuidancePreset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gooseai.GuidancePreset").enummodule
@@ -1,7 +1,7 @@
1
1
  require "grpc"
2
2
  require "dashboard_services_pb"
3
3
 
4
- module StabilitySDK::Unstable
4
+ module StabilitySDK
5
5
  class DashboardClient
6
6
  DEFAULT_API_HOST = "grpc.stability.ai:443"
7
7
 
@@ -1,3 +1,3 @@
1
1
  module StabilitySDK
2
- VERSION = "0.2.12"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/stability_sdk.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "stability_sdk/version"
2
2
  require "stability_sdk/client"
3
3
  require "stability_sdk/cli"
4
- require "stability_sdk/unstable/dashboard_client"
4
+ require "stability_sdk/dashboard_client"
5
5
 
6
6
  module StabilitySDK
7
7
  class Error < StandardError; 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.12
4
+ version: 0.3.1
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-10-31 00:00:00.000000000 Z
11
+ date: 2022-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc
@@ -92,7 +92,7 @@ email:
92
92
  - cou929@gmail.com
93
93
  executables:
94
94
  - stability-client
95
- - stability-dashboard-client-unstable
95
+ - stability-dashboard-client
96
96
  extensions: []
97
97
  extra_rdoc_files: []
98
98
  files:
@@ -106,7 +106,7 @@ files:
106
106
  - bin/console
107
107
  - bin/setup
108
108
  - exe/stability-client
109
- - exe/stability-dashboard-client-unstable
109
+ - exe/stability-dashboard-client
110
110
  - lib/dashboard_pb.rb
111
111
  - lib/dashboard_services_pb.rb
112
112
  - lib/generation_pb.rb
@@ -114,7 +114,7 @@ files:
114
114
  - lib/stability_sdk.rb
115
115
  - lib/stability_sdk/cli.rb
116
116
  - lib/stability_sdk/client.rb
117
- - lib/stability_sdk/unstable/dashboard_client.rb
117
+ - lib/stability_sdk/dashboard_client.rb
118
118
  - lib/stability_sdk/version.rb
119
119
  - stability_sdk.gemspec
120
120
  homepage: https://github.com/cou929/stability-sdk-ruby