Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,30 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
titulo="Texto a Imagen con Stable Diffusion 2.0"
|
5 |
+
descripcion = '<h2 style="text-align:center">Prompt en Español!</h2>'
|
6 |
+
articulo = """
|
7 |
+
El modelo usa:
|
8 |
+
- Texto a Imagen [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2),
|
9 |
+
- Para las traducciones [Helsinki-NLP](https://huggingface.co/Helsinki-NLP)
|
10 |
+
\n ... y mucha magia ☺
|
11 |
+
"""
|
12 |
+
|
13 |
+
text_imagen = gr.Interface.load("models/stabilityai/stable-diffusion-2")
|
14 |
+
text_translate = gr.Interface.load("models/Helsinki-NLP/opus-mt-es-en")
|
15 |
+
|
16 |
+
es_demo = gr.Series(text_translate, text_imagen, title=titulo, description = descripcion, article=articulo)
|
17 |
+
|
18 |
+
title = 'Text to Image with Stable difussion 2.0'
|
19 |
+
description = '<h2 style="text-align:center">Prompt in English!</h2>'
|
20 |
+
article = """
|
21 |
+
The model use:
|
22 |
+
- text to Image [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2),
|
23 |
+
\n ... and so magic ☺
|
24 |
+
"""
|
25 |
+
en_demo = gr.Interface.load("models/stabilityai/stable-diffusion-2", title=title)
|
26 |
+
|
27 |
+
demo = gr.TabbedInterface([en_demo, es_demo], ["Text-Image English", "Texto-Imagen Español"])
|
28 |
+
|
29 |
+
if __name__ == "__main__":
|
30 |
+
demo.launch()
|