mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
+1
-1
@@ -1 +1 @@
|
|||||||
version = '2.1.5'
|
version = '2.1.06'
|
||||||
|
|||||||
@@ -78,26 +78,46 @@ with shared.gradio_root:
|
|||||||
gr.HTML('<a href="https://github.com/lllyasviel/Fooocus/discussions/390">\U0001F4D4 Document</a>')
|
gr.HTML('<a href="https://github.com/lllyasviel/Fooocus/discussions/390">\U0001F4D4 Document</a>')
|
||||||
with gr.TabItem(label='Image Prompt') as ip_tab:
|
with gr.TabItem(label='Image Prompt') as ip_tab:
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
|
ip_images = []
|
||||||
|
ip_types = []
|
||||||
|
ip_stops = []
|
||||||
|
ip_weights = []
|
||||||
ip_ctrls = []
|
ip_ctrls = []
|
||||||
ip_ad_cols = []
|
ip_ad_cols = []
|
||||||
for _ in range(4):
|
for _ in range(4):
|
||||||
with gr.Column():
|
with gr.Column():
|
||||||
ip_ctrls.append(grh.Image(label='Image', source='upload', type='numpy', show_label=False, height=300))
|
ip_image = grh.Image(label='Image', source='upload', type='numpy', show_label=False, height=300)
|
||||||
|
ip_images.append(ip_image)
|
||||||
|
ip_ctrls.append(ip_image)
|
||||||
with gr.Column(visible=False) as ad_col:
|
with gr.Column(visible=False) as ad_col:
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
default_end, default_weight = flags.default_parameters[flags.default_ip]
|
default_end, default_weight = flags.default_parameters[flags.default_ip]
|
||||||
ip_ctrls.append(gr.Slider(label='Stop At', minimum=0.0, maximum=1.0, step=0.001, value=default_end))
|
|
||||||
ip_ctrls.append(gr.Slider(label='Weight', minimum=0.0, maximum=2.0, step=0.001, value=default_weight))
|
ip_stop = gr.Slider(label='Stop At', minimum=0.0, maximum=1.0, step=0.001, value=default_end)
|
||||||
ip_ctrls.append(gr.Radio(label='Type', choices=flags.ip_list, value=flags.default_ip, container=False))
|
ip_stops.append(ip_stop)
|
||||||
ip_ctrls[-1].change(lambda x: flags.default_parameters[x], inputs=ip_ctrls[-1], outputs=ip_ctrls[-3:-1], queue=False, show_progress=False)
|
ip_ctrls.append(ip_stop)
|
||||||
|
|
||||||
|
ip_weight = gr.Slider(label='Weight', minimum=0.0, maximum=2.0, step=0.001, value=default_weight)
|
||||||
|
ip_weights.append(ip_weight)
|
||||||
|
ip_ctrls.append(ip_weight)
|
||||||
|
|
||||||
|
ip_type = gr.Radio(label='Type', choices=flags.ip_list, value=flags.default_ip, container=False)
|
||||||
|
ip_types.append(ip_type)
|
||||||
|
ip_ctrls.append(ip_type)
|
||||||
|
|
||||||
|
ip_type.change(lambda x: flags.default_parameters[x], inputs=[ip_type], outputs=[ip_stop, ip_weight], queue=False, show_progress=False)
|
||||||
ip_ad_cols.append(ad_col)
|
ip_ad_cols.append(ad_col)
|
||||||
ip_advanced = gr.Checkbox(label='Advanced', value=False, container=False)
|
ip_advanced = gr.Checkbox(label='Advanced', value=False, container=False)
|
||||||
gr.HTML('* \"Image Prompt\" is powered by Fooocus Image Mixture Engine (v1.0.1). <a href="https://github.com/lllyasviel/Fooocus/discussions/557">\U0001F4D4 Document</a>')
|
gr.HTML('* \"Image Prompt\" is powered by Fooocus Image Mixture Engine (v1.0.1). <a href="https://github.com/lllyasviel/Fooocus/discussions/557">\U0001F4D4 Document</a>')
|
||||||
|
|
||||||
def ip_advance_checked(x):
|
def ip_advance_checked(x):
|
||||||
return [gr.update(visible=x)] * len(ip_ad_cols)
|
return [gr.update(visible=x)] * len(ip_ad_cols) + \
|
||||||
|
[flags.default_ip] * len(ip_types) + \
|
||||||
|
[flags.default_parameters[flags.default_ip][0]] * len(ip_stops) + \
|
||||||
|
[flags.default_parameters[flags.default_ip][1]] * len(ip_weights)
|
||||||
|
|
||||||
ip_advanced.change(ip_advance_checked, inputs=ip_advanced, outputs=ip_ad_cols, queue=False)
|
ip_advanced.change(ip_advance_checked, inputs=ip_advanced,
|
||||||
|
outputs=ip_ad_cols + ip_types + ip_stops + ip_weights, queue=False)
|
||||||
|
|
||||||
with gr.TabItem(label='Inpaint or Outpaint (beta)') as inpaint_tab:
|
with gr.TabItem(label='Inpaint or Outpaint (beta)') as inpaint_tab:
|
||||||
inpaint_input_image = grh.Image(label='Drag above image to here', source='upload', type='numpy', tool='sketch', height=500, brush_color="#FFFFFF")
|
inpaint_input_image = grh.Image(label='Drag above image to here', source='upload', type='numpy', tool='sketch', height=500, brush_color="#FFFFFF")
|
||||||
|
|||||||
Reference in New Issue
Block a user