Spaces:
Build error
Build error
Commit ·
d147789
1
Parent(s): 03cb796
update
Browse files26 unmodified lines2728293030313233304 unmodified lines33833934034134134234334434516 unmodified lines3623633643643653663673683683693703713726 unmodified lines37938038138138238338438514 unmodified lines4004014024024034044054068 unmodified lines41541641741741841942042126 unmodified lines
# if not os.path.exists('architecture.jpg'):os.system('wget https://huggingface.co/JingyeChen22/textdiffuser2-full-ft/tree/main/layout_planner_m1')# 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 lines new_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_image # return new_image return tuple(new_image) with gr.Blocks() as demo:
16 unmodified lines
<style> .scaled-image { transform: scale(0.75); transform: scale(1); } </style> <img src="https://i.ibb.co/q1hxH0N/architecture.jpg" alt="textdiffuser-2" class="scaled-image"> <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", type='filepath', value=f'./gray256.jpg', height=256, width=256) 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 lines button = gr.Button("Generate") with gr.Column(scale=1): output = gr.Image(label='Generated image') 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 lines
gr.HTML( """ <div style="text-align: justify; max-width: 1200px; margin: 20px auto;"> <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