Class: StableDiffusion::StableDiffusionProcessingTxt2Img

Inherits:
Object
  • Object
show all
Defined in:
lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StableDiffusionProcessingTxt2Img

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 240

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `StableDiffusion::StableDiffusionProcessingTxt2Img` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `StableDiffusion::StableDiffusionProcessingTxt2Img`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'prompt')
    self.prompt = attributes[:'prompt']
  else
    self.prompt = ''
  end

  if attributes.key?(:'negative_prompt')
    self.negative_prompt = attributes[:'negative_prompt']
  else
    self.negative_prompt = ''
  end

  if attributes.key?(:'styles')
    if (value = attributes[:'styles']).is_a?(Array)
      self.styles = value
    end
  end

  if attributes.key?(:'seed')
    self.seed = attributes[:'seed']
  else
    self.seed = -1
  end

  if attributes.key?(:'subseed')
    self.subseed = attributes[:'subseed']
  else
    self.subseed = -1
  end

  if attributes.key?(:'subseed_strength')
    self.subseed_strength = attributes[:'subseed_strength']
  else
    self.subseed_strength = 0
  end

  if attributes.key?(:'seed_resize_from_h')
    self.seed_resize_from_h = attributes[:'seed_resize_from_h']
  else
    self.seed_resize_from_h = -1
  end

  if attributes.key?(:'seed_resize_from_w')
    self.seed_resize_from_w = attributes[:'seed_resize_from_w']
  else
    self.seed_resize_from_w = -1
  end

  if attributes.key?(:'sampler_name')
    self.sampler_name = attributes[:'sampler_name']
  end

  if attributes.key?(:'batch_size')
    self.batch_size = attributes[:'batch_size']
  else
    self.batch_size = 1
  end

  if attributes.key?(:'n_iter')
    self.n_iter = attributes[:'n_iter']
  else
    self.n_iter = 1
  end

  if attributes.key?(:'steps')
    self.steps = attributes[:'steps']
  else
    self.steps = 50
  end

  if attributes.key?(:'cfg_scale')
    self.cfg_scale = attributes[:'cfg_scale']
  else
    self.cfg_scale = 7.0
  end

  if attributes.key?(:'width')
    self.width = attributes[:'width']
  else
    self.width = 512
  end

  if attributes.key?(:'height')
    self.height = attributes[:'height']
  else
    self.height = 512
  end

  if attributes.key?(:'restore_faces')
    self.restore_faces = attributes[:'restore_faces']
  end

  if attributes.key?(:'tiling')
    self.tiling = attributes[:'tiling']
  end

  if attributes.key?(:'do_not_save_samples')
    self.do_not_save_samples = attributes[:'do_not_save_samples']
  else
    self.do_not_save_samples = false
  end

  if attributes.key?(:'do_not_save_grid')
    self.do_not_save_grid = attributes[:'do_not_save_grid']
  else
    self.do_not_save_grid = false
  end

  if attributes.key?(:'eta')
    self.eta = attributes[:'eta']
  end

  if attributes.key?(:'denoising_strength')
    self.denoising_strength = attributes[:'denoising_strength']
  end

  if attributes.key?(:'s_min_uncond')
    self.s_min_uncond = attributes[:'s_min_uncond']
  end

  if attributes.key?(:'s_churn')
    self.s_churn = attributes[:'s_churn']
  end

  if attributes.key?(:'s_tmax')
    self.s_tmax = attributes[:'s_tmax']
  end

  if attributes.key?(:'s_tmin')
    self.s_tmin = attributes[:'s_tmin']
  end

  if attributes.key?(:'s_noise')
    self.s_noise = attributes[:'s_noise']
  end

  if attributes.key?(:'override_settings')
    self.override_settings = attributes[:'override_settings']
  end

  if attributes.key?(:'override_settings_restore_afterwards')
    self.override_settings_restore_afterwards = attributes[:'override_settings_restore_afterwards']
  else
    self.override_settings_restore_afterwards = true
  end

  if attributes.key?(:'refiner_checkpoint')
    self.refiner_checkpoint = attributes[:'refiner_checkpoint']
  end

  if attributes.key?(:'refiner_switch_at')
    self.refiner_switch_at = attributes[:'refiner_switch_at']
  end

  if attributes.key?(:'disable_extra_networks')
    self.disable_extra_networks = attributes[:'disable_extra_networks']
  else
    self.disable_extra_networks = false
  end

  if attributes.key?(:'comments')
    self.comments = attributes[:'comments']
  end

  if attributes.key?(:'enable_hr')
    self.enable_hr = attributes[:'enable_hr']
  else
    self.enable_hr = false
  end

  if attributes.key?(:'firstphase_width')
    self.firstphase_width = attributes[:'firstphase_width']
  else
    self.firstphase_width = 0
  end

  if attributes.key?(:'firstphase_height')
    self.firstphase_height = attributes[:'firstphase_height']
  else
    self.firstphase_height = 0
  end

  if attributes.key?(:'hr_scale')
    self.hr_scale = attributes[:'hr_scale']
  else
    self.hr_scale = 2.0
  end

  if attributes.key?(:'hr_upscaler')
    self.hr_upscaler = attributes[:'hr_upscaler']
  end

  if attributes.key?(:'hr_second_pass_steps')
    self.hr_second_pass_steps = attributes[:'hr_second_pass_steps']
  else
    self.hr_second_pass_steps = 0
  end

  if attributes.key?(:'hr_resize_x')
    self.hr_resize_x = attributes[:'hr_resize_x']
  else
    self.hr_resize_x = 0
  end

  if attributes.key?(:'hr_resize_y')
    self.hr_resize_y = attributes[:'hr_resize_y']
  else
    self.hr_resize_y = 0
  end

  if attributes.key?(:'hr_checkpoint_name')
    self.hr_checkpoint_name = attributes[:'hr_checkpoint_name']
  end

  if attributes.key?(:'hr_sampler_name')
    self.hr_sampler_name = attributes[:'hr_sampler_name']
  end

  if attributes.key?(:'hr_prompt')
    self.hr_prompt = attributes[:'hr_prompt']
  else
    self.hr_prompt = ''
  end

  if attributes.key?(:'hr_negative_prompt')
    self.hr_negative_prompt = attributes[:'hr_negative_prompt']
  else
    self.hr_negative_prompt = ''
  end

  if attributes.key?(:'sampler_index')
    self.sampler_index = attributes[:'sampler_index']
  else
    self.sampler_index = 'Euler'
  end

  if attributes.key?(:'script_name')
    self.script_name = attributes[:'script_name']
  end

  if attributes.key?(:'script_args')
    if (value = attributes[:'script_args']).is_a?(Array)
      self.script_args = value
    end
  end

  if attributes.key?(:'send_images')
    self.send_images = attributes[:'send_images']
  else
    self.send_images = true
  end

  if attributes.key?(:'save_images')
    self.save_images = attributes[:'save_images']
  else
    self.save_images = false
  end

  if attributes.key?(:'task_id')
    self.task_id = attributes[:'task_id']
  end

  if attributes.key?(:'alwayson_scripts')
    self.alwayson_scripts = attributes[:'alwayson_scripts']
  end
