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,232 @@
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 ProgressRequest
18
+ # id of the task to get progress for
19
+ attr_accessor :id_task
20
+
21
+ # id of last received last preview image
22
+ attr_accessor :id_live_preview
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id_task' => :'id_task',
28
+ :'id_live_preview' => :'id_live_preview'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'id_task' => :'String',
41
+ :'id_live_preview' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerStableDiffusionWebui::ProgressRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerStableDiffusionWebui::ProgressRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'id_task')
67
+ self.id_task = attributes[:'id_task']
68
+ end
69
+
70
+ if attributes.key?(:'id_live_preview')
71
+ self.id_live_preview = attributes[:'id_live_preview']
72
+ else
73
+ self.id_live_preview = -1
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ id_task == o.id_task &&
96
+ id_live_preview == o.id_live_preview
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [id_task, id_live_preview].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
126
+ self.send("#{key}=", nil)
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = SwaggerStableDiffusionWebui.const_get(type)
180
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -0,0 +1,301 @@
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 ProgressResponse
18
+ attr_accessor :active
19
+
20
+ attr_accessor :queued
21
+
22
+ attr_accessor :completed
23
+
24
+ # The progress with a range of 0 to 1
25
+ attr_accessor :progress
26
+
27
+ attr_accessor :eta
28
+
29
+ # Current live preview; a data: uri
30
+ attr_accessor :live_preview
31
+
32
+ # Send this together with next request to prevent receiving same image
33
+ attr_accessor :id_live_preview
34
+
35
+ # Info text used by WebUI.
36
+ attr_accessor :textinfo
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'active' => :'active',
42
+ :'queued' => :'queued',
43
+ :'completed' => :'completed',
44
+ :'progress' => :'progress',
45
+ :'eta' => :'eta',
46
+ :'live_preview' => :'live_preview',
47
+ :'id_live_preview' => :'id_live_preview',
48
+ :'textinfo' => :'textinfo'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'active' => :'Boolean',
61
+ :'queued' => :'Boolean',
62
+ :'completed' => :'Boolean',
63
+ :'progress' => :'Float',
64
+ :'eta' => :'Float',
65
+ :'live_preview' => :'String',
66
+ :'id_live_preview' => :'Integer',
67
+ :'textinfo' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerStableDiffusionWebui::ProgressResponse` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerStableDiffusionWebui::ProgressResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'active')
93
+ self.active = attributes[:'active']
94
+ end
95
+
96
+ if attributes.key?(:'queued')
97
+ self.queued = attributes[:'queued']
98
+ end
99
+
100
+ if attributes.key?(:'completed')
101
+ self.completed = attributes[:'completed']
102
+ end
103
+
104
+ if attributes.key?(:'progress')
105
+ self.progress = attributes[:'progress']
106
+ end
107
+
108
+ if attributes.key?(:'eta')
109
+ self.eta = attributes[:'eta']
110
+ end
111
+
112
+ if attributes.key?(:'live_preview')
113
+ self.live_preview = attributes[:'live_preview']
114
+ end
115
+
116
+ if attributes.key?(:'id_live_preview')
117
+ self.id_live_preview = attributes[:'id_live_preview']
118
+ end
119
+
120
+ if attributes.key?(:'textinfo')
121
+ self.textinfo = attributes[:'textinfo']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ invalid_properties = Array.new
129
+ if @active.nil?
130
+ invalid_properties.push('invalid value for "active", active cannot be nil.')
131
+ end
132
+
133
+ if @queued.nil?
134
+ invalid_properties.push('invalid value for "queued", queued cannot be nil.')
135
+ end
136
+
137
+ if @completed.nil?
138
+ invalid_properties.push('invalid value for "completed", completed cannot be nil.')
139
+ end
140
+
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ return false if @active.nil?
148
+ return false if @queued.nil?
149
+ return false if @completed.nil?
150
+ true
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ active == o.active &&
159
+ queued == o.queued &&
160
+ completed == o.completed &&
161
+ progress == o.progress &&
162
+ eta == o.eta &&
163
+ live_preview == o.live_preview &&
164
+ id_live_preview == o.id_live_preview &&
165
+ textinfo == o.textinfo
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [active, queued, completed, progress, eta, live_preview, id_live_preview, textinfo].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ new.build_from_hash(attributes)
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ attributes = attributes.transform_keys(&:to_sym)
193
+ self.class.openapi_types.each_pair do |key, type|
194
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
195
+ self.send("#{key}=", nil)
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
200
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ end
202
+ elsif !attributes[self.class.attribute_map[key]].nil?
203
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ end
205
+ end
206
+
207
+ self
208
+ end
209
+
210
+ # Deserializes the data based on type
211
+ # @param string type Data type
212
+ # @param string value Value to be deserialized
213
+ # @return [Object] Deserialized data
214
+ def _deserialize(type, value)
215
+ case type.to_sym
216
+ when :Time
217
+ Time.parse(value)
218
+ when :Date
219
+ Date.parse(value)
220
+ when :String
221
+ value.to_s
222
+ when :Integer
223
+ value.to_i
224
+ when :Float
225
+ value.to_f
226
+ when :Boolean
227
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
228
+ true
229
+ else
230
+ false
231
+ end
232
+ when :Object
233
+ # generic object (usually a Hash), return directly
234
+ value
235
+ when /\AArray<(?<inner_type>.+)>\z/
236
+ inner_type = Regexp.last_match[:inner_type]
237
+ value.map { |v| _deserialize(inner_type, v) }
238
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
239
+ k_type = Regexp.last_match[:k_type]
240
+ v_type = Regexp.last_match[:v_type]
241
+ {}.tap do |hash|
242
+ value.each do |k, v|
243
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
244
+ end
245
+ end
246
+ else # model
247
+ # models (e.g. Pet) or oneOf
248
+ klass = SwaggerStableDiffusionWebui.const_get(type)
249
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ # Outputs non-array value in the form of hash
282
+ # For object, use to_hash. Otherwise, just return the value
283
+ # @param [Object] value Any valid value
284
+ # @return [Hash] Returns the value in the form of hash
285
+ def _to_hash(value)
286
+ if value.is_a?(Array)
287
+ value.compact.map { |v| _to_hash(v) }
288
+ elsif value.is_a?(Hash)
289
+ {}.tap do |hash|
290
+ value.each { |k, v| hash[k] = _to_hash(v) }
291
+ end
292
+ elsif value.respond_to? :to_hash
293
+ value.to_hash
294
+ else
295
+ value
296
+ end
297
+ end
298
+
299
+ end
300
+
301
+ end