File size: 767 Bytes
9de1b3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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"
)