Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,29 +19,21 @@ title = '''# 👋🏻Welcome to Tonic's🌟🎥StableVideo XT-1-1
|
|
19 |
Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community 👻 [![Join us on Discord](https://img.shields.io/discord/1109943800132010065?label=Discord&logo=discord&style=flat-square)](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Tonic-AI](https://github.com/tonic-ai) & contribute to 🌟 [SciTonic](https://github.com/Tonic-AI/scitonic) 🤗Big thanks to Yuvi Sharma and all the folks at huggingface for the community grant 🤗
|
20 |
'''
|
21 |
|
22 |
-
# Load the API token from an environment variable
|
23 |
-
hf_token = os.getenv("HF_TOKEN")
|
24 |
-
if not hf_token:
|
25 |
-
raise ValueError("Hugging Face token not found. Please set the HF_TOKEN environment variable.")
|
26 |
-
|
27 |
-
HfFolder.save_token(hf_token)
|
28 |
-
|
29 |
cache_dir = os.path.join(os.path.expanduser("~"), ".cache/huggingface/diffusers")
|
|
|
30 |
original_model_id = "stabilityai/stable-video-diffusion-img2vid-xt"
|
31 |
pipe = StableVideoDiffusionPipeline.from_pretrained(
|
32 |
original_model_id,
|
33 |
torch_dtype=torch.float16,
|
34 |
-
variant="fp16"
|
35 |
-
use_auth_token=hf_token
|
36 |
)
|
37 |
|
38 |
# Construct the model cache directory path
|
39 |
model_cache_dir = os.path.join(cache_dir, original_model_id.replace("/", "--"))
|
40 |
|
41 |
-
|
42 |
-
downloaded_safetensors_path = "svd_xt_1_1.safetensors"
|
43 |
|
44 |
-
original_safetensors_path = os.path.join(model_cache_dir, "svd_xt.safetensors")
|
45 |
os.replace(downloaded_safetensors_path, original_safetensors_path)
|
46 |
|
47 |
pipe = StableVideoDiffusionPipeline.from_pretrained(
|
|
|
19 |
Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community 👻 [![Join us on Discord](https://img.shields.io/discord/1109943800132010065?label=Discord&logo=discord&style=flat-square)](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Tonic-AI](https://github.com/tonic-ai) & contribute to 🌟 [SciTonic](https://github.com/Tonic-AI/scitonic) 🤗Big thanks to Yuvi Sharma and all the folks at huggingface for the community grant 🤗
|
20 |
'''
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
cache_dir = os.path.join(os.path.expanduser("~"), ".cache/huggingface/diffusers")
|
23 |
+
|
24 |
original_model_id = "stabilityai/stable-video-diffusion-img2vid-xt"
|
25 |
pipe = StableVideoDiffusionPipeline.from_pretrained(
|
26 |
original_model_id,
|
27 |
torch_dtype=torch.float16,
|
28 |
+
variant="fp16"
|
|
|
29 |
)
|
30 |
|
31 |
# Construct the model cache directory path
|
32 |
model_cache_dir = os.path.join(cache_dir, original_model_id.replace("/", "--"))
|
33 |
|
34 |
+
downloaded_safetensors_path = "./svd_xt_1_1.safetensors"
|
|
|
35 |
|
36 |
+
original_safetensors_path = os.path.join(model_cache_dir, "./svd_xt.safetensors")
|
37 |
os.replace(downloaded_safetensors_path, original_safetensors_path)
|
38 |
|
39 |
pipe = StableVideoDiffusionPipeline.from_pretrained(
|