code: def sha256(filename, title, use_addnet_hash=False):
      hashes = (
          cache("hashes-addnet") if use_addnet_hash else cache("hashes")
      )
  
      sha256_value = sha256_from_cache(filename, title, use_addnet_hash)
      if sha256_value is not None:
          return sha256_value
  
      if shared.cmd_opts.no_hashing:
          return None
  
      print(f"Calculating sha256 for {filename}: ", end="")
      if use_addnet_hash:
          with open(filename, "rb") as file:
              sha256_value = addnet_hash_safetensors(file)
      else:
          sha256_value = calculate_sha256(filename)
      print(f"{sha256_value}")
  
      hashes[title] = {
          "mtime": os.path.getmtime(filename),
          "sha256": sha256_value,
      }
  
      dump_cache()
  
      return sha256_value
  
file_path: stable-diffusion-webui/modules/hashes.py
imports: import hashlib
  import os.path
  from modules import shared
  import modules.cache
label_desc: Use image node_id 3 for calling a global function with example usage: sha256(filename, title, use_addnet_hash) and returns: sha256_value, sha256_value, None