remove half
Browse files
app.py
CHANGED
@@ -29,14 +29,14 @@ def get_modelscope_pipeline(
|
|
29 |
mcm_variant: Optional[str] = "WebVid",
|
30 |
):
|
31 |
model_id = "ali-vilab/text-to-video-ms-1.7b"
|
32 |
-
if torch.cuda.is_available():
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
else:
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
scheduler = LCMScheduler.from_pretrained(
|
41 |
model_id,
|
42 |
subfolder="scheduler",
|
@@ -87,23 +87,23 @@ def get_animatediff_pipeline(
|
|
87 |
else:
|
88 |
raise ValueError(f"Unknown real_variant {real_variant}")
|
89 |
|
90 |
-
if torch.cuda.is_available():
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
else:
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
scheduler = LCMScheduler.from_pretrained(
|
108 |
model_id,
|
109 |
subfolder="scheduler",
|
@@ -214,7 +214,7 @@ def infer(
|
|
214 |
if randomize_seed:
|
215 |
seed = random.randint(0, MAX_SEED)
|
216 |
|
217 |
-
generator = torch.Generator().manual_seed(seed)
|
218 |
|
219 |
output = cache_pipeline["pipeline"](
|
220 |
prompt=prompt,
|
|
|
29 |
mcm_variant: Optional[str] = "WebVid",
|
30 |
):
|
31 |
model_id = "ali-vilab/text-to-video-ms-1.7b"
|
32 |
+
# if torch.cuda.is_available():
|
33 |
+
# pipe = DiffusionPipeline.from_pretrained(
|
34 |
+
# model_id, torch_dtype=torch.float16, variant="fp16"
|
35 |
+
# )
|
36 |
+
# else:
|
37 |
+
pipe = DiffusionPipeline.from_pretrained(
|
38 |
+
model_id
|
39 |
+
)
|
40 |
scheduler = LCMScheduler.from_pretrained(
|
41 |
model_id,
|
42 |
subfolder="scheduler",
|
|
|
87 |
else:
|
88 |
raise ValueError(f"Unknown real_variant {real_variant}")
|
89 |
|
90 |
+
# if torch.cuda.is_available():
|
91 |
+
# adapter = MotionAdapter.from_pretrained(
|
92 |
+
# motion_module_path, torch_dtype=torch.float16
|
93 |
+
# )
|
94 |
+
# pipe = AnimateDiffPipeline.from_pretrained(
|
95 |
+
# model_id,
|
96 |
+
# motion_adapter=adapter,
|
97 |
+
# torch_dtype=torch.float16,
|
98 |
+
# )
|
99 |
+
# else:
|
100 |
+
adapter = MotionAdapter.from_pretrained(
|
101 |
+
motion_module_path
|
102 |
+
)
|
103 |
+
pipe = AnimateDiffPipeline.from_pretrained(
|
104 |
+
model_id,
|
105 |
+
motion_adapter=adapter,
|
106 |
+
)
|
107 |
scheduler = LCMScheduler.from_pretrained(
|
108 |
model_id,
|
109 |
subfolder="scheduler",
|
|
|
214 |
if randomize_seed:
|
215 |
seed = random.randint(0, MAX_SEED)
|
216 |
|
217 |
+
generator = torch.Generator("cpu").manual_seed(seed)
|
218 |
|
219 |
output = cache_pipeline["pipeline"](
|
220 |
prompt=prompt,
|