code: def convert_controlnet(
      inp: Union[str, tensor_dict_type]
  ) -> tensor_dict_type:
      inp = get_tensors(inp)
      with open(
          download_static("sd_controlnet_mapping", extension="json"),
          "r",
      ) as f:
          mapping = json.load(f)
      nd = {}
      for k, v in inp.items():
          if "control_model" in k:
              nd[mapping[k]] = v
      return nd
  
imports: import json
  import torch
  from torch import Tensor
  from typing import Dict
  from typing import List
  from typing import Union
  from typing import Optional
  from cftool.misc import shallow_copy_dict
  from cftool.array import tensor_dict_type
  from ..misc.toolkit import get_tensors
  from ..misc.toolkit import download_static
  from ..api.cv.diffusion import DiffusionAPI
label_desc: Use image node_id 10 for calling a global function with example usage: convert_controlnet(inp) and returns: nd