code: def load_model(config, ckpt, gpu, eval_mode):
      if ckpt:
          print(f"Loading model from {ckpt}")
          pl_sd = torch.load(ckpt, map_location="cpu")
          global_step = pl_sd["global_step"]
      else:
          pl_sd = {"state_dict": None}
          global_step = None
      model = load_model_from_config(config.model, pl_sd["state_dict"])
  
      return model, global_step
  
imports: import argparse
  import datetime
  import glob
  import os
  import sys
  import time
  import numpy
  import torch
  import yaml
  from ldm.models.diffusion.ddim import DDIMSampler
  from ldm.util import instantiate_from_config
  from omegaconf import OmegaConf
  from PIL import Image
  from tqdm import trange
label_desc: Use image node_id 11 for calling a global function with example usage: load_model(config, ckpt, gpu, eval_mode) and returns: model,  global_step