DRDELATV commited on
Commit
5f884ab
verified
1 Parent(s): cb40a54
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -8,23 +8,16 @@ pipe = StableDiffusionPipeline.from_pretrained(
8
  revision="fp16" if torch.cuda.is_available() else "main"
9
  ).to("cuda" if torch.cuda.is_available() else "cpu")
10
 
11
- def generar_imagen(prompt, estilo):
12
- estilos = {
13
- "M茅dico": "representado con iluminaci贸n cl铆nica y ambiente hospitalario",
14
- "Ciberpunk": "estilo ciberpunk con luces de ne贸n, dist贸pico, futurista",
15
- "Anime": "estilo anime, colores vibrantes, personajes kawaii",
16
- }
17
- prompt_completo = f"{prompt}, {estilos.get(estilo, '')}"
18
- image = pipe(prompt_completo).images[0]
19
  return image
20
 
21
  demo = gr.Interface(
22
  fn=generar_imagen,
23
- inputs=[
24
- gr.Textbox(label="Tu idea"),
25
- gr.Dropdown(choices=["M茅dico", "Ciberpunk", "Anime"], label="Estilo de Arte")
26
- ],
27
- outputs="image"
28
  )
29
 
30
  demo.launch()
 
8
  revision="fp16" if torch.cuda.is_available() else "main"
9
  ).to("cuda" if torch.cuda.is_available() else "cpu")
10
 
11
+ def generar_imagen(prompt):
12
+ image = pipe(prompt).images[0]
 
 
 
 
 
 
13
  return image
14
 
15
  demo = gr.Interface(
16
  fn=generar_imagen,
17
+ inputs=gr.Textbox(label="Descripci贸n de la imagen"),
18
+ outputs="image",
19
+ title="Generador de Im谩genes - DRDELATV",
20
+ description="Escribe una descripci贸n y genera una imagen con IA usando Stable Diffusion"
 
21
  )
22
 
23
  demo.launch()