Spaces:
Runtime error
Runtime error
File size: 1,350 Bytes
c0bed6d ef7e565 c0bed6d 9047378 c0bed6d 7b9ae35 460ed53 c0bed6d 6ea49db 35df457 c0bed6d 460ed53 5c01d2a 9e056d6 c0bed6d |
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 27 28 29 30 31 32 33 34 35 |
from gradio_client import Client
import gradio as gr
# Create a client for the other space
client = Client("radames/Enhance-This-HiDiffusion-SDXL")
# Define your interface function
def my_interface(input_image, prompt="This is a beautiful scenery", negative_prompt="blurry, ugly, duplicate, poorly drawn, deformed, mosaic", seed=1415926535897932, guidance_scale=8.5, scale=2, controlnet_conditioning_scale=0.5, strength=1.0, controlnet_start=0.0, controlnet_end=1.0, guassian_sigma=2.0, intensity_threshold=3):
# Call the other space's predict function
result = client.predict(
input_image=input_image,
prompt=prompt,
negative_prompt=negative_prompt,
seed=seed,
guidance_scale=guidance_scale,
scale=scale,
controlnet_conditioning_scale=controlnet_conditioning_scale,
strength=strength,
controlnet_start=controlnet_start,
controlnet_end=controlnet_end,
guassian_sigma=guassian_sigma,
intensity_threshold=intensity_threshold,
api_name="/predict"
)
# Return only the first image from the result
return result[0][0]
# Define your Gradio interface
iface = gr.Interface(fn=my_interface,
inputs=gr.Image(),
outputs=gr.Image())
# Launch your Gradio interface
iface.launch() |