Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from diffusers import DiffusionPipeline | |
| import torch | |
| # Gradio demo function for greeting | |
| def greet(name): | |
| return "Hello " + name + "!!" | |
| # Set up the Gradio interface | |
| demo = gr.Interface(fn=greet, inputs="text", outputs="text") | |
| demo.launch(share=True) | |
| # Load the Stable Diffusion pipeline | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "stabilityai/stable-diffusion-xl-base-1.0", | |
| torch_dtype=torch.float16 | |
| ).to("cuda") | |
| # Load the LoRA weights | |
| pipeline.load_lora_weights( | |
| "ostris/ikea-instructions-lora-sdxl", | |
| weight_name="ikea_instructions_xl_v1_5.safetensors", | |
| adapter_name="ikea" | |
| ) | |
| pipeline.load_lora_weights( | |
| "lordjia/by-feng-zikai", | |
| weight_name="fengzikai_v1.0_XL.safetensors", | |
| adapter_name="feng" | |
| ) | |