Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -56,36 +56,83 @@ def infer(prompt, seed=1, randomize_seed=False, num_inference_steps=28):
|
|
56 |
export_to_gif(split_image(image, 4), gif_name, fps=4)
|
57 |
|
58 |
return gif_name, image, seed
|
59 |
-
|
60 |
examples = [
|
61 |
-
"a
|
62 |
-
"
|
63 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
]
|
65 |
|
66 |
css = """
|
67 |
-
footer {
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
-
"""
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
with gr.Column(elem_id="col-container"):
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
|
90 |
result = gr.Image(label="Result", show_label=False)
|
91 |
result_full = gr.Image(label="Gif Strip", elem_id="strip")
|
|
|
56 |
export_to_gif(split_image(image, 4), gif_name, fps=4)
|
57 |
|
58 |
return gif_name, image, seed
|
59 |
+
|
60 |
examples = [
|
61 |
+
"a red panda playing with a bamboo stick in the snow",
|
62 |
+
"a astronaut breakdancing on the moon",
|
63 |
+
"a magical butterfly transforming into sparkles",
|
64 |
+
"a robot learning to paint like Van Gogh",
|
65 |
+
"a dragon hatching from a crystal egg",
|
66 |
+
"a time traveler stepping through a portal",
|
67 |
+
"a mermaid playing with bioluminescent fish",
|
68 |
+
"a steampunk clock with moving gears",
|
69 |
+
"a flower blooming in timelapse",
|
70 |
+
"a wizard casting a colorful spell"
|
71 |
]
|
72 |
|
73 |
css = """
|
74 |
+
footer {visibility: hidden}
|
75 |
+
|
76 |
+
#col-container {
|
77 |
+
max-width: 1200px;
|
78 |
+
margin: auto;
|
79 |
+
padding: 20px;
|
80 |
+
background-color: #ffffff;
|
81 |
+
border-radius: 20px;
|
82 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
83 |
+
}
|
84 |
+
|
85 |
+
.gr-button {
|
86 |
+
background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
|
87 |
+
border: none;
|
88 |
+
color: white;
|
89 |
+
font-weight: 600;
|
90 |
+
border-radius: 8px;
|
91 |
}
|
|
|
92 |
|
93 |
+
.gr-button:hover {
|
94 |
+
background: linear-gradient(45deg, #4ECDC4, #FF6B6B);
|
95 |
+
transform: translateY(-2px);
|
96 |
+
transition: all 0.3s ease;
|
97 |
+
}
|
98 |
+
|
99 |
+
.gr-input {
|
100 |
+
border-radius: 8px;
|
101 |
+
border: 2px solid #e0e0e0;
|
102 |
+
}
|
103 |
+
|
104 |
+
.gr-accordion {
|
105 |
+
border-radius: 8px;
|
106 |
+
background-color: #f8f9fa;
|
107 |
+
}
|
108 |
+
"""
|
109 |
|
110 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
111 |
+
gr.HTML("""
|
112 |
+
<div style="text-align: center; max-width: 800px; margin: 0 auto;">
|
113 |
+
<h1 style="font-size: 3rem; font-weight: 700; margin-bottom: 1rem;">
|
114 |
+
FLUX Animation Creator
|
115 |
+
</h1>
|
116 |
+
<p style="font-size: 1.2rem; color: #666; margin-bottom: 2rem;">
|
117 |
+
Create amazing animated GIFs with AI - Just describe what you want to see!
|
118 |
+
</p>
|
119 |
+
</div>
|
120 |
+
""")
|
121 |
|
122 |
with gr.Column(elem_id="col-container"):
|
123 |
+
with gr.Row():
|
124 |
+
prompt = gr.Text(
|
125 |
+
label="Your Animation Prompt",
|
126 |
+
show_label=True,
|
127 |
+
max_lines=1,
|
128 |
+
placeholder="Describe the animation you want to create...",
|
129 |
+
container=True,
|
130 |
+
elem_id="prompt-input"
|
131 |
+
)
|
132 |
+
|
133 |
+
run_button = gr.Button("✨ Generate", scale=0, variant="primary")
|
134 |
+
|
135 |
+
|
136 |
|
137 |
result = gr.Image(label="Result", show_label=False)
|
138 |
result_full = gr.Image(label="Gif Strip", elem_id="strip")
|