Spaces:
Runtime error
Runtime error
Fix
Browse files
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,
|