File size: 540 Bytes
e7e4532
 
9ec22f9
 
 
 
a1bd472
 
9ec22f9
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr

# Load the model
model = gr.load("models/stabilityai/stable-diffusion-3.5-large")

# Define a function to handle the model inference
def generate_image(prompt):
    return model(prompt=prompt)

# Define the Gradio interface
interface = gr.Interface(
    fn=generate_image,  # The prediction function
    inputs=[
        gr.Textbox(label="Prompt"),  # Input for the text prompt
    ],
    outputs=gr.Image(label="Generated Image")  # Output component for the generated image
)

# Launch the interface
interface.launch()