Class: StableDiffusion::StableDiffusionProcessingImg2Img

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StableDiffusionProcessingImg2Img

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
519
520
521
522
523
524
525
526
527
528
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 244

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `StableDiffusion::StableDiffusionProcessingImg2Img` 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::StableDiffusionProcessingImg2Img`. 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']
  else
    self.denoising_strength = 0.75
  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?(:'init_images')
    if (value = attributes[:'init_images']).is_a?(Array)
      self.init_images = value
    end
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'include_init_images')
    self.include_init_images = attributes[:'include_init_images']
  else
    self.include_init_images = false
  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?(:'alwayson_scripts')
    self.alwayson_scripts = attributes[:'alwayson_scripts']
  end
end

Instance Attribute Details

#alwayson_scriptsObject

Returns the value of attribute alwayson_scripts.



118
119
120
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 118

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_img2_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_img2_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_img2_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_img2_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_img2_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_img2_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_img2_img.rb', line 50

def do_not_save_samples
  @do_not_save_samples
end

#etaObject

Returns the value of attribute eta.



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

def eta
  @eta
end

#heightObject

Returns the value of attribute height.



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

def height
  @height
end

#image_cfg_scaleObject

Returns the value of attribute image_cfg_scale.



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

def image_cfg_scale
  @image_cfg_scale
end

#include_init_imagesObject

Returns the value of attribute include_init_images.



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

def include_init_images
  @include_init_images
end

#init_imagesObject

Returns the value of attribute init_images.



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

def init_images
  @init_images
end

#initial_noise_multiplierObject

Returns the value of attribute initial_noise_multiplier.



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

def initial_noise_multiplier
  @initial_noise_multiplier
end

#inpaint_full_resObject

Returns the value of attribute inpaint_full_res.



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

def inpaint_full_res
  @inpaint_full_res
end

#inpaint_full_res_paddingObject

Returns the value of attribute inpaint_full_res_padding.



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

def inpaint_full_res_padding
  @inpaint_full_res_padding
end

#inpainting_fillObject

Returns the value of attribute inpainting_fill.



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

def inpainting_fill
  @inpainting_fill
end

#inpainting_mask_invertObject

Returns the value of attribute inpainting_mask_invert.



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

def inpainting_mask_invert
  @inpainting_mask_invert
end

#latent_maskObject

Returns the value of attribute latent_mask.



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

def latent_mask
  @latent_mask
end

#maskObject

Returns the value of attribute mask.



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

def mask
  @mask
end

#mask_blurObject

Returns the value of attribute mask_blur.



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

def mask_blur
  @mask_blur
end

#mask_blur_xObject

Returns the value of attribute mask_blur_x.



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

def mask_blur_x
  @mask_blur_x
end

#mask_blur_yObject

Returns the value of attribute mask_blur_y.



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

def mask_blur_y
  @mask_blur_y
end

#n_iterObject

Returns the value of attribute n_iter.



36
37
38
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_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_img2_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_img2_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_img2_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_img2_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_img2_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_img2_img.rb', line 74

def refiner_switch_at
  @refiner_switch_at
end

#resize_modeObject

Returns the value of attribute resize_mode.



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

def resize_mode
  @resize_mode
end

#restore_facesObject

Returns the value of attribute restore_faces.



46
47
48
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_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_img2_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_img2_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_img2_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_img2_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_img2_img.rb', line 64

def s_tmin
  @s_tmin
end

#sampler_indexObject

Returns the value of attribute sampler_index.



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

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_img2_img.rb', line 32

def sampler_name
  @sampler_name
end

#save_imagesObject

Returns the value of attribute save_images.



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

def save_images
  @save_images
end

#script_argsObject

Returns the value of attribute script_args.



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

def script_args
  @script_args
end

#script_nameObject

Returns the value of attribute script_name.



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

def script_name
  @script_name
end

#seedObject

Returns the value of attribute seed.



22
23
24
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_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_img2_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_img2_img.rb', line 30

def seed_resize_from_w
  @seed_resize_from_w
end

#send_imagesObject

Returns the value of attribute send_images.



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

def send_images
  @send_images
end

#stepsObject

Returns the value of attribute steps.



38
39
40
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_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_img2_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_img2_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_img2_img.rb', line 26

def subseed_strength
  @subseed_strength
end

#tilingObject

Returns the value of attribute tiling.



48
49
50
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_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_img2_img.rb', line 42

def width
  @width
end

Class Method Details

.attribute_mapObject

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



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
174
175
176
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 121

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',
    :'init_images' => :'init_images',
    :'resize_mode' => :'resize_mode',
    :'image_cfg_scale' => :'image_cfg_scale',
    :'mask' => :'mask',
    :'mask_blur_x' => :'mask_blur_x',
    :'mask_blur_y' => :'mask_blur_y',
    :'mask_blur' => :'mask_blur',
    :'inpainting_fill' => :'inpainting_fill',
    :'inpaint_full_res' => :'inpaint_full_res',
    :'inpaint_full_res_padding' => :'inpaint_full_res_padding',
    :'inpainting_mask_invert' => :'inpainting_mask_invert',
    :'initial_noise_multiplier' => :'initial_noise_multiplier',
    :'latent_mask' => :'latent_mask',
    :'sampler_index' => :'sampler_index',
    :'include_init_images' => :'include_init_images',
    :'script_name' => :'script_name',
    :'script_args' => :'script_args',
    :'send_images' => :'send_images',
    :'save_images' => :'save_images',
    :'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



617
618
619
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 617

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

.openapi_nullableObject

List of attributes with nullable: true



237
238
239
240
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 237

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

.openapi_typesObject

Attribute type mapping.



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
231
232
233
234
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 179

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',
    :'init_images' => :'Object',
    :'resize_mode' => :'Object',
    :'image_cfg_scale' => :'Object',
    :'mask' => :'Object',
    :'mask_blur_x' => :'Object',
    :'mask_blur_y' => :'Object',
    :'mask_blur' => :'Object',
    :'inpainting_fill' => :'Object',
    :'inpaint_full_res' => :'Object',
    :'inpaint_full_res_padding' => :'Object',
    :'inpainting_mask_invert' => :'Object',
    :'initial_noise_multiplier' => :'Object',
    :'latent_mask' => :'Object',
    :'sampler_index' => :'Object',
    :'include_init_images' => :'Object',
    :'script_name' => :'Object',
    :'script_args' => :'Object',
    :'send_images' => :'Object',
    :'save_images' => :'Object',
    :'alwayson_scripts' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 545

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 &&
      init_images == o.init_images &&
      resize_mode == o.resize_mode &&
      image_cfg_scale == o.image_cfg_scale &&
      mask == o.mask &&
      mask_blur_x == o.mask_blur_x &&
      mask_blur_y == o.mask_blur_y &&
      mask_blur == o.mask_blur &&
      inpainting_fill == o.inpainting_fill &&
      inpaint_full_res == o.inpaint_full_res &&
      inpaint_full_res_padding == o.inpaint_full_res_padding &&
      inpainting_mask_invert == o.inpainting_mask_invert &&
      initial_noise_multiplier == o.initial_noise_multiplier &&
      latent_mask == o.latent_mask &&
      sampler_index == o.sampler_index &&
      include_init_images == o.include_init_images &&
      script_name == o.script_name &&
      script_args == o.script_args &&
      send_images == o.send_images &&
      save_images == o.save_images &&
      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



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
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 647

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



716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 716

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



624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 624

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


604
605
606
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 604

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



610
611
612
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 610

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, init_images, resize_mode, image_cfg_scale, mask, mask_blur_x, mask_blur_y, mask_blur, inpainting_fill, inpaint_full_res, inpaint_full_res_padding, inpainting_mask_invert, initial_noise_multiplier, latent_mask, sampler_index, include_init_images, script_name, script_args, send_images, save_images, 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



532
533
534
535
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 532

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



692
693
694
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 692

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



698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 698

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



686
687
688
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 686

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



539
540
541
# File 'lib/stable_diffusion/models/stable_diffusion_processing_img2_img.rb', line 539

def valid?
  true
end