File size: 778 Bytes
0a66490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
import gradio as gr
from diffusers import DiffusionPipeline

# Load the DiffusionPipeline and LORA weights
pipeline = DiffusionPipeline.from_pretrained("stablediffusionapi/juggernaut-xl-v5")
pipeline.load_lora_weights("Kvikontent/kviimager2.0")

# Define the function to handle user input and generate the image
def generate_image(prompt):
    image = pipeline(prompt)
    return image

# Create a Gradio interface
iface = gr.Interface(
    fn=generate_image,
    inputs="text",
    outputs="image",
    title="KVIImager 2.0 Demo",
    description="Enter a prompt to generate an image"
)

# Add examples for the user input
examples = [
    "Sunset over the ocean",
    "Starry night sky"
]

iface.set_config(
    examples=examples
)

# Launch the Gradio interface
iface.launch()