Abe
commited on
Commit
·
76b0872
1
Parent(s):
fa7b66d
kadinsky test
Browse files- inference.py +2 -2
inference.py
CHANGED
@@ -5,7 +5,7 @@ import io
|
|
5 |
import config
|
6 |
import random
|
7 |
|
8 |
-
from diffusers import DiffusionPipeline
|
9 |
import torch
|
10 |
|
11 |
class DiffusionInference:
|
@@ -165,6 +165,6 @@ class DiffusionInference:
|
|
165 |
random_seed = random.randint(0, 3999999999) # Max 32-bit integer
|
166 |
generator = torch.Generator(device="cuda").manual_seed(random_seed)
|
167 |
print(f"Using random seed: {random_seed}")
|
168 |
-
pipeline =
|
169 |
image = pipeline(**kwargs).images[0]
|
170 |
return image
|
|
|
5 |
import config
|
6 |
import random
|
7 |
|
8 |
+
from diffusers import DiffusionPipeline, AutoPipelineForText2Image
|
9 |
import torch
|
10 |
|
11 |
class DiffusionInference:
|
|
|
165 |
random_seed = random.randint(0, 3999999999) # Max 32-bit integer
|
166 |
generator = torch.Generator(device="cuda").manual_seed(random_seed)
|
167 |
print(f"Using random seed: {random_seed}")
|
168 |
+
pipeline = AutoPipelineForText2Image.from_pretrained(model_name, generator=generator, torch_dtype=torch.float16).to("cuda")
|
169 |
image = pipeline(**kwargs).images[0]
|
170 |
return image
|