Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ import os
|
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
from moviepy.editor import *
|
| 6 |
-
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 7 |
|
| 8 |
from diffusers import StableDiffusionInstructPix2PixPipeline
|
| 9 |
import torch
|
|
@@ -129,7 +128,7 @@ def infer(prompt,video_in, seed_in, trim_value):
|
|
| 129 |
final_vid = create_video(result_frames, fps)
|
| 130 |
print("finished !")
|
| 131 |
|
| 132 |
-
return final_vid
|
| 133 |
|
| 134 |
title = """
|
| 135 |
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
|
@@ -180,7 +179,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
| 180 |
gr.HTML(title)
|
| 181 |
with gr.Row():
|
| 182 |
with gr.Column():
|
| 183 |
-
video_inp = gr.Video(label="Video source",
|
| 184 |
prompt = gr.Textbox(label="Prompt", placeholder="enter prompt", show_label=False, elem_id="prompt-in")
|
| 185 |
with gr.Row():
|
| 186 |
seed_inp = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, value=123456)
|
|
@@ -192,14 +191,9 @@ with gr.Blocks(css='style.css') as demo:
|
|
| 192 |
work with longer videos / skip the queue:
|
| 193 |
""", elem_id="duplicate-container")
|
| 194 |
submit_btn = gr.Button("Generate Pix2Pix video")
|
| 195 |
-
|
| 196 |
-
with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
| 197 |
-
community_icon = gr.HTML(community_icon_html)
|
| 198 |
-
loading_icon = gr.HTML(loading_icon_html)
|
| 199 |
-
share_button = gr.Button("Share to community", elem_id="share-btn")
|
| 200 |
|
| 201 |
inputs = [prompt,video_inp,seed_inp, trim_in]
|
| 202 |
-
outputs = [video_out
|
| 203 |
|
| 204 |
#ex = gr.Examples(
|
| 205 |
# [
|
|
@@ -215,7 +209,6 @@ with gr.Blocks(css='style.css') as demo:
|
|
| 215 |
gr.HTML(article)
|
| 216 |
|
| 217 |
submit_btn.click(infer, inputs, outputs)
|
| 218 |
-
share_button.click(None, [], [], _js=share_js)
|
| 219 |
|
| 220 |
|
| 221 |
|
|
|
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
from moviepy.editor import *
|
|
|
|
| 6 |
|
| 7 |
from diffusers import StableDiffusionInstructPix2PixPipeline
|
| 8 |
import torch
|
|
|
|
| 128 |
final_vid = create_video(result_frames, fps)
|
| 129 |
print("finished !")
|
| 130 |
|
| 131 |
+
return final_vid
|
| 132 |
|
| 133 |
title = """
|
| 134 |
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
|
|
|
| 179 |
gr.HTML(title)
|
| 180 |
with gr.Row():
|
| 181 |
with gr.Column():
|
| 182 |
+
video_inp = gr.Video(label="Video source", sources=["upload"], elem_id="input-vid")
|
| 183 |
prompt = gr.Textbox(label="Prompt", placeholder="enter prompt", show_label=False, elem_id="prompt-in")
|
| 184 |
with gr.Row():
|
| 185 |
seed_inp = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, value=123456)
|
|
|
|
| 191 |
work with longer videos / skip the queue:
|
| 192 |
""", elem_id="duplicate-container")
|
| 193 |
submit_btn = gr.Button("Generate Pix2Pix video")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
|
| 195 |
inputs = [prompt,video_inp,seed_inp, trim_in]
|
| 196 |
+
outputs = [video_out]
|
| 197 |
|
| 198 |
#ex = gr.Examples(
|
| 199 |
# [
|
|
|
|
| 209 |
gr.HTML(article)
|
| 210 |
|
| 211 |
submit_btn.click(infer, inputs, outputs)
|
|
|
|
| 212 |
|
| 213 |
|
| 214 |
|