code: def to_half(tensor, enable):
      if enable and tensor.dtype == torch.float:
          return tensor.half()
  
      return tensor
  
file_path: stable-diffusion-webui/modules/extras.py
imports: import os
  import re
  import shutil
  import json
  import torch
  import tqdm
  from modules import shared, images, sd_models, sd_vae, sd_models_config, errors
  from modules.ui_common import plaintext_to_html
  import gradio
  import safetensors.torch
label_desc: Use image node_id 3 for calling a global function with example usage: to_half(tensor, enable) and returns: tensor, tensor