Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,6 +26,7 @@ from src.pipelines.pipeline_kandinsky_subject_prior import KandinskyPriorPipelin
|
|
| 26 |
|
| 27 |
from diffusers import DiffusionPipeline
|
| 28 |
from PIL import Image
|
|
|
|
| 29 |
|
| 30 |
__device__ = "cpu"
|
| 31 |
__dtype__ = torch.float32
|
|
@@ -68,6 +69,8 @@ class Model:
|
|
| 68 |
).to(self.device)
|
| 69 |
|
| 70 |
def inference(self, raw_data, seed):
|
|
|
|
|
|
|
| 71 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
| 72 |
image_emb, negative_image_emb = self.pipe_prior(
|
| 73 |
raw_data=raw_data,
|
|
|
|
| 26 |
|
| 27 |
from diffusers import DiffusionPipeline
|
| 28 |
from PIL import Image
|
| 29 |
+
import random
|
| 30 |
|
| 31 |
__device__ = "cpu"
|
| 32 |
__dtype__ = torch.float32
|
|
|
|
| 69 |
).to(self.device)
|
| 70 |
|
| 71 |
def inference(self, raw_data, seed):
|
| 72 |
+
if seed is None:
|
| 73 |
+
seed = random.randint(0, 10000000)
|
| 74 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
| 75 |
image_emb, negative_image_emb = self.pipe_prior(
|
| 76 |
raw_data=raw_data,
|