File size: 792 Bytes
ef7e565
a0132bf
2eaf831
a0132bf
 
 
 
 
02ef30b
 
2eaf831
 
a0132bf
2eaf831
a0132bf
c7a6660
 
a0132bf
c7a6660
a0132bf
 
2eaf831
 
a0132bf
 
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
import gradio as gr
from gradio_client import Client

# Initialize the client
client = Client("radames/Enhance-This-HiDiffusion-SDXL")

def enhance_image(image, prompt):
    # Use the client to predict the result
    result = client.predict(image, prompt, api_name="/predict")
    return result

# Create the Gradio interface
iface = gr.Interface(
    fn=enhance_image,
    inputs=[
        gr.inputs.Image(type="pil", label="Input Image"),
        gr.inputs.Textbox(lines=2, placeholder="Enter prompt here", label="Prompt")
    ],
    outputs=gr.outputs.Image(type="pil", label="Enhanced Image"),
    title="Image Enhancement with Text Prompt",
    description="Upload an image and provide a text prompt to enhance the image using HiDiffusion SDXL."
)

# Launch the interface
iface.launch()