import gradio as gr from PIL import Image demo_inf_ofa = gr.Interface.load(name="spaces/ICML2022/OFA") #"spaces/freddyaboulton/blocks_inputs") #demo_inf_lama = gr.Interface.load(name="spaces/CVPR/lama-example") #gr.Blocks.load #img = gr.Interface.load("spaces/multimodalart/latentdiffusion")(ent[0],'50','256','256','1',10)[0] #assert demo_inf("Foo", "bar") == "Foo bar" def get_lama(img1, img2): Img1 = Image.open(img1) Img2 = Image.open(img2) img, mask = gr.Interface.load(name="spaces/CVPR/lama-example")(Img1, Img2, "automatic (U2net)") return img #def txt_fun(txt1, txt2): # return demo_inf(txt1, txt2) #original = Image.open("./c4.jpg") #output_img_path = demo_inf("./c4.jpg", fn_index=1) #output = Image.open(output_img_path) #assert original.size == output.size def img_fun1(img_in): return demo_inf(img_in) #, fn_index=1) #original = Image.open("./c4.jpg") #output_img_path = demo_inf("./c4.jpg", fn_index=1) #output = Image.open(output_img_path) #assert original.size == output.size def img_fun(img_in): original = Image.open("./c4.jpg") print("after line1") output_img_path = demo_inf("./c4.jpg", fn_index=1) print("after line1") output = Image.open(output_img_path) print("after line1") return output demo = gr.Blocks() with demo: gr.Markdown("