code: def create_model_and_diffusion(
      image_size,
      class_cond,
      learn_sigma,
      num_channels,
      num_res_blocks,
      channel_mult,
      num_heads,
      num_head_channels,
      num_heads_upsample,
      attention_resolutions,
      dropout,
      diffusion_steps,
      noise_schedule,
      timestep_respacing,
      use_kl,
      predict_xstart,
      rescale_timesteps,
      rescale_learned_sigmas,
      use_checkpoint,
      use_scale_shift_norm,
      resblock_updown,
      use_fp16,
      use_new_attention_order,
  ):
      model = create_model(
          image_size,
          num_channels,
          num_res_blocks,
          channel_mult=channel_mult,
          learn_sigma=learn_sigma,
          class_cond=class_cond,
          use_checkpoint=use_checkpoint,
          attention_resolutions=attention_resolutions,
          num_heads=num_heads,
          num_head_channels=num_head_channels,
          num_heads_upsample=num_heads_upsample,
          use_scale_shift_norm=use_scale_shift_norm,
          dropout=dropout,
          resblock_updown=resblock_updown,
          use_fp16=use_fp16,
          use_new_attention_order=use_new_attention_order,
      )
      diffusion = create_gaussian_diffusion(
          steps=diffusion_steps,
          learn_sigma=learn_sigma,
          noise_schedule=noise_schedule,
          use_kl=use_kl,
          predict_xstart=predict_xstart,
          rescale_timesteps=rescale_timesteps,
          rescale_learned_sigmas=rescale_learned_sigmas,
          timestep_respacing=timestep_respacing,
      )
      return model, diffusion
  
file_path: PaddleHub/modules/image/text_to_image/disco_diffusion_ernievil_base/reverse_diffusion/model/script_util.py
imports: import argparse
  import inspect
  from .None import gaussian_diffusion
  from .respace import space_timesteps
  from .respace import SpacedDiffusion
  from .unet import EncoderUNetModel
  from .unet import SuperResModel
  from .unet import UNetModel
label_desc: Use image node_id 3 for calling a global function with example usage: create_model_and_diffusion(image_size, class_cond, learn_sigma, num_channels, num_res_blocks, channel_mult, num_heads, num_head_channels, num_heads_upsample, attention_resolutions, dropout, diffusion_steps, noise_schedule, timestep_respacing, use_kl, predict_xstart, rescale_timesteps, rescale_learned_sigmas, use_checkpoint, use_scale_shift_norm, resblock_updown, use_fp16, use_new_attention_order) and returns: model,  diffusion