Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -256,10 +256,10 @@ def process(input_fg, prompt, image_width, image_height, num_samples, seed, step
|
|
| 256 |
raise gr.Error("Preferenca e ndriΓ§imit Γ«shtΓ« e pavlefshme!")
|
| 257 |
|
| 258 |
if seed == -1:
|
| 259 |
-
|
| 260 |
-
|
| 261 |
|
| 262 |
-
|
| 263 |
|
| 264 |
try:
|
| 265 |
fg = resize_and_center_crop(input_fg, image_width, image_height)
|
|
|
|
| 256 |
raise gr.Error("Preferenca e ndriΓ§imit Γ«shtΓ« e pavlefshme!")
|
| 257 |
|
| 258 |
if seed == -1:
|
| 259 |
+
import random
|
| 260 |
+
seed = random.randint(0, 2**32 - 1)
|
| 261 |
|
| 262 |
+
rng = torch.Generator(device=device).manual_seed(int(seed))
|
| 263 |
|
| 264 |
try:
|
| 265 |
fg = resize_and_center_crop(input_fg, image_width, image_height)
|