Spaces:
Paused
Paused
Sylvain Filoni
commited on
Commit
β’
0ac1d72
1
Parent(s):
e5b0363
added footer
Browse files
app.py
CHANGED
@@ -92,6 +92,25 @@ def convert_mp3_to_wav(mp3_filepath):
|
|
92 |
css = """
|
93 |
#col-container {max-width: 550px; margin-left: auto; margin-right: auto;}
|
94 |
a {text-decoration-line: underline; font-weight: 600;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
.animate-spin {
|
96 |
animation: spin 1s linear infinite;
|
97 |
}
|
@@ -121,6 +140,17 @@ a {text-decoration-line: underline; font-weight: 600;}
|
|
121 |
}
|
122 |
"""
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
with gr.Blocks(css=css) as demo:
|
125 |
with gr.Column(elem_id="col-container"):
|
126 |
gr.HTML("""<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
@@ -147,7 +177,7 @@ with gr.Blocks(css=css) as demo:
|
|
147 |
input_img = gr.Image(type="filepath", elem_id="input-img")
|
148 |
with gr.Row():
|
149 |
track_duration = gr.Slider(minimum=20, maximum=120, value=30, step=5, label="Track duration", elem_id="duration-inp")
|
150 |
-
gen_intensity = gr.
|
151 |
generate = gr.Button("Generate Music from Image")
|
152 |
|
153 |
music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output")
|
@@ -156,7 +186,8 @@ with gr.Blocks(css=css) as demo:
|
|
156 |
community_icon = gr.HTML(community_icon_html, visible=False)
|
157 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
158 |
share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
|
159 |
-
|
|
|
160 |
generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity], outputs=[music_output, share_button, community_icon, loading_icon], api_name="i2m")
|
161 |
share_button.click(None, [], [], _js=share_js)
|
162 |
|
|
|
92 |
css = """
|
93 |
#col-container {max-width: 550px; margin-left: auto; margin-right: auto;}
|
94 |
a {text-decoration-line: underline; font-weight: 600;}
|
95 |
+
.footer {
|
96 |
+
margin-bottom: 45px;
|
97 |
+
margin-top: 10px;
|
98 |
+
text-align: center;
|
99 |
+
border-bottom: 1px solid #e5e5e5;
|
100 |
+
}
|
101 |
+
.footer>p {
|
102 |
+
font-size: .8rem;
|
103 |
+
display: inline-block;
|
104 |
+
padding: 0 10px;
|
105 |
+
transform: translateY(10px);
|
106 |
+
background: white;
|
107 |
+
}
|
108 |
+
.dark .footer {
|
109 |
+
border-color: #303030;
|
110 |
+
}
|
111 |
+
.dark .footer>p {
|
112 |
+
background: #0b0f19;
|
113 |
+
}
|
114 |
.animate-spin {
|
115 |
animation: spin 1s linear infinite;
|
116 |
}
|
|
|
140 |
}
|
141 |
"""
|
142 |
|
143 |
+
article = """
|
144 |
+
|
145 |
+
<div class="footer">
|
146 |
+
<p>
|
147 |
+
|
148 |
+
Demo by π€ <a href="https://twitter.com/fffiloni" target="_blank">Sylvain Filoni</a>
|
149 |
+
</p>
|
150 |
+
</div>
|
151 |
+
|
152 |
+
"""
|
153 |
+
|
154 |
with gr.Blocks(css=css) as demo:
|
155 |
with gr.Column(elem_id="col-container"):
|
156 |
gr.HTML("""<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
|
|
177 |
input_img = gr.Image(type="filepath", elem_id="input-img")
|
178 |
with gr.Row():
|
179 |
track_duration = gr.Slider(minimum=20, maximum=120, value=30, step=5, label="Track duration", elem_id="duration-inp")
|
180 |
+
gen_intensity = gr.Radio(choices=["low", "medium", "high"], value="high", label="Complexity", show_label=False)
|
181 |
generate = gr.Button("Generate Music from Image")
|
182 |
|
183 |
music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output")
|
|
|
186 |
community_icon = gr.HTML(community_icon_html, visible=False)
|
187 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
188 |
share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
|
189 |
+
|
190 |
+
gr.HTML(article)
|
191 |
generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity], outputs=[music_output, share_button, community_icon, loading_icon], api_name="i2m")
|
192 |
share_button.click(None, [], [], _js=share_js)
|
193 |
|