Gradio API

#7
by Deadmon - opened

Hoe do I use the API properly?
its outputting a config and info but no file.
{"msg":"process_completed","output":{"error":"None"},"success":false}

from gradio_client import Client

client = Client("https://tencentarc-t2i-adapter-sdxl.hf.space/")
result = client.predict(
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png", # str (filepath or URL to image) in 'Input image' Image component
"Howdy!", # str in 'Prompt' Textbox component
"Howdy!", # str in 'Negative prompt' Textbox component
"canny", # str (Option from: ['canny', 'sketch', 'lineart', 'depth-midas', 'depth-zoe', 'openpose']) in 'Adapter name' Dropdown component
"(No style)", # str (Option from: ['(No style)', 'Cinematic', '3D Model', 'Anime', 'Digital Art', 'Photographic', 'Pixel art', 'Fantasy art', 'Neonpunk', 'Manga']) in 'Style' Dropdown component
1, # int | float (numeric value between 1 and 50) in 'Number of steps' Slider component
0.1, # int | float (numeric value between 0.1 and 30.0) in 'Guidance scale' Slider component
0.5, # int | float (numeric value between 0.5 and 1) in 'Adapter conditioning scale' Slider component
0.5, # int | float (numeric value between 0.5 and 1.0) in 'Adapter conditioning factor' Slider component
0, # int | float (numeric value between 0 and 2147483647) in 'Seed' Slider component
True, # bool in 'Apply preprocess' Checkbox component
api_name="/run"
)
print(result)

Sign up or log in to comment