SwaggerStableDiffusionWebui 1.0.394ffa7b0a7fff3ec484bcd084e673a8b301ccc8

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.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +150 -0
  4. data/Rakefile +10 -0
  5. data/SwaggerStableDiffusionWebui.gemspec +38 -0
  6. data/docs/BodyDetectControlnetDetectPost.md +26 -0
  7. data/docs/DefaultApi.md +3127 -0
  8. data/docs/Estimation.md +30 -0
  9. data/docs/HTTPValidationError.md +18 -0
  10. data/docs/LocationInner.md +15 -0
  11. data/docs/PredictBody.md +30 -0
  12. data/docs/ProgressRequest.md +20 -0
  13. data/docs/ProgressResponse.md +32 -0
  14. data/docs/QuicksettingsHint.md +20 -0
  15. data/docs/Request.md +15 -0
  16. data/docs/ResetBody.md +20 -0
  17. data/docs/ValidationError.md +22 -0
  18. data/git_push.sh +57 -0
  19. data/lib/SwaggerStableDiffusionWebui/api/default_api.rb +3027 -0
  20. data/lib/SwaggerStableDiffusionWebui/api_client.rb +391 -0
  21. data/lib/SwaggerStableDiffusionWebui/api_error.rb +58 -0
  22. data/lib/SwaggerStableDiffusionWebui/configuration.rb +288 -0
  23. data/lib/SwaggerStableDiffusionWebui/models/body_detect_controlnet_detect_post.rb +265 -0
  24. data/lib/SwaggerStableDiffusionWebui/models/estimation.rb +285 -0
  25. data/lib/SwaggerStableDiffusionWebui/models/http_validation_error.rb +221 -0
  26. data/lib/SwaggerStableDiffusionWebui/models/location_inner.rb +230 -0
  27. data/lib/SwaggerStableDiffusionWebui/models/predict_body.rb +283 -0
  28. data/lib/SwaggerStableDiffusionWebui/models/progress_request.rb +232 -0
  29. data/lib/SwaggerStableDiffusionWebui/models/progress_response.rb +301 -0
  30. data/lib/SwaggerStableDiffusionWebui/models/quicksettings_hint.rb +238 -0
  31. data/lib/SwaggerStableDiffusionWebui/models/request.rb +230 -0
  32. data/lib/SwaggerStableDiffusionWebui/models/reset_body.rb +238 -0
  33. data/lib/SwaggerStableDiffusionWebui/models/validation_error.rb +254 -0
  34. data/lib/SwaggerStableDiffusionWebui/version.rb +15 -0
  35. data/lib/SwaggerStableDiffusionWebui.rb +51 -0
  36. data/spec/api/default_api_spec.rb +574 -0
  37. data/spec/api_client_spec.rb +228 -0
  38. data/spec/configuration_spec.rb +42 -0
  39. data/spec/models/body_detect_controlnet_detect_post_spec.rb +58 -0
  40. data/spec/models/estimation_spec.rb +70 -0
  41. data/spec/models/http_validation_error_spec.rb +34 -0
  42. data/spec/models/location_inner_spec.rb +28 -0
  43. data/spec/models/predict_body_spec.rb +70 -0
  44. data/spec/models/progress_request_spec.rb +40 -0
  45. data/spec/models/progress_response_spec.rb +76 -0
  46. data/spec/models/quicksettings_hint_spec.rb +40 -0
  47. data/spec/models/request_spec.rb +28 -0
  48. data/spec/models/reset_body_spec.rb +40 -0
  49. data/spec/models/validation_error_spec.rb +46 -0
  50. data/spec/spec_helper.rb +111 -0
  51. metadata +147 -0
