Commit
•
af5f241
1
Parent(s):
cfe6f4e
Update app.py
Browse files
app.py
CHANGED
@@ -290,6 +290,7 @@ def generate_video_from_text(
|
|
290 |
|
291 |
|
292 |
def generate_video_from_image(
|
|
|
293 |
image_path,
|
294 |
prompt="",
|
295 |
enhance_prompt_toggle=False,
|
@@ -303,6 +304,9 @@ def generate_video_from_image(
|
|
303 |
num_frames=121,
|
304 |
progress=gr.Progress(),
|
305 |
):
|
|
|
|
|
|
|
306 |
|
307 |
print("Height: ", height)
|
308 |
print("Width: ", width)
|
@@ -616,6 +620,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
|
616 |
img2vid_generate.click(
|
617 |
fn=generate_video_from_image,
|
618 |
inputs=[
|
|
|
619 |
img2vid_image,
|
620 |
img2vid_prompt,
|
621 |
img2vid_enhance_toggle,
|
|
|
290 |
|
291 |
|
292 |
def generate_video_from_image(
|
293 |
+
secret_token="",
|
294 |
image_path,
|
295 |
prompt="",
|
296 |
enhance_prompt_toggle=False,
|
|
|
304 |
num_frames=121,
|
305 |
progress=gr.Progress(),
|
306 |
):
|
307 |
+
if secret_token != SECRET_TOKEN:
|
308 |
+
raise gr.Error(
|
309 |
+
f'Invalid secret token. Please fork the original space if you want to use it for yourself.')
|
310 |
|
311 |
print("Height: ", height)
|
312 |
print("Width: ", width)
|
|
|
620 |
img2vid_generate.click(
|
621 |
fn=generate_video_from_image,
|
622 |
inputs=[
|
623 |
+
secret_token,
|
624 |
img2vid_image,
|
625 |
img2vid_prompt,
|
626 |
img2vid_enhance_toggle,
|