code: def cumsum_fix(input, cumsum_func, *args, **kwargs):
      if input.device.type == "mps":
          output_dtype = kwargs.get("dtype", input.dtype)
          if output_dtype == torch.int64:
              return cumsum_func(input.cpu(), *args, **kwargs).to(
                  input.device
              )
          elif (
              output_dtype == torch.bool
              or cumsum_needs_int_fix
              and (
                  output_dtype == torch.int8
                  or output_dtype == torch.int16
              )
          ):
              return cumsum_func(
                  input.to(torch.int32), *args, **kwargs
              ).to(torch.int64)
      return cumsum_func(input, *args, **kwargs)
  
file_path: stable-diffusion-webui/modules/mac_specific.py
imports: import logging
  import torch
  from torch import Tensor
  import platform
  from modules.sd_hijack_utils import CondFunc
  from packaging import version
  from modules import shared
label_desc: Use image node_id 3 for calling a global function with example usage: cumsum_fix(input, cumsum_func) and returns: cumsum_func, cumsum_func, cumsum_func