Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ MORE = """ ## TRY Other Models
|
|
11 |
client = Client("KingNish/Instant-Video")
|
12 |
|
13 |
# Function
|
14 |
-
def generate_image(prompt, base="
|
15 |
try:
|
16 |
result = client.predict(
|
17 |
prompt=prompt,
|
@@ -31,32 +31,26 @@ def generate_image(prompt, base="Realistic", motion="", step=8, progress=gr.Prog
|
|
31 |
|
32 |
# Gradio Interface
|
33 |
with gr.Blocks(css="style.css") as demo:
|
34 |
-
|
35 |
-
"<h1><center>Instant⚡Video</center></h1>" +
|
36 |
-
"<p><center><span style='color: red;'>You may change the steps from 4 to 8, if you didn't get satisfied results.</center></p>" +
|
37 |
-
"<p><center><strong>First Video Generating takes time then Videos generate faster.</p>" +
|
38 |
-
"<p><center>To get best results Make Sure to Write prompts in style as Given in Examples</center></p>" +
|
39 |
-
"<p><a href='https://huggingface.co/spaces/KingNish/Instant-Video/discussions/1'>Must Share your Best Results with Community - Click HERE</a></p>"
|
40 |
-
)
|
41 |
with gr.Group():
|
42 |
with gr.Row():
|
43 |
prompt = gr.Textbox(
|
44 |
-
label='
|
45 |
)
|
46 |
with gr.Row():
|
47 |
select_base = gr.Dropdown(
|
48 |
-
label='
|
49 |
choices=[
|
50 |
"Cartoon",
|
51 |
"Realistic",
|
52 |
"3d",
|
53 |
"Anime",
|
54 |
],
|
55 |
-
value="
|
56 |
interactive=True
|
57 |
)
|
58 |
select_motion = gr.Dropdown(
|
59 |
-
label='
|
60 |
choices=[
|
61 |
("Default", ""),
|
62 |
("Zoom in", "guoyww/animatediff-motion-lora-zoom-in"),
|
@@ -68,16 +62,18 @@ with gr.Blocks(css="style.css") as demo:
|
|
68 |
("Roll left", "guoyww/animatediff-motion-lora-rolling-anticlockwise"),
|
69 |
("Roll right", "guoyww/animatediff-motion-lora-rolling-clockwise"),
|
70 |
],
|
71 |
-
value="
|
72 |
interactive=True
|
73 |
)
|
74 |
select_step = gr.Dropdown(
|
75 |
-
label='
|
76 |
choices=[
|
77 |
('1-Step', 1),
|
78 |
('2-Step', 2),
|
79 |
('4-Step', 4),
|
80 |
('8-Step', 8),
|
|
|
|
|
81 |
],
|
82 |
value=4,
|
83 |
interactive=True
|
@@ -87,7 +83,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
87 |
variant='primary'
|
88 |
)
|
89 |
video = gr.Video(
|
90 |
-
label='
|
91 |
autoplay=True,
|
92 |
height=512,
|
93 |
width=512,
|
@@ -122,4 +118,4 @@ with gr.Blocks(css="style.css") as demo:
|
|
122 |
cache_examples=True,
|
123 |
)
|
124 |
|
125 |
-
demo.queue().launch()
|
|
|
11 |
client = Client("KingNish/Instant-Video")
|
12 |
|
13 |
# Function
|
14 |
+
def generate_image(prompt, base="Anime", motion="", step=8, progress=gr.Progress()):
|
15 |
try:
|
16 |
result = client.predict(
|
17 |
prompt=prompt,
|
|
|
31 |
|
32 |
# Gradio Interface
|
33 |
with gr.Blocks(css="style.css") as demo:
|
34 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
with gr.Group():
|
36 |
with gr.Row():
|
37 |
prompt = gr.Textbox(
|
38 |
+
label='Описание'
|
39 |
)
|
40 |
with gr.Row():
|
41 |
select_base = gr.Dropdown(
|
42 |
+
label='Стиль',
|
43 |
choices=[
|
44 |
"Cartoon",
|
45 |
"Realistic",
|
46 |
"3d",
|
47 |
"Anime",
|
48 |
],
|
49 |
+
value="Anime",
|
50 |
interactive=True
|
51 |
)
|
52 |
select_motion = gr.Dropdown(
|
53 |
+
label='Движение',
|
54 |
choices=[
|
55 |
("Default", ""),
|
56 |
("Zoom in", "guoyww/animatediff-motion-lora-zoom-in"),
|
|
|
62 |
("Roll left", "guoyww/animatediff-motion-lora-rolling-anticlockwise"),
|
63 |
("Roll right", "guoyww/animatediff-motion-lora-rolling-clockwise"),
|
64 |
],
|
65 |
+
value="",
|
66 |
interactive=True
|
67 |
)
|
68 |
select_step = gr.Dropdown(
|
69 |
+
label='Шаги вывода',
|
70 |
choices=[
|
71 |
('1-Step', 1),
|
72 |
('2-Step', 2),
|
73 |
('4-Step', 4),
|
74 |
('8-Step', 8),
|
75 |
+
('8-Step', 10),
|
76 |
+
('8-Step', 12),
|
77 |
],
|
78 |
value=4,
|
79 |
interactive=True
|
|
|
83 |
variant='primary'
|
84 |
)
|
85 |
video = gr.Video(
|
86 |
+
label='Сгенерированое видео',
|
87 |
autoplay=True,
|
88 |
height=512,
|
89 |
width=512,
|
|
|
118 |
cache_examples=True,
|
119 |
)
|
120 |
|
121 |
+
demo.queue(max_size=50).launch()
|