jadechoghari
commited on
Commit
•
2e7920c
1
Parent(s):
2ff21f6
Update pipeline.py
Browse files- pipeline.py +16 -12
pipeline.py
CHANGED
@@ -6,26 +6,30 @@ import torch
|
|
6 |
|
7 |
class VidToMePipeline(DiffusionPipeline):
|
8 |
# def __init__(self, device="cuda", sd_version="2.1", float_precision="fp16", height=512, width=512):
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
def __init__(self, device="cuda", sd_version="1.5", float_precision="fp16", height=512, width=512):
|
21 |
# Register configuration parameters
|
22 |
self.register_to_config(device=device, sd_version=sd_version, float_precision=float_precision, height=height, width=width)
|
23 |
-
|
24 |
-
# Now you can safely use self.device and other attributes
|
25 |
self.sd_version = sd_version
|
26 |
self.float_precision = float_precision
|
27 |
self.height = height
|
28 |
self.width = width
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
def __call__(self, video_path=None, video_prompt=None, edit_prompt=None,
|
31 |
control_type="none", n_timesteps=50, guidance_scale=7.5,
|
|
|
6 |
|
7 |
class VidToMePipeline(DiffusionPipeline):
|
8 |
# def __init__(self, device="cuda", sd_version="2.1", float_precision="fp16", height=512, width=512):
|
9 |
+
# # this will initlize the core pipeline components
|
10 |
+
# pipe, scheduler, model_key = init_model(device, sd_version, None, "none", float_precision)
|
11 |
+
# self.pipe = pipe
|
12 |
+
# self.scheduler = scheduler
|
13 |
+
# self.model_key = model_key
|
14 |
+
# self.device = device
|
15 |
+
# self.sd_version = sd_version
|
16 |
+
# self.float_precision = float_precision
|
17 |
+
# self.height = height
|
18 |
+
# self.width = width
|
19 |
|
20 |
def __init__(self, device="cuda", sd_version="1.5", float_precision="fp16", height=512, width=512):
|
21 |
# Register configuration parameters
|
22 |
self.register_to_config(device=device, sd_version=sd_version, float_precision=float_precision, height=height, width=width)
|
|
|
|
|
23 |
self.sd_version = sd_version
|
24 |
self.float_precision = float_precision
|
25 |
self.height = height
|
26 |
self.width = width
|
27 |
+
# this will initlize the core pipeline components
|
28 |
+
pipe, scheduler, model_key = init_model(device, sd_version, None, "none", float_precision)
|
29 |
+
self.pipe = pipe
|
30 |
+
self.scheduler = scheduler
|
31 |
+
self.model_key = model_key
|
32 |
+
self.device = device
|
33 |
|
34 |
def __call__(self, video_path=None, video_prompt=None, edit_prompt=None,
|
35 |
control_type="none", n_timesteps=50, guidance_scale=7.5,
|