diego2554 commited on
Commit
8e160c1
1 Parent(s): d112dfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -2,7 +2,6 @@
2
  #gr.Interface.load("models/goofyai/3d_render_style_xl").launch()
3
  import gradio as gr
4
  from diffusers import DiffusionPipeline
5
- from PIL import Image
6
 
7
  # Cargar el modelo y los pesos
8
  pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
@@ -11,10 +10,9 @@ pipeline.load_lora_weights("goofyai/3d_render_style_xl")
11
  # Función para generar imágenes a partir de texto
12
  def generate_image(input_text):
13
  result = pipeline.generate(input_text)
14
- image = Image.fromarray(result)
15
- return image
16
 
17
- # Crear una interfaz de Gradio
18
  iface = gr.Interface(
19
  fn=generate_image,
20
  inputs="text",
@@ -24,4 +22,4 @@ iface = gr.Interface(
24
  )
25
 
26
  # Ejecutar la interfaz
27
- iface.launch()
 
2
  #gr.Interface.load("models/goofyai/3d_render_style_xl").launch()
3
  import gradio as gr
4
  from diffusers import DiffusionPipeline
 
5
 
6
  # Cargar el modelo y los pesos
7
  pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
 
10
  # Función para generar imágenes a partir de texto
11
  def generate_image(input_text):
12
  result = pipeline.generate(input_text)
13
+ return result
 
14
 
15
+ # Crear una interfaz Gradio
16
  iface = gr.Interface(
17
  fn=generate_image,
18
  inputs="text",
 
22
  )
23
 
24
  # Ejecutar la interfaz
25
+ iface.launch()