code: def load_diffusion_model(model_config, diffusion_model, steps):
      from .model.script_util import (
          create_model_and_diffusion,
      )
  
      timestep_respacing = f"ddim{steps}"
      diffusion_steps = (
          (1000 // steps) * steps if steps < 1000 else steps
      )
      model_config.update(
          {
              "timestep_respacing": timestep_respacing,
              "diffusion_steps": diffusion_steps,
          }
      )
  
      model, diffusion = create_model_and_diffusion(**model_config)
      model.set_state_dict(
          paddle.load(
              os.path.join(
                  os.path.dirname(__file__),
                  "pre_trained",
                  f"{diffusion_model}.pdparams",
              )
          )
      )
      model.eval()
      for name, param in model.named_parameters():
          param.stop_gradient = True
  
      return model, diffusion
  
file_path: PaddleHub/modules/image/text_to_image/disco_diffusion_cnclip_vitb16/reverse_diffusion/helper.py
imports: import hashlib
  import logging
  import os
  import subprocess
  import sys
  from os.path import expanduser
  from pathlib import Path
  from typing import Any
  from typing import Dict
  from typing import List
  import paddle
label_desc: Use image node_id 4 for calling a global function with example usage: load_diffusion_model(model_config, diffusion_model, steps) and returns: model,  diffusion