hysts HF staff commited on
Commit
d1c233a
1 Parent(s): 8d8da79
Files changed (1) hide show
  1. model.py +2 -0
model.py CHANGED
@@ -119,6 +119,8 @@ class Model:
119
  guidance_scale: float,
120
  seed: int,
121
  ) -> list[PIL.Image.Image]:
 
 
122
  generator = torch.Generator().manual_seed(seed)
123
  return self.pipe(prompt=prompt,
124
  negative_prompt=negative_prompt,
 
119
  guidance_scale: float,
120
  seed: int,
121
  ) -> list[PIL.Image.Image]:
122
+ if seed == -1:
123
+ seed = np.random.randint(0, np.iinfo(np.int64).max)
124
  generator = torch.Generator().manual_seed(seed)
125
  return self.pipe(prompt=prompt,
126
  negative_prompt=negative_prompt,