code: def create_vae_config(original_config, image_size: int):
      vae_params = original_config.autoencoder.params.ddconfig
      _ = original_config.autoencoder.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)
  
      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,
      }
  
      return config
  
file_path: llmga/llmga/diffusers/scripts/convert_gligen_to_diffusers.py
imports: import argparse
  import re
  import torch
  from transformers import CLIPProcessor, CLIPTextModel, CLIPTokenizer, CLIPVisionModelWithProjection
  from diffusers import AutoencoderKL, DDIMScheduler, StableDiffusionGLIGENPipeline, StableDiffusionGLIGENTextImagePipeline, UNet2DConditionModel
  from diffusers.pipelines.stable_diffusion.convert_from_ckpt import assign_to_checkpoint, conv_attn_to_linear, protected, renew_attention_paths, renew_resnet_paths, renew_vae_attention_paths, renew_vae_resnet_paths, shave_segments, textenc_conversion_map, textenc_pattern
  from diffusers.utils import is_omegaconf_available
  from diffusers.utils.import_utils import BACKENDS_MAPPING
label_desc: Use image node_id 4 for calling a global function with example usage: create_vae_config(original_config, image_size) and returns: config