duanyuxuan
commited on
Commit
•
b9b6700
1
Parent(s):
40317f4
Fix lora path
Browse files
app.py
CHANGED
@@ -19,14 +19,18 @@ if LOCAL:
|
|
19 |
lora_file_path = '/share2/duanyuxuan/diff_playground/SVD-TDD/svd-xt-1-1_tdd_lora_weights.safetensors'
|
20 |
else:
|
21 |
svd_path = 'stabilityai/stable-video-diffusion-img2vid-xt-1-1'
|
22 |
-
|
|
|
23 |
|
24 |
if torch.cuda.is_available():
|
25 |
noise_scheduler = TDDSVDStochasticIterativeScheduler(num_train_timesteps = 250, sigma_min = 0.002, sigma_max = 700.0, sigma_data = 1.0,
|
26 |
s_noise = 1.0, rho = 7, clip_denoised = False)
|
27 |
|
28 |
pipeline = StableVideoDiffusionPipeline.from_pretrained(svd_path, scheduler = noise_scheduler, torch_dtype = torch.float16, variant = "fp16").to('cuda')
|
29 |
-
|
|
|
|
|
|
|
30 |
|
31 |
max_64_bit_int = 2**63 - 1
|
32 |
|
|
|
19 |
lora_file_path = '/share2/duanyuxuan/diff_playground/SVD-TDD/svd-xt-1-1_tdd_lora_weights.safetensors'
|
20 |
else:
|
21 |
svd_path = 'stabilityai/stable-video-diffusion-img2vid-xt-1-1'
|
22 |
+
lora_repo_path = 'RED-AIGC/TDD'
|
23 |
+
lora_weight_name = 'svd-xt-1-1_tdd_lora_weights.safetensors'
|
24 |
|
25 |
if torch.cuda.is_available():
|
26 |
noise_scheduler = TDDSVDStochasticIterativeScheduler(num_train_timesteps = 250, sigma_min = 0.002, sigma_max = 700.0, sigma_data = 1.0,
|
27 |
s_noise = 1.0, rho = 7, clip_denoised = False)
|
28 |
|
29 |
pipeline = StableVideoDiffusionPipeline.from_pretrained(svd_path, scheduler = noise_scheduler, torch_dtype = torch.float16, variant = "fp16").to('cuda')
|
30 |
+
if LOCAL:
|
31 |
+
load_lora_weights(pipeline.unet, lora_file_path)
|
32 |
+
else:
|
33 |
+
load_lora_weights(pipeline.unet, lora_repo_path, weight_name = lora_weight_name)
|
34 |
|
35 |
max_64_bit_int = 2**63 - 1
|
36 |
|