File size: 1,172 Bytes
34ba184
402761d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83baa38
402761d
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr


titulo="Texto a Imagen con Stable Diffusion 2.0"
descripcion = '<h2 style="text-align:center">Prompt en Español!</h2>'
articulo = """
El modelo usa: 
- Texto a Imagen [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2), 
- Para las traducciones [Helsinki-NLP](https://huggingface.co/Helsinki-NLP) 
\n ... y mucha magia ☺
"""

text_imagen =  gr.Interface.load("models/stabilityai/stable-diffusion-2")
text_translate = gr.Interface.load("models/Helsinki-NLP/opus-mt-es-en")

es_demo = gr.Series(text_translate, text_imagen, title=titulo, description = descripcion, article=articulo)

title = 'Text to Image with Stable difussion 2.0'
description = '<h2 style="text-align:center">Prompt in English!</h2>'
article = """
The model use: 
- text to Image [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2), 
\n ... and so magic ☺
"""
en_demo = gr.Interface.load("models/stabilityai/stable-diffusion-2", title=title, description=description, article=article)

demo = gr.TabbedInterface([en_demo, es_demo], ["Text-Image English", "Texto-Imagen Español"])

if __name__ == "__main__":
    demo.launch()