code: def select_checkpoint():
      """Raises `FileNotFoundError` if no checkpoints are found."""
      model_checkpoint = shared.opts.sd_model_checkpoint
  
      checkpoint_info = checkpoint_aliases.get(model_checkpoint, None)
      if checkpoint_info is not None:
          return checkpoint_info
  
      if len(checkpoints_list) == 0:
          error_message = "No checkpoints found. When searching for checkpoints, looked at:"
          if shared.cmd_opts.ckpt is not None:
              error_message += (
                  f"\n - file {os.path.abspath(shared.cmd_opts.ckpt)}"
              )
          error_message += f"\n - directory {model_path}"
          if shared.cmd_opts.ckpt_dir is not None:
              error_message += f"\n - directory {os.path.abspath(shared.cmd_opts.ckpt_dir)}"
          error_message += "Can't run without a checkpoint. Find and place a .ckpt or .safetensors file into any of those locations."
          raise FileNotFoundError(error_message)
  
      checkpoint_info = next(iter(checkpoints_list.values()))
      if model_checkpoint is not None:
          print(
              f"Checkpoint {model_checkpoint} not found; loading fallback {checkpoint_info.title}",
              file=sys.stderr,
          )
  
      return checkpoint_info
  
imports: import collections
  import os.path
  import sys
  import threading
  import torch
  import re
  import safetensors.torch
  from omegaconf import OmegaConf, ListConfig
  from os import mkdir
  from urllib import request
  import ldm.modules.midas
  from ldm.util import instantiate_from_config
  from modules import paths, shared, modelloader, devices, script_callbacks, sd_vae, sd_disable_initialization, errors, hashes, sd_models_config, sd_unet, sd_models_xl, cache, extra_networks, processing, lowvram, sd_hijack, patches
  from modules.timer import Timer
  import tomesd
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: select_checkpoint() and returns: checkpoint_info, checkpoint_info