Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
import torch
|
| 2 |
-
torch.jit.script = lambda f: f
|
| 3 |
# General
|
| 4 |
import os
|
| 5 |
from os.path import join as opj
|
| 6 |
import argparse
|
| 7 |
import datetime
|
| 8 |
from pathlib import Path
|
| 9 |
-
import spaces
|
| 10 |
import gradio as gr
|
| 11 |
import tempfile
|
| 12 |
import yaml
|
|
@@ -56,7 +56,7 @@ msxl_model = init_v2v_model(cfg_v2v, device)
|
|
| 56 |
# -------------------------
|
| 57 |
# ----- Functionality -----
|
| 58 |
# -------------------------
|
| 59 |
-
@spaces.GPU(duration=120)
|
| 60 |
def generate(prompt, num_frames, image, model_name_stage1, model_name_stage2, seed, t, image_guidance, where_to_log=result_fol):
|
| 61 |
now = datetime.datetime.now()
|
| 62 |
name = prompt[:100].replace(" ", "_") + "_" + str(now.time()).replace(":", "_").replace(".", "_")
|
|
@@ -86,7 +86,7 @@ def generate(prompt, num_frames, image, model_name_stage1, model_name_stage2, se
|
|
| 86 |
video_path = opj(where_to_log, name+".mp4")
|
| 87 |
return video_path
|
| 88 |
|
| 89 |
-
@spaces.GPU(duration=400)
|
| 90 |
def enhance(prompt, input_to_enhance, num_frames=None, image=None, model_name_stage1=None, model_name_stage2=None, seed=33, t=50, image_guidance=9.5, result_fol=result_fol):
|
| 91 |
if input_to_enhance is None:
|
| 92 |
input_to_enhance = generate(prompt, num_frames, image, model_name_stage1, model_name_stage2, seed, t, image_guidance)
|
|
|
|
| 1 |
import torch
|
| 2 |
+
# torch.jit.script = lambda f: f
|
| 3 |
# General
|
| 4 |
import os
|
| 5 |
from os.path import join as opj
|
| 6 |
import argparse
|
| 7 |
import datetime
|
| 8 |
from pathlib import Path
|
| 9 |
+
# import spaces
|
| 10 |
import gradio as gr
|
| 11 |
import tempfile
|
| 12 |
import yaml
|
|
|
|
| 56 |
# -------------------------
|
| 57 |
# ----- Functionality -----
|
| 58 |
# -------------------------
|
| 59 |
+
# @spaces.GPU(duration=120)
|
| 60 |
def generate(prompt, num_frames, image, model_name_stage1, model_name_stage2, seed, t, image_guidance, where_to_log=result_fol):
|
| 61 |
now = datetime.datetime.now()
|
| 62 |
name = prompt[:100].replace(" ", "_") + "_" + str(now.time()).replace(":", "_").replace(".", "_")
|
|
|
|
| 86 |
video_path = opj(where_to_log, name+".mp4")
|
| 87 |
return video_path
|
| 88 |
|
| 89 |
+
# @spaces.GPU(duration=400)
|
| 90 |
def enhance(prompt, input_to_enhance, num_frames=None, image=None, model_name_stage1=None, model_name_stage2=None, seed=33, t=50, image_guidance=9.5, result_fol=result_fol):
|
| 91 |
if input_to_enhance is None:
|
| 92 |
input_to_enhance = generate(prompt, num_frames, image, model_name_stage1, model_name_stage2, seed, t, image_guidance)
|