import gradio as gr | |
from gradio_client import Client, file | |
# def greet(name, intensity): | |
# return "Hello, " + name + "!" * int(intensity) | |
def test(text): | |
client = Client("stabilityai/stable-fast-3d") | |
# result = client.predict( | |
# input_image=file('https://stabilityai-stable-fast-3d.hf.space/file=/tmp/gradio/cedf71215ac1d8f6d44cd9cc94a65c5c2b5b76b0/banana.jpg'), | |
# foreground_ratio=0.85, | |
# api_name="/run_button" | |
# ) | |
result = client.predict( | |
image=file('https://stabilityai-stable-fast-3d.hf.space/file=/tmp/gradio/cedf71215ac1d8f6d44cd9cc94a65c5c2b5b76b0/banana.jpg'), | |
fr=0.85, | |
api_name="/requires_bg_remove" | |
) | |
return result | |
# demo = gr.Interface( | |
# fn=greet, | |
# inputs=["text", "slider"], | |
# outputs=["text"], | |
# ) | |
demo = gr.Interface( | |
fn=test, | |
inputs=["text"], | |
outputs=["text"], | |
) | |
demo.launch(share=True) | |