Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
# Load the model
|
4 |
+
model = gr.load("models/stabilityai/stable-diffusion-3.5-large")
|
5 |
+
|
6 |
+
# Define a function to handle the model inference
|
7 |
+
def generate_image(prompt, num_inference_steps):
|
8 |
+
return model(prompt=prompt, num_inference_steps=num_inference_steps)
|
9 |
+
|
10 |
+
# Define the Gradio interface
|
11 |
+
interface = gr.Interface(
|
12 |
+
fn=generate_image, # The prediction function
|
13 |
+
inputs=[
|
14 |
+
gr.Textbox(label="Prompt"), # Input for the text prompt
|
15 |
+
gr.Slider(minimum=1, maximum=100, default=50, label="Number of Inference Steps") # Slider for steps
|
16 |
+
],
|
17 |
+
outputs=gr.Image(label="Generated Image") # Output component for the generated image
|
18 |
+
)
|
19 |
+
|
20 |
+
# Launch the interface
|
21 |
+
interface.launch()
|