code: def create_vae_diffusers_config(
      original_config, checkpoint, image_size: int
  ):
      """
      Creates a VAE config for diffusers based on the config of the original AudioLDM2 model. Compared to the original
      Stable Diffusion conversion, this function passes a *learnt* VAE scaling factor to the diffusers VAE.
      """
      vae_params = (
          original_config.model.params.first_stage_config.params.ddconfig
      )
      _ = (
          original_config.model.params.first_stage_config.params.embed_dim
      )
  
      block_out_channels = [
          vae_params.ch * mult for mult in vae_params.ch_mult
      ]
      down_block_types = ["DownEncoderBlock2D"] * len(
          block_out_channels
      )
      up_block_types = ["UpDecoderBlock2D"] * len(block_out_channels)
  
      scaling_factor = (
          checkpoint["scale_factor"]
          if "scale_by_std" in original_config.model.params
          else 0.18215
      )
  
      config = {
          "sample_size": image_size,
          "in_channels": vae_params.in_channels,
          "out_channels": vae_params.out_ch,
          "down_block_types": tuple(down_block_types),
          "up_block_types": tuple(up_block_types),
          "block_out_channels": tuple(block_out_channels),
          "latent_channels": vae_params.z_channels,
          "layers_per_block": vae_params.num_res_blocks,
          "scaling_factor": float(scaling_factor),
      }
      return config
  
imports: import argparse
  import re
  from typing import List, Union
  import torch
  from transformers import AutoFeatureExtractor, AutoTokenizer, ClapConfig, ClapModel, GPT2Config, GPT2Model, SpeechT5HifiGan, SpeechT5HifiGanConfig, T5Config, T5EncoderModel
  from diffusers import AudioLDM2Pipeline, AudioLDM2ProjectionModel, AudioLDM2UNet2DConditionModel, AutoencoderKL, DDIMScheduler, DPMSolverMultistepScheduler, EulerAncestralDiscreteScheduler, EulerDiscreteScheduler, HeunDiscreteScheduler, LMSDiscreteScheduler, PNDMScheduler
  from diffusers.utils import is_omegaconf_available, is_safetensors_available
  from diffusers.utils.import_utils import BACKENDS_MAPPING
label_desc: Use image node_id 9 for calling a global function with example usage: create_vae_diffusers_config(original_config, checkpoint, image_size) and returns: config