code: def init_generator(self, seed):
      if self.generator is None:
          self.generator = torch.Generator()
      if seed != -1:
          self.generator.manual_seed(seed)
      else:
          self.generator.seed()
  
imports: from typing import ClassVar, Optional
  import torch
  import os
  from bigdl.nano.pytorch import InferenceOptimizer
  from diffusers.schedulers import *
  from .utils import get_snapshot_dir_from_model_version
  from .pipelines import NanoStableDiffusionPipeline
label_desc: Use image node_id 3 for calling the StableDiffusionRunner obj's underlying member method code with example usage: obj.init_generator(seed) without return types