import gradio as gr from diffusers import DiffusionPipeline # Cargar el modelo pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5") pipe.load_lora_weights("ovieyra21/yebama-sd15") pipe.to('cuda') def generate(prompt): # Generar la imagen image = pipe(prompt).images[0] return image # Crear la interfaz de Gradio gr.Interface( fn=generate, inputs=gr.Textbox(label="Escribe tu prompt"), outputs=gr.Image(type="pil"), ).launch()