end

Instance Attribute Details

#alwayson_scriptsObject

Returns the value of attribute alwayson_scripts.



116
117
118
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 116

def alwayson_scripts
  @alwayson_scripts
end

#batch_sizeObject

Returns the value of attribute batch_size.



34
35
36
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 34

def batch_size
  @batch_size
end

#cfg_scaleObject

Returns the value of attribute cfg_scale.



40
41
42
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 40

def cfg_scale
  @cfg_scale
end

#commentsObject

Returns the value of attribute comments.



78
79
80
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 78

def comments
  @comments
end

#denoising_strengthObject

Returns the value of attribute denoising_strength.



56
57
58
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 56

def denoising_strength
  @denoising_strength
end

#disable_extra_networksObject

Returns the value of attribute disable_extra_networks.



76
77
78
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 76

def disable_extra_networks
  @disable_extra_networks
end

#do_not_save_gridObject

Returns the value of attribute do_not_save_grid.



52
53
54
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 52

def do_not_save_grid
  @do_not_save_grid
end

#do_not_save_samplesObject

Returns the value of attribute do_not_save_samples.



50
51
52
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 50

def do_not_save_samples
  @do_not_save_samples
end

#enable_hrObject

Returns the value of attribute enable_hr.



80
81
82
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 80

def enable_hr
  @enable_hr
end

#etaObject

Returns the value of attribute eta.



54
55
56
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 54

def eta
  @eta
end

#firstphase_heightObject

Returns the value of attribute firstphase_height.



84
85
86
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 84

def firstphase_height
  @firstphase_height
end

#firstphase_widthObject

Returns the value of attribute firstphase_width.



82
83
84
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 82

def firstphase_width
  @firstphase_width
end

#heightObject

Returns the value of attribute height.



44
45
46
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 44

def height
  @height
