code: def create_generator(seed):
      if shared.opts.randn_source == "NV":
          return rng_philox.Generator(seed)
  
      device = (
          devices.cpu
          if shared.opts.randn_source == "CPU"
          or devices.device.type == "mps"
          else devices.device
      )
      generator = torch.Generator(device).manual_seed(int(seed))
      return generator
  
file_path: stable-diffusion-webui/modules/rng.py
imports: import torch
  from modules import devices, rng_philox, shared
label_desc: Use image node_id 6 for calling a global function with example usage: create_generator(seed) and returns: generator, rng_philox