Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ hf_hub_download(repo_id="wileewang/TransPixar", filename="cogvideox_rgba_lora.sa
|
|
45 |
# snapshot_download(repo_id="AlexWortega/RIFE", local_dir="model_rife")
|
46 |
|
47 |
pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5B", torch_dtype=torch.bfloat16)
|
48 |
-
|
49 |
pipe.vae.enable_slicing()
|
50 |
pipe.vae.enable_tiling()
|
51 |
pipe.scheduler = CogVideoXDPMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
@@ -57,7 +57,7 @@ seq_length = 2 * (
|
|
57 |
prepare_for_rgba_inference(
|
58 |
pipe.transformer,
|
59 |
rgba_weights_path="model_cogvideox_rgba_lora/cogvideox_rgba_lora.safetensors",
|
60 |
-
device=
|
61 |
dtype=torch.bfloat16,
|
62 |
text_length=226,
|
63 |
seq_length=seq_length, # this is for the creation of attention mask.
|
@@ -308,6 +308,8 @@ with gr.Blocks() as demo:
|
|
308 |
alpha_video_update = gr.update(visible=True, value=alpha_video_path)
|
309 |
seed_update = gr.update(visible=True, value=seed)
|
310 |
|
|
|
|
|
311 |
return rgb_video_path, alpha_video_path, rgb_video_update, alpha_video_update, seed_update
|
312 |
|
313 |
|
|
|
45 |
# snapshot_download(repo_id="AlexWortega/RIFE", local_dir="model_rife")
|
46 |
|
47 |
pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5B", torch_dtype=torch.bfloat16)
|
48 |
+
pipe.enable_sequential_cpu_offload()
|
49 |
pipe.vae.enable_slicing()
|
50 |
pipe.vae.enable_tiling()
|
51 |
pipe.scheduler = CogVideoXDPMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
|
|
57 |
prepare_for_rgba_inference(
|
58 |
pipe.transformer,
|
59 |
rgba_weights_path="model_cogvideox_rgba_lora/cogvideox_rgba_lora.safetensors",
|
60 |
+
device=device,
|
61 |
dtype=torch.bfloat16,
|
62 |
text_length=226,
|
63 |
seq_length=seq_length, # this is for the creation of attention mask.
|
|
|
308 |
alpha_video_update = gr.update(visible=True, value=alpha_video_path)
|
309 |
seed_update = gr.update(visible=True, value=seed)
|
310 |
|
311 |
+
pipe.to("cpu")
|
312 |
+
|
313 |
return rgb_video_path, alpha_video_path, rgb_video_update, alpha_video_update, seed_update
|
314 |
|
315 |
|