Spaces:
Runtime error
Runtime error
import gradio as gr | |
from diffusers import DiffusionPipeline | |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0") | |
pipe.load_lora_weights("SvenN/sdxl-emoji") | |
def generate_image(prompt): | |
image = pipe(prompt).images[0] | |
return image | |
with gr.Blocks() as demo: | |
gr.Markdown("## Stable Diffusion XL Emoji Generator") | |
prompt = gr.Textbox(label="Enter prompt", placeholder="<s0><s1>", value="<s0><s1>") | |
image_output = gr.Image(label="Generated Image") | |
generate_button = gr.Button("Generate") | |
generate_button.click(fn=generate_image, inputs=prompt, outputs=image_output) | |
demo.launch() | |