Spaces:
Build error
Build error
Commit ·
f5f6fef
1
Parent(s): 2af8ebe
update
Browse files386 unmodified lines3873883893903913903913923933943953963973923933943953963973983994004014025 unmodified lines408409410409411412413414386 unmodified lines keywords = gr.Textbox(label="(Optional) Input your keywords here. Keywords should bu seperate by / (e.g., keyword1/keyword2/...)", placeholder="keyword1/keyword2")
# 这里加一个会话框
with gr.Accordion("(Optional) Template - Click to paint", open=False): 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="Keyword", value='input_keyword') redo = gr.Button(value='Redo - Cancel the last keyword') # 如何给b绑定事件 undo = gr.Button(value='Undo - Clear the canvas') # 如何给b绑定事件 skip_button = gr.Button(value='Skip - Operate next keyword') # 如何给b绑定事件 with gr.Row(): with gr.Column(scale=1): i = gr.Image(label="Canvas", type='filepath', value=f'./gray256.jpg', height=256, width=256) with gr.Column(scale=1): t = gr.Textbox(label="Keyword", value='input_keyword') redo = gr.Button(value='Redo - Cancel the last keyword') # 如何给b绑定事件 undo = gr.Button(value='Undo - Clear the canvas') # 如何给b绑定事件 skip_button = gr.Button(value='Skip - Operate next keyword') # 如何给b绑定事件
i.select(get_pixels,[i,t],[i]) redo.click(exe_redo, [i,t],[i])5 unmodified lines slider_guidance = gr.Slider(minimum=1, maximum=9, value=7.5, step=0.5, label="Scale of classifier-free guidance", info="The scale of classifier-free guidance and is set to 7.5 in default.") slider_batch = gr.Slider(minimum=1, maximum=4, value=4, step=1, label="Batch size", info="The number of images to be sampled.") slider_temperature = gr.Slider(minimum=0.1, maximum=2, value=0.7, step=0.1, label="Temperature", info="Control the diversity of layout planner. Higher value indicates more diversity.") slider_natural = gr.Checkbox(label="Natural image generation", bool=False, info="The text position and content info will not be incorporated.") slider_natural = gr.Checkbox(label="Natural image generation", value=False, info="The text position and content info will not be incorporated.") slider_seed = gr.Slider(minimum=1, maximum=10000, label="Seed", randomize=True) button = gr.Button("Generate") app.py+11-9