code: def apply_unet(option=None):
      global current_unet_option
      global current_unet
  
      new_option = get_unet_option(option)
      if new_option == current_unet_option:
          return
  
      if current_unet is not None:
          print(f"Dectivating unet: {current_unet.option.label}")
          current_unet.deactivate()
  
      current_unet_option = new_option
      if current_unet_option is None:
          current_unet = None
  
          if not shared.sd_model.lowvram:
              shared.sd_model.model.diffusion_model.to(devices.device)
  
          return
  
      shared.sd_model.model.diffusion_model.to(devices.cpu)
      devices.torch_gc()
  
      current_unet = current_unet_option.create_unet()
      current_unet.option = current_unet_option
      print(f"Activating unet: {current_unet.option.label}")
      current_unet.activate()
  
file_path: stable-diffusion-webui/modules/sd_unet.py
imports: import torch.nn
  from modules import script_callbacks, shared, devices
label_desc: Use image node_id 3 for calling a global function with example usage: apply_unet(option) without return types