AutoencoderOobleck¶
The Oobleck variational autoencoder (VAE) model with KL loss was introduced in Stability-AI/stable-audio-tools and Stable Audio Open by Stability AI. The model is used in 🤗 Diffusers to encode audio waveforms into latents and to decode latent representations into audio waveforms.
The abstract from the paper is:
Open generative models are vitally important for the community, allowing for fine-tunes and serving as baselines when presenting new models. However, most current text-to-audio models are private and not accessible for artists and researchers to build upon. Here we describe the architecture and training process of a new open-weights text-to-audio model trained with Creative Commons data. Our evaluation shows that the model's performance is competitive with the state-of-the-art across various metrics. Notably, the reported FDopenl3 results (measuring the realism of the generations) showcase its potential for high-quality stereo sound synthesis at 44.1kHz.
mindone.diffusers.AutoencoderOobleck
¶
Bases: ModelMixin
, ConfigMixin
An autoencoder for encoding waveforms into latents and decoding latent representations into waveforms. First introduced in Stable Audio.
This model inherits from [ModelMixin
]. Check the superclass documentation for it's generic methods implemented
for all models (such as downloading or saving).
PARAMETER | DESCRIPTION |
---|---|
encoder_hidden_size |
Intermediate representation dimension for the encoder.
TYPE:
|
downsampling_ratios |
Ratios for downsampling in the encoder. These are used in reverse order for upsampling in the decoder.
TYPE:
|
channel_multiples |
Multiples used to determine the hidden sizes of the hidden layers.
TYPE:
|
decoder_channels |
Intermediate representation dimension for the decoder.
TYPE:
|
decoder_input_channels |
Input dimension for the decoder. Corresponds to the latent dimension.
TYPE:
|
audio_channels |
Number of channels in the audio data. Either 1 for mono or 2 for stereo.
TYPE:
|
sampling_rate |
The sampling rate at which the audio waveform should be digitalized expressed in hertz (Hz).
TYPE:
|
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
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 |
|
mindone.diffusers.AutoencoderOobleck.construct(sample, sample_posterior=False, return_dict=True, generator=None)
¶
PARAMETER | DESCRIPTION |
---|---|
sample |
Input sample.
TYPE:
|
sample_posterior |
Whether to sample from the posterior.
TYPE:
|
return_dict |
Whether or not to return a [
TYPE:
|
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
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 |
|
mindone.diffusers.AutoencoderOobleck.decode(z, return_dict=True, generator=None)
¶
Decode a batch of images.
PARAMETER | DESCRIPTION |
---|---|
z |
Input batch of latent vectors.
TYPE:
|
return_dict |
Whether to return a [
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Union[OobleckDecoderOutput, Tensor]
|
[ |
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
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 |
|
mindone.diffusers.AutoencoderOobleck.disable_slicing()
¶
Disable sliced VAE decoding. If enable_slicing
was previously enabled, this method will go back to computing
decoding in one step.
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
391 392 393 394 395 396 |
|
mindone.diffusers.AutoencoderOobleck.enable_slicing()
¶
Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
384 385 386 387 388 389 |
|
mindone.diffusers.AutoencoderOobleck.encode(x, return_dict=True)
¶
Encode a batch of images into latents.
PARAMETER | DESCRIPTION |
---|---|
x |
Input batch of images.
TYPE:
|
return_dict |
Whether to return a [
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Union[AutoencoderOobleckOutput, Tuple[OobleckDiagonalGaussianDistribution]]
|
The latent representations of the encoded images. If |
Union[AutoencoderOobleckOutput, Tuple[OobleckDiagonalGaussianDistribution]]
|
[ |
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
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 |
|
mindone.diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput
dataclass
¶
Bases: BaseOutput
Output of decoding method.
PARAMETER | DESCRIPTION |
---|---|
sample |
The decoded output sample from the last layer of the model.
TYPE:
|
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
214 215 216 217 218 219 220 221 222 223 224 |
|
mindone.diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput
dataclass
¶
Bases: BaseOutput
Output of AutoencoderOobleck encoding method.
PARAMETER | DESCRIPTION |
---|---|
latent_dist |
Encoded outputs of
TYPE:
|
Source code in mindone/diffusers/models/autoencoders/autoencoder_oobleck.py
199 200 201 202 203 204 205 206 207 208 209 210 211 |
|