Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ is_canonical = True if os.environ.get("SPACE_ID") == "Pyramid-Flow/pyramid-flow"
|
|
15 |
# Constants
|
16 |
MODEL_PATH = "pyramid-flow-model"
|
17 |
MODEL_REPO = "rain1011/pyramid-flow-sd3"
|
18 |
-
MODEL_VARIANT = "
|
19 |
MODEL_DTYPE = "bf16"
|
20 |
|
21 |
def center_crop(image, target_width, target_height):
|
@@ -78,7 +78,7 @@ def generate_video(prompt, image=None, duration=10, guidance_scale=9, video_guid
|
|
78 |
guidance_scale=7.0,
|
79 |
video_guidance_scale=video_guidance_scale,
|
80 |
output_type="pil",
|
81 |
-
save_memory=True,
|
82 |
)
|
83 |
else:
|
84 |
with torch.no_grad(), torch.cuda.amp.autocast(enabled=True, dtype=torch_dtype):
|
@@ -86,13 +86,13 @@ def generate_video(prompt, image=None, duration=10, guidance_scale=9, video_guid
|
|
86 |
prompt=prompt,
|
87 |
num_inference_steps=[20, 20, 20],
|
88 |
video_num_inference_steps=[10, 10, 10],
|
89 |
-
|
90 |
-
|
91 |
temp=temp,
|
92 |
guidance_scale=guidance_scale,
|
93 |
video_guidance_scale=video_guidance_scale,
|
94 |
output_type="pil",
|
95 |
-
save_memory=True,
|
96 |
)
|
97 |
output_path = f"{str(uuid.uuid4())}_output_video.mp4"
|
98 |
export_to_video(frames, output_path, fps= 8)
|
|
|
15 |
# Constants
|
16 |
MODEL_PATH = "pyramid-flow-model"
|
17 |
MODEL_REPO = "rain1011/pyramid-flow-sd3"
|
18 |
+
MODEL_VARIANT = "diffusion_transformer_768p"
|
19 |
MODEL_DTYPE = "bf16"
|
20 |
|
21 |
def center_crop(image, target_width, target_height):
|
|
|
78 |
guidance_scale=7.0,
|
79 |
video_guidance_scale=video_guidance_scale,
|
80 |
output_type="pil",
|
81 |
+
# save_memory=True,
|
82 |
)
|
83 |
else:
|
84 |
with torch.no_grad(), torch.cuda.amp.autocast(enabled=True, dtype=torch_dtype):
|
|
|
86 |
prompt=prompt,
|
87 |
num_inference_steps=[20, 20, 20],
|
88 |
video_num_inference_steps=[10, 10, 10],
|
89 |
+
height=768,
|
90 |
+
width=1280,
|
91 |
temp=temp,
|
92 |
guidance_scale=guidance_scale,
|
93 |
video_guidance_scale=video_guidance_scale,
|
94 |
output_type="pil",
|
95 |
+
# save_memory=True,
|
96 |
)
|
97 |
output_path = f"{str(uuid.uuid4())}_output_video.mp4"
|
98 |
export_to_video(frames, output_path, fps= 8)
|