Spaces:
Build error
Build error
Commit ·
d147789
1
Parent(s): 03cb796
update
Browse files26 unmodified lines27282930313233304 unmodified lines33833934034134234334416 unmodified lines3613623633643653663673683693703716 unmodified lines37837938038138238338414 unmodified lines3994004014024034044058 unmodified lines41441541641741841942026 unmodified lines# if not os.path.exists('architecture.jpg'):os.system('wget https://huggingface.co/JingyeChen22/textdiffuser2-full-ft/tree/main/layout_planner_m1')# if not os.path.exists('gray256.jpg'):# os.system('wget https://huggingface.co/JingyeChen22/textdiffuser2-full-ft/blob/main/gray256.jpg')304 unmodified linesnew_image.paste(image, (col*width, row*height))# new_image.save(f'{args.output_dir}/pred_img_{sample_index}_{args.local_rank}.jpg')results.insert(0, new_image)return new_imagewith gr.Blocks() as demo:16 unmodified lines<style>.scaled-image {transform: scale(0.75);}</style><img src="https://i.ibb.co/q1hxH0N/architecture.jpg" alt="textdiffuser-2" class="scaled-image"></div>""")6 unmodified lines# 这里加一个会话框with gr.Row():with gr.Column(scale=1):i = gr.Image(label="Template", type='filepath', value=f'./gray256.jpg', height=256, width=256)with gr.Column(scale=1):t = gr.Textbox(label="Template", placeholder='keyword')redo = gr.Button(value='Redo - Cancel the last keyword') # 如何给b绑定事件14 unmodified linesbutton = gr.Button("Generate")with gr.Column(scale=1):output = gr.Image(label='Generated image')# with gr.Accordion("Intermediate results", open=False):# gr.Markdown("Layout, segmentation mask, and details of segmentation mask from left to right.")8 unmodified linesgr.HTML("""<div style="text-align: justify; max-width: 1200px; margin: 20px auto;"><h3 style="font-weight: 450; font-size: 0.8rem; margin: 0rem"><b>Version</b>: 1.0</h3>26 unmodified lines27282930313233304 unmodified lines33833934034134234334434516 unmodified lines3623633643653663673683693703713726 unmodified lines37938038138238338438514 unmodified lines4004014024034044054068 unmodified lines41541641741841942042126 unmodified lines# if not os.path.exists('architecture.jpg'):# os.system('wget https://huggingface.co/JingyeChen22/textdiffuser2-full-ft/tree/main/layout_planner_m1')# if not os.path.exists('gray256.jpg'):# os.system('wget https://huggingface.co/JingyeChen22/textdiffuser2-full-ft/blob/main/gray256.jpg')304 unmodified linesnew_image.paste(image, (col*width, row*height))# new_image.save(f'{args.output_dir}/pred_img_{sample_index}_{args.local_rank}.jpg')results.insert(0, new_image)# return new_imagereturn tuple(new_image)with gr.Blocks() as demo:16 unmodified lines<style>.scaled-image {transform: scale(1);}</style><img src="https://i.ibb.co/vmrXRb5/architecture.jpg" alt="textdiffuser-2" class="scaled-image"></div>""")6 unmodified lines# 这里加一个会话框with gr.Row():with gr.Column(scale=1):i = gr.Image(label="Template (Click to paint)", type='filepath', value=f'./gray256.jpg', height=256, width=256)with gr.Column(scale=1):t = gr.Textbox(label="Template", placeholder='keyword')redo = gr.Button(value='Redo - Cancel the last keyword') # 如何给b绑定事件14 unmodified linesbutton = gr.Button("Generate")with gr.Column(scale=1):output = gr.Gallery(label='Generated image')# with gr.Accordion("Intermediate results", open=False):# gr.Markdown("Layout, segmentation mask, and details of segmentation mask from left to right.")8 unmodified linesgr.HTML("""<div style="text-align: justify; max-width: 1100px; margin: 20px auto;"><h3 style="font-weight: 450; font-size: 0.8rem; margin: 0rem"><b>Version</b>: 1.0</h3>
app.py+8-7