@@ -0,0 +1,288 @@
1
+ =begin
2
+ #FastAPI
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.6.0
10
+
11
+ =end
12
+
13
+ module SwaggerStableDiffusionWebui
14
+ class Configuration
15
+ # Defines url scheme
16
+ attr_accessor :scheme
17
+
18
+ # Defines url host
19
+ attr_accessor :host
20
+
21
+ # Defines url base path
22
+ attr_accessor :base_path
23
+
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
36
+ # Defines API keys used with API Key authentications.
37
+ #
38
+ # @return [Hash] key: parameter name, value: parameter value (API key)
39
+ #
40
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
+ # config.api_key['api_key'] = 'xxx'
42
+ attr_accessor :api_key
43
+
44
+ # Defines API key prefixes used with API Key authentications.
45
+ #
46
+ # @return [Hash] key: parameter name, value: API key prefix
47
+ #
48
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
+ # config.api_key_prefix['api_key'] = 'Token'
50
+ attr_accessor :api_key_prefix
51
+
52
+ # Defines the username used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :username
56
+
57
+ # Defines the password used with HTTP basic authentication.
58
+ #
59
+ # @return [String]
60
+ attr_accessor :password
61
+
62
+ # Defines the access token (Bearer) used with OAuth2.
63
+ attr_accessor :access_token
64
+
65
+ # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
66
+ # Overrides the access_token if set
67
+ # @return [Proc]
68
+ attr_accessor :access_token_getter
69
+
70
+ # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
71
+ # HTTP responses with return type `File` will be returned as a stream of binary data.
72
+ # Default to false.
73
+ attr_accessor :return_binary_data
74
+
75
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
76
+ # details will be logged with `logger.debug` (see the `logger` attribute).
77
+ # Default to false.
78
+ #
79
+ # @return [true, false]
80
+ attr_accessor :debugging
81
+
82
+ # Defines the logger used for debugging.
83
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
84
+ #
85
+ # @return [#debug]
86
+ attr_accessor :logger
87
+
88
+ # Defines the temporary folder to store downloaded files
89
+ # (for API endpoints that have file response).
90
+ # Default to use `Tempfile`.
91
+ #
92
+ # @return [String]
93
+ attr_accessor :temp_folder_path
94
+
95
+ # The time limit for HTTP request in seconds.
96
+ # Default to 0 (never times out).
97
+ attr_accessor :timeout
98
+
99
+ # Set this to false to skip client side validation in the operation.
100
+ # Default to true.
101
+ # @return [true, false]
102
+ attr_accessor :client_side_validation
103
+
104
+ ### TLS/SSL setting
105
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
106
+ # Default to true.
107
+ #
108
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
109
+ #
110
+ # @return [true, false]
111
+ attr_accessor :verify_ssl
112
+
113
+ ### TLS/SSL setting
114
+ # Set this to false to skip verifying SSL host name
115
+ # Default to true.
116
+ #
117
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
118
+ #
119
+ # @return [true, false]
120
+ attr_accessor :verify_ssl_host
121
+
122
+ ### TLS/SSL setting
123
+ # Set this to customize the certificate file to verify the peer.
124
+ #
125
+ # @return [String] the path to the certificate file
126
+ #
127
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
128
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
129
+ attr_accessor :ssl_ca_cert
130
+
131
+ ### TLS/SSL setting
132
+ # Client certificate file (for client certificate)
133
+ attr_accessor :cert_file
134
+
135
+ ### TLS/SSL setting
136
+ # Client private key file (for client certificate)
137
+ attr_accessor :key_file
138
+
139
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
140
+ # Default to nil.
141
+ #
142
+ # @see The params_encoding option of Ethon. Related source code:
143
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
144
+ attr_accessor :params_encoding
145
+
146
+
147
+ attr_accessor :inject_format
148
+
149
+ attr_accessor :force_ending_format
150
+
151
+ def initialize
152
+ @scheme = 'http'
153
+ @host = 'localhost'
154
+ @base_path = ''
155
+ @server_index = 0
156
+ @server_operation_index = {}
157
+ @server_variables = {}
158
+ @server_operation_variables = {}
159
+ @api_key = {}
160
+ @api_key_prefix = {}
161
+ @client_side_validation = true
162
+ @verify_ssl = true
163
+ @verify_ssl_host = true
164
+ @cert_file = nil
165
+ @key_file = nil
166
+ @timeout = 0
167
+ @params_encoding = nil
168
+ @debugging = false
169
+ @inject_format = false
170
+ @force_ending_format = false
171
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
172
+
173
+ yield(self) if block_given?
174
+ end
175
+
176
+ # The default Configuration object.
177
+ def self.default
178
+ @@default ||= Configuration.new
179
+ end
180
+
181
+ def configure
182
+ yield(self) if block_given?
183
+ end
184
+
185
+ def scheme=(scheme)
186
+ # remove :// from scheme
187
+ @scheme = scheme.sub(/:\/\//, '')
188
+ end
189
+
190
+ def host=(host)
191
+ # remove http(s):// and anything after a slash
192
+ @host = host.sub(/https?:\/\//, '').split('/').first
193
+ end
194
+
195
+ def base_path=(base_path)
196
+ # Add leading and trailing slashes to base_path
197
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
198
+ @base_path = '' if @base_path == '/'
199
+ end
200
+
201
+ # Returns base URL for specified operation based on server settings
202
+ def base_url(operation = nil)
203
+ index = server_operation_index[operation]
204
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
205
+
206
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
207
+ end
208
+
209
+ # Gets API key (with prefix if set).
210
+ # @param [String] param_name the parameter name of API key auth
211
+ def api_key_with_prefix(param_name, param_alias = nil)
212
+ key = @api_key[param_name]
213
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
214
+ if @api_key_prefix[param_name]
215
+ "#{@api_key_prefix[param_name]} #{key}"
216
+ else
217
+ key
218
+ end
219
+ end
220
+
221
+ # Gets access_token using access_token_getter or uses the static access_token
222
+ def access_token_with_refresh
223
+ return access_token if access_token_getter.nil?
224
+ access_token_getter.call
225
+ end
226
+
227
+ # Gets Basic Auth token string
228
+ def basic_auth_token
229
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
230
+ end
231
+
232
+ # Returns Auth Settings hash for api client.
233
+ def auth_settings
234
+ {
235
+ }
236
+ end
237
+
238
+ # Returns an array of Server setting
239
+ def server_settings
240
+ [
241
+ {
242
+ url: "",
243
+ description: "No description provided",
244
+ }
245
+ ]
246
+ end
247
+
248
+ def operation_server_settings
249
+ {
250
+ }
251
+ end
252
+
253
+ # Returns URL based on server settings
254
+ #
255
+ # @param index array index of the server settings
256
+ # @param variables hash of variable and the corresponding value
257
+ def server_url(index, variables = {}, servers = nil)
258
+ servers = server_settings if servers == nil
259
+
260
+ # check array index out of bound
261
+ if (index < 0 || index >= servers.size)
262
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
263
+ end
264
+
265
+ server = servers[index]
266
+ url = server[:url]
267
+
268
+ return url unless server.key? :variables
269
+
270
+ # go through variable and assign a value
271
+ server[:variables].each do |name, variable|
272
+ if variables.key?(name)
273
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
274
+ url.gsub! "{" + name.to_s + "}", variables[name]
275
+ else
276
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
277
+ end
278
+ else
279
+ # use default value
280
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
281
+ end
282
+ end
283
+
284
+ url
285
+ end
286
+
287
+ end
288
+ end
@@ -0,0 +1,265 @@
1
+ =begin
2
+ #FastAPI
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SwaggerStableDiffusionWebui
17
+ class BodyDetectControlnetDetectPost
18
+ attr_accessor :controlnet_module
19
+
20
+ attr_accessor :controlnet_input_images
21
+
22
+ attr_accessor :controlnet_processor_res
23
+
24
+ attr_accessor :controlnet_threshold_a
25
+
26
+ attr_accessor :controlnet_threshold_b
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'controlnet_module' => :'controlnet_module',
32
+ :'controlnet_input_images' => :'controlnet_input_images',
33
+ :'controlnet_processor_res' => :'controlnet_processor_res',
34
+ :'controlnet_threshold_a' => :'controlnet_threshold_a',
35
+ :'controlnet_threshold_b' => :'controlnet_threshold_b'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'controlnet_module' => :'String',
48
+ :'controlnet_input_images' => :'Array<String>',
49
+ :'controlnet_processor_res' => :'Integer',
50
+ :'controlnet_threshold_a' => :'Float',
51
+ :'controlnet_threshold_b' => :'Float'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerStableDiffusionWebui::BodyDetectControlnetDetectPost` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerStableDiffusionWebui::BodyDetectControlnetDetectPost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'controlnet_module')
77
+ self.controlnet_module = attributes[:'controlnet_module']
78
+ else
79
+ self.controlnet_module = 'none'
80
+ end
81
+
82
+ if attributes.key?(:'controlnet_input_images')
83
+ if (value = attributes[:'controlnet_input_images']).is_a?(Array)
84
+ self.controlnet_input_images = value
85
+ end
86
+ end
87
+
88
+ if attributes.key?(:'controlnet_processor_res')
89
+ self.controlnet_processor_res = attributes[:'controlnet_processor_res']
90
+ else
91
+ self.controlnet_processor_res = 512
92
+ end
93
+
94
+ if attributes.key?(:'controlnet_threshold_a')
95
+ self.controlnet_threshold_a = attributes[:'controlnet_threshold_a']
96
+ else
97
+ self.controlnet_threshold_a = 64
98
+ end
99
+
100
+ if attributes.key?(:'controlnet_threshold_b')
101
+ self.controlnet_threshold_b = attributes[:'controlnet_threshold_b']
102
+ else
103
+ self.controlnet_threshold_b = 64
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ controlnet_module == o.controlnet_module &&
126
+ controlnet_input_images == o.controlnet_input_images &&
127
+ controlnet_processor_res == o.controlnet_processor_res &&
128
+ controlnet_threshold_a == o.controlnet_threshold_a &&
129
+ controlnet_threshold_b == o.controlnet_threshold_b
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [controlnet_module, controlnet_input_images, controlnet_processor_res, controlnet_threshold_a, controlnet_threshold_b].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
159
+ self.send("#{key}=", nil)
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ # models (e.g. Pet) or oneOf
212
+ klass = SwaggerStableDiffusionWebui.const_get(type)
213
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end