Spaces:
Runtime error
Runtime error
Jasmeet Singh commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,16 +38,18 @@ def generate_image(prompt, strength, seed):
|
|
| 38 |
return Image.fromarray(output_image)
|
| 39 |
|
| 40 |
|
|
|
|
| 41 |
iface = gr.Interface(
|
| 42 |
fn=generate_image,
|
| 43 |
inputs=[
|
| 44 |
-
gr.Textbox(label="Prompt"),
|
| 45 |
-
gr.Slider(0, 1, step=0.01, label="Strength (For Image-2-Image): Strength = 1 (
|
| 46 |
-
gr.Number(label="Seed"),
|
| 47 |
],
|
| 48 |
-
outputs=gr.Image(label="Generated Image"),
|
| 49 |
title="Stable Diffusion Image Generator",
|
| 50 |
-
description="Generate images from text prompts using Stable Diffusion."
|
| 51 |
)
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
| 38 |
return Image.fromarray(output_image)
|
| 39 |
|
| 40 |
|
| 41 |
+
# Gradio interface with additional inputs for strength and seed
|
| 42 |
iface = gr.Interface(
|
| 43 |
fn=generate_image,
|
| 44 |
inputs=[
|
| 45 |
+
gr.Textbox(label="Prompt"), # Input text prompt
|
| 46 |
+
gr.Slider(0, 1, step=0.01, label="Strength (For Image-2-Image): Strength = 1 (More deviation), Strength = 0 (Less deviation)"), # Slider for strength
|
| 47 |
+
gr.Number(label="Seed"), # Seed for reproducibility
|
| 48 |
],
|
| 49 |
+
outputs=gr.Image(label="Generated Image"), # Output generated image
|
| 50 |
title="Stable Diffusion Image Generator",
|
| 51 |
+
description="Generate images from text prompts using Stable Diffusion."
|
| 52 |
)
|
| 53 |
|
| 54 |
+
# Launch the Gradio interface with public sharing enabled
|
| 55 |
+
iface.launch(share=True, debug=True)
|