end

#hr_checkpoint_nameObject

Returns the value of attribute hr_checkpoint_name.



96
97
98
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 96

def hr_checkpoint_name
  @hr_checkpoint_name
end

#hr_negative_promptObject

Returns the value of attribute hr_negative_prompt.



102
103
104
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 102

def hr_negative_prompt
  @hr_negative_prompt
end

#hr_promptObject

Returns the value of attribute hr_prompt.



100
101
102
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 100

def hr_prompt
  @hr_prompt
end

#hr_resize_xObject

Returns the value of attribute hr_resize_x.



92
93
94
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 92

def hr_resize_x
  @hr_resize_x
end

#hr_resize_yObject

Returns the value of attribute hr_resize_y.



94
95
96
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 94

def hr_resize_y
  @hr_resize_y
end

#hr_sampler_nameObject

Returns the value of attribute hr_sampler_name.



98
99
100
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 98

def hr_sampler_name
  @hr_sampler_name
end

#hr_scaleObject

Returns the value of attribute hr_scale.



86
87
88
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 86

def hr_scale
  @hr_scale
end

#hr_second_pass_stepsObject

Returns the value of attribute hr_second_pass_steps.



90
91
92
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 90

def hr_second_pass_steps
  @hr_second_pass_steps
end

#hr_upscalerObject

Returns the value of attribute hr_upscaler.



88
89
90
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 88

def hr_upscaler
  @hr_upscaler
end

#n_iterObject

Returns the value of attribute n_iter.



36
37
38
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 36

def n_iter
  @n_iter
end

#negative_promptObject

Returns the value of attribute negative_prompt.



18
19
20
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 18

def negative_prompt
  @negative_prompt
end

#override_settingsObject

Returns the value of attribute override_settings.



68
69
70
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 68

def override_settings
  @override_settings
end

#override_settings_restore_afterwardsObject

Returns the value of attribute override_settings_restore_afterwards.



70
71
72
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 70

def override_settings_restore_afterwards
  @override_settings_restore_afterwards
end

#promptObject

Returns the value of attribute prompt.



16
17
18
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 16

def prompt
  @prompt
end

#refiner_checkpointObject

Returns the value of attribute refiner_checkpoint.



72
73
74
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 72

def refiner_checkpoint
  @refiner_checkpoint
end

#refiner_switch_atObject

Returns the value of attribute refiner_switch_at.



74
75
76
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 74

def refiner_switch_at
  @refiner_switch_at
end

#restore_facesObject

Returns the value of attribute restore_faces.



46
47
48
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 46

def restore_faces
  @restore_faces
end

#s_churnObject

Returns the value of attribute s_churn.



60
61
62
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 60

def s_churn
  @s_churn
end

#s_min_uncondObject

Returns the value of attribute s_min_uncond.



58
59
60
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 58

def s_min_uncond
  @s_min_uncond
end

#s_noiseObject

Returns the value of attribute s_noise.



66
67
68
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 66

def s_noise
  @s_noise
end

#s_tmaxObject

Returns the value of attribute s_tmax.



62
63
64
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 62

def s_tmax
  @s_tmax
end

#s_tminObject

Returns the value of attribute s_tmin.



64
65
66
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 64

def s_tmin
  @s_tmin
end

#sampler_indexObject

Returns the value of attribute sampler_index.



104
105
106
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 104

def sampler_index
  @sampler_index
end

#sampler_nameObject

Returns the value of attribute sampler_name.



32
33
34
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 32

def sampler_name
  @sampler_name
end

#save_imagesObject

Returns the value of attribute save_images.



112
113
114
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 112

def save_images
  @save_images
end

#script_argsObject

Returns the value of attribute script_args.



108
109
110
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 108

def script_args
  @script_args
end

#script_nameObject

Returns the value of attribute script_name.



106
107
108
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 106

def script_name
  @script_name
end

#seedObject

Returns the value of attribute seed.



22
23
24
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 22

def seed
  @seed
end

#seed_resize_from_hObject

Returns the value of attribute seed_resize_from_h.



28
29
30
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 28

def seed_resize_from_h
  @seed_resize_from_h
end

#seed_resize_from_wObject

Returns the value of attribute seed_resize_from_w.



30
31
32
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 30

def seed_resize_from_w
  @seed_resize_from_w
end

#send_imagesObject

Returns the value of attribute send_images.



110
111
112
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 110

def send_images
  @send_images
end

#stepsObject

Returns the value of attribute steps.



38
39
40
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 38

def steps
  @steps
end

#stylesObject

Returns the value of attribute styles.



20
21
22
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 20

def styles
  @styles
end

#subseedObject

Returns the value of attribute subseed.



24
25
26
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 24

def subseed
  @subseed
end

#subseed_strengthObject

Returns the value of attribute subseed_strength.



26
27
28
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 26

def subseed_strength
  @subseed_strength
end

#task_idObject

Returns the value of attribute task_id.



114
115
116
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 114

def task_id
  @task_id
end

#tilingObject

Returns the value of attribute tiling.



48
49
50
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 48

def tiling
  @tiling
end

#widthObject

Returns the value of attribute width.



42
43
44
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 42

def width
  @width
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 119

def self.attribute_map
  {
    :'prompt' => :'prompt',
    :'negative_prompt' => :'negative_prompt',
    :'styles' => :'styles',
    :'seed' => :'seed',
    :'subseed' => :'subseed',
    :'subseed_strength' => :'subseed_strength',
    :'seed_resize_from_h' => :'seed_resize_from_h',
    :'seed_resize_from_w' => :'seed_resize_from_w',
    :'sampler_name' => :'sampler_name',
    :'batch_size' => :'batch_size',
    :'n_iter' => :'n_iter',
    :'steps' => :'steps',
    :'cfg_scale' => :'cfg_scale',
    :'width' => :'width',
    :'height' => :'height',
    :'restore_faces' => :'restore_faces',
    :'tiling' => :'tiling',
    :'do_not_save_samples' => :'do_not_save_samples',
    :'do_not_save_grid' => :'do_not_save_grid',
    :'eta' => :'eta',
    :'denoising_strength' => :'denoising_strength',
    :'s_min_uncond' => :'s_min_uncond',
    :'s_churn' => :'s_churn',
    :'s_tmax' => :'s_tmax',
    :'s_tmin' => :'s_tmin',
    :'s_noise' => :'s_noise',
    :'override_settings' => :'override_settings',
    :'override_settings_restore_afterwards' => :'override_settings_restore_afterwards',
    :'refiner_checkpoint' => :'refiner_checkpoint',
    :'refiner_switch_at' => :'refiner_switch_at',
    :'disable_extra_networks' => :'disable_extra_networks',
    :'comments' => :'comments',
    :'enable_hr' => :'enable_hr',
    :'firstphase_width' => :'firstphase_width',
    :'firstphase_height' => :'firstphase_height',
    :'hr_scale' => :'hr_scale',
    :'hr_upscaler' => :'hr_upscaler',
    :'hr_second_pass_steps' => :'hr_second_pass_steps',
    :'hr_resize_x' => :'hr_resize_x',
    :'hr_resize_y' => :'hr_resize_y',
    :'hr_checkpoint_name' => :'hr_checkpoint_name',
    :'hr_sampler_name' => :'hr_sampler_name',
    :'hr_prompt' => :'hr_prompt',
    :'hr_negative_prompt' => :'hr_negative_prompt',
    :'sampler_index' => :'sampler_index',
    :'script_name' => :'script_name',
    :'script_args' => :'script_args',
    :'send_images' => :'send_images',
    :'save_images' => :'save_images',
    :'task_id' => :'task_id',
    :'alwayson_scripts' => :'alwayson_scripts'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



606
607
608
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 606

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



233
234
235
236
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 233

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 176

def self.openapi_types
  {
    :'prompt' => :'Object',
    :'negative_prompt' => :'Object',
    :'styles' => :'Object',
    :'seed' => :'Object',
    :'subseed' => :'Object',
    :'subseed_strength' => :'Object',
    :'seed_resize_from_h' => :'Object',
    :'seed_resize_from_w' => :'Object',
    :'sampler_name' => :'Object',
    :'batch_size' => :'Object',
    :'n_iter' => :'Object',
    :'steps' => :'Object',
    :'cfg_scale' => :'Object',
    :'width' => :'Object',
    :'height' => :'Object',
    :'restore_faces' => :'Object',
    :'tiling' => :'Object',
    :'do_not_save_samples' => :'Object',
    :'do_not_save_grid' => :'Object',
    :'eta' => :'Object',
    :'denoising_strength' => :'Object',
    :'s_min_uncond' => :'Object',
    :'s_churn' => :'Object',
    :'s_tmax' => :'Object',
    :'s_tmin' => :'Object',
    :'s_noise' => :'Object',
    :'override_settings' => :'Object',
    :'override_settings_restore_afterwards' => :'Object',
    :'refiner_checkpoint' => :'Object',
    :'refiner_switch_at' => :'Object',
    :'disable_extra_networks' => :'Object',
    :'comments' => :'Object',
    :'enable_hr' => :'Object',
    :'firstphase_width' => :'Object',
    :'firstphase_height' => :'Object',
    :'hr_scale' => :'Object',
    :'hr_upscaler' => :'Object',
    :'hr_second_pass_steps' => :'Object',
    :'hr_resize_x' => :'Object',
    :'hr_resize_y' => :'Object',
    :'hr_checkpoint_name' => :'Object',
    :'hr_sampler_name' => :'Object',
    :'hr_prompt' => :'Object',
    :'hr_negative_prompt' => :'Object',
    :'sampler_index' => :'Object',
    :'script_name' => :'Object',
    :'script_args' => :'Object',
    :'send_images' => :'Object',
    :'save_images' => :'Object',
    :'task_id' => :'Object',
    :'alwayson_scripts' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 535

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      prompt == o.prompt &&
      negative_prompt == o.negative_prompt &&
      styles == o.styles &&
      seed == o.seed &&
      subseed == o.subseed &&
      subseed_strength == o.subseed_strength &&
      seed_resize_from_h == o.seed_resize_from_h &&
      seed_resize_from_w == o.seed_resize_from_w &&
      sampler_name == o.sampler_name &&
      batch_size == o.batch_size &&
      n_iter == o.n_iter &&
      steps == o.steps &&
      cfg_scale == o.cfg_scale &&
      width == o.width &&
      height == o.height &&
      restore_faces == o.restore_faces &&
      tiling == o.tiling &&
      do_not_save_samples == o.do_not_save_samples &&
      do_not_save_grid == o.do_not_save_grid &&
      eta == o.eta &&
      denoising_strength == o.denoising_strength &&
      s_min_uncond == o.s_min_uncond &&
      s_churn == o.s_churn &&
      s_tmax == o.s_tmax &&
      s_tmin == o.s_tmin &&
      s_noise == o.s_noise &&
      override_settings == o.override_settings &&
      override_settings_restore_afterwards == o.override_settings_restore_afterwards &&
      refiner_checkpoint == o.refiner_checkpoint &&
      refiner_switch_at == o.refiner_switch_at &&
      disable_extra_networks == o.disable_extra_networks &&
      comments == o.comments &&
      enable_hr == o.enable_hr &&
      firstphase_width == o.firstphase_width &&
      firstphase_height == o.firstphase_height &&
      hr_scale == o.hr_scale &&
      hr_upscaler == o.hr_upscaler &&
      hr_second_pass_steps == o.hr_second_pass_steps &&
      hr_resize_x == o.hr_resize_x &&
      hr_resize_y == o.hr_resize_y &&
      hr_checkpoint_name == o.hr_checkpoint_name &&
      hr_sampler_name == o.hr_sampler_name &&
      hr_prompt == o.hr_prompt &&
      hr_negative_prompt == o.hr_negative_prompt &&
      sampler_index == o.sampler_index &&
      script_name == o.script_name &&
      script_args == o.script_args &&
      send_images == o.send_images &&
      save_images == o.save_images &&
      task_id == o.task_id &&
      alwayson_scripts == o.alwayson_scripts
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 636

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    StableDiffusion.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



705
706
707
708
709
710
711
712
713
714
715
716
717
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 705

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 613

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


593
594
595
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 593

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



599
600
601
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 599

def hash
  [prompt, negative_prompt, styles, seed, subseed, subseed_strength, seed_resize_from_h, seed_resize_from_w, sampler_name, batch_size, n_iter, steps, cfg_scale, width, height, restore_faces, tiling, do_not_save_samples, do_not_save_grid, eta, denoising_strength, s_min_uncond, s_churn, s_tmax, s_tmin, s_noise, override_settings, override_settings_restore_afterwards, refiner_checkpoint, refiner_switch_at, disable_extra_networks, comments, enable_hr, firstphase_width, firstphase_height, hr_scale, hr_upscaler, hr_second_pass_steps, hr_resize_x, hr_resize_y, hr_checkpoint_name, hr_sampler_name, hr_prompt, hr_negative_prompt, sampler_index, script_name, script_args, send_images, save_images, task_id, alwayson_scripts].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



522
523
524
525
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 522

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



681
682
683
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 681

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 687

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



675
676
677
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 675

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



529
530
531
# File 'lib/stable_diffusion/models/stable_diffusion_processing_txt2_img.rb', line 529

def valid?
  true
end