Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,21 +1,25 @@
|
|
| 1 |
-
# Let's re-evaluate the implementation using the guide for making predictions with the Gradio client
|
| 2 |
import gradio as gr
|
| 3 |
-
from
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
return result
|
| 10 |
|
| 11 |
# Create the Gradio interface
|
| 12 |
-
|
| 13 |
fn=enhance_image,
|
| 14 |
-
inputs=
|
|
|
|
|
|
|
|
|
|
| 15 |
outputs=gr.Image(type="pil", label="Enhanced Image"),
|
| 16 |
-
title="
|
| 17 |
-
description="Upload an image to enhance
|
| 18 |
)
|
| 19 |
|
| 20 |
-
# Launch the
|
| 21 |
-
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from gradio_client import Client
|
| 3 |
|
| 4 |
+
# Initialize the client
|
| 5 |
+
client = Client("radames/Enhance-This-HiDiffusion-SDXL")
|
| 6 |
+
|
| 7 |
+
def enhance_image(image, prompt):
|
| 8 |
+
# Use the client to predict the result
|
| 9 |
+
result = client.predict(image, prompt, api_name="/predict")
|
| 10 |
return result
|
| 11 |
|
| 12 |
# Create the Gradio interface
|
| 13 |
+
iface = gr.Interface(
|
| 14 |
fn=enhance_image,
|
| 15 |
+
inputs=[
|
| 16 |
+
gr.Image(type="pil", label="Input Image"),
|
| 17 |
+
gr.Textbox(lines=2, placeholder="Enter prompt here", label="Prompt")
|
| 18 |
+
],
|
| 19 |
outputs=gr.Image(type="pil", label="Enhanced Image"),
|
| 20 |
+
title="Image Enhancement with Text Prompt",
|
| 21 |
+
description="Upload an image and provide a text prompt to enhance the image using HiDiffusion SDXL."
|
| 22 |
)
|
| 23 |
|
| 24 |
+
# Launch the interface
|
| 25 |
+
iface.launch()
|