jadechoghari
commited on
Commit
•
629f20f
1
Parent(s):
ce01e8f
Update pipeline.py
Browse files- pipeline.py +18 -7
pipeline.py
CHANGED
@@ -4,13 +4,24 @@ from .generate import Generator
|
|
4 |
from .utils import init_model, seed_everything, get_frame_ids
|
5 |
|
6 |
class VidToMePipeline(DiffusionPipeline):
|
7 |
-
def __init__(self, device="cuda", sd_version="2.1", float_precision="fp16", height=512, width=512):
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
self.sd_version = sd_version
|
15 |
self.float_precision = float_precision
|
16 |
self.height = height
|
|
|
4 |
from .utils import init_model, seed_everything, get_frame_ids
|
5 |
|
6 |
class VidToMePipeline(DiffusionPipeline):
|
7 |
+
# def __init__(self, device="cuda", sd_version="2.1", float_precision="fp16", height=512, width=512):
|
8 |
+
# # this will initlize the core pipeline components
|
9 |
+
# pipe, scheduler, model_key = init_model(device, sd_version, None, "none", float_precision)
|
10 |
+
# self.pipe = pipe
|
11 |
+
# self.scheduler = scheduler
|
12 |
+
# self.model_key = model_key
|
13 |
+
# self.device = device
|
14 |
+
# self.sd_version = sd_version
|
15 |
+
# self.float_precision = float_precision
|
16 |
+
# self.height = height
|
17 |
+
# self.width = width
|
18 |
+
|
19 |
+
def __init__(self, device="cuda", sd_version="1.5", float_precision="fp16", height=512, width=512):
|
20 |
+
# Register configuration parameters
|
21 |
+
self.register_to_config(device=device, sd_version=sd_version, float_precision=float_precision, height=height, width=width)
|
22 |
+
|
23 |
+
# Now you can safely use self.device and other attributes
|
24 |
+
self.device = torch.device(device if torch.cuda.is_available() else "cpu")
|
25 |
self.sd_version = sd_version
|
26 |
self.float_precision = float_precision
|
27 |
self.height = height
|