Spaces:
Runtime error
Runtime error
File size: 2,482 Bytes
a8328c7 09a2d4c a8328c7 09a2d4c a8328c7 09a2d4c a8328c7 09a2d4c a8328c7 09a2d4c a8328c7 09a2d4c a8328c7 d9716e5 a8328c7 |
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
import gradio as gr
nets=[
"fffiloni/Pix2Pix-Video",
"fffiloni/ControlNet-Video",
"fffiloni/x-decoder-video"
]
width="100%"
height="2500"
class NetLink:
x=""
def change(self,link):
ch = link.replace("/","-").replace("_","-")
return f"https://{ch}.hf.space"
n=NetLink()
def fn0():
return gr.Accordion.update(label=f"{nets[0]}",visible=True),gr.Accordion.update(label=f"{nets[1]}",visible=False),gr.Accordion.update(label=f"{nets[2]}",visible=False)
def fn1():
return gr.Accordion.update(label=f"{nets[0]}",visible=False),gr.Accordion.update(label=f"{nets[1]}",visible=True),gr.Accordion.update(label=f"{nets[2]}",visible=False)
def fn2():
return gr.Accordion.update(label=f"{nets[0]}",visible=False),gr.Accordion.update(label=f"{nets[1]}",visible=False),gr.Accordion.update(label=f"{nets[2]}",visible=True)
with gr.Blocks(css="sauce.css") as control_app:
gr.Markdown("""<center><h1>Video2Video Models Collection</h1><center>""")
gr.Markdown(f"""<center><h3>Find these AI Demos and more at <br><a href='https://hugggingface.co/spaces'>Huggingface Spaces</a></h3>""")
with gr.Box():
with gr.Row():
with gr.Column():
btn0 = gr.Button(f'{nets[0]}')
btn1 = gr.Button(f'{nets[1]}')
btn2 = gr.Button(f'{nets[2]}')
with gr.Accordion(label=f"{nets[0]}",visible=True) as a0:
gr.Markdown(f"""<center><h5>Find this Space at <a href='https://huggingface.co/spaces/{nets[0]}'>{nets[0]}</a></h5>""")
gr.HTML(f'''<center><iframe src="{n.change(nets[0])}" frameborder="0" width={width} height={height}></iframe><center>''')
with gr.Accordion(label=f"{nets[1]}",visible=False) as a1:
gr.Markdown(f"""<center><h5>Find this Space at <a href='https://huggingface.co/spaces/{nets[1]}'>{nets[1]}</a></h5>""")
gr.HTML(f'''<center><iframe src="{n.change(nets[1])}" frameborder="0" width={width} height={height}></iframe><center>''')
with gr.Accordion(label=f"{nets[2]}",visible=False) as a2:
gr.Markdown(f"""<center><h5>Find this Space at <a href='https://huggingface.co/spaces/{nets[2]}'>{nets[2]}</a></h5>""")
gr.HTML(f'''<center><iframe src="{n.change(nets[2])}" frameborder="0" width={width} height={height}></iframe><center>''')
btn0.click(fn0,None,[a0,a1,a2])
btn1.click(fn1,None,[a0,a1,a2])
btn2.click(fn2,None,[a0,a1,a2])
control_app.queue(concurrency_count=100).launch() |