Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
-
import
|
| 2 |
from diffusers import DiffusionPipeline
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
pipe.load_lora_weights("ovieyra21/yebama-sd15")
|
| 6 |
pipe.to('cuda')
|
| 7 |
|
| 8 |
-
@spaces.GPU
|
| 9 |
-
prompt = "yebama"
|
| 10 |
-
image = pipe(prompt).images[0]
|
| 11 |
def generate(prompt):
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
|
|
|
| 14 |
gr.Interface(
|
| 15 |
fn=generate,
|
| 16 |
-
inputs=gr.
|
| 17 |
-
outputs=gr.
|
| 18 |
).launch()
|
| 19 |
-
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
from diffusers import DiffusionPipeline
|
| 3 |
|
| 4 |
+
# Cargar el modelo
|
| 5 |
+
pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5")
|
| 6 |
pipe.load_lora_weights("ovieyra21/yebama-sd15")
|
| 7 |
pipe.to('cuda')
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
def generate(prompt):
|
| 10 |
+
# Generar la imagen
|
| 11 |
+
image = pipe(prompt).images[0]
|
| 12 |
+
return image
|
| 13 |
|
| 14 |
+
# Crear la interfaz de Gradio
|
| 15 |
gr.Interface(
|
| 16 |
fn=generate,
|
| 17 |
+
inputs=gr.Textbox(label="Escribe tu prompt"),
|
| 18 |
+
outputs=gr.Image(type="pil"),
|
| 19 |
).launch()
|
|
|