mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
refactor: rename cloth_category to inpaint_mask_cloth_category
This commit is contained in:
@@ -206,7 +206,7 @@ with shared.gradio_root:
|
|||||||
choices=flags.inpaint_mask_models,
|
choices=flags.inpaint_mask_models,
|
||||||
value=modules.config.default_inpaint_mask_model,
|
value=modules.config.default_inpaint_mask_model,
|
||||||
visible=False)
|
visible=False)
|
||||||
cloth_category = gr.Dropdown(label='Cloth category',
|
inpaint_mask_cloth_category = gr.Dropdown(label='Cloth category',
|
||||||
choices=flags.inpaint_mask_cloth_category,
|
choices=flags.inpaint_mask_cloth_category,
|
||||||
value=modules.config.default_inpaint_mask_cloth_category,
|
value=modules.config.default_inpaint_mask_cloth_category,
|
||||||
visible=False)
|
visible=False)
|
||||||
@@ -215,20 +215,20 @@ with shared.gradio_root:
|
|||||||
|
|
||||||
def generate_mask(image, mask_model, cloth_category):
|
def generate_mask(image, mask_model, cloth_category):
|
||||||
from extras.inpaint_mask import generate_mask_from_image
|
from extras.inpaint_mask import generate_mask_from_image
|
||||||
return generate_mask_from_image(image, mask_model, extras={"cloth_category": cloth_category})
|
return generate_mask_from_image(image, mask_model, {"cloth_category": cloth_category})
|
||||||
|
|
||||||
|
|
||||||
generate_mask_button.click(fn=generate_mask,
|
generate_mask_button.click(fn=generate_mask,
|
||||||
inputs=[
|
inputs=[
|
||||||
inpaint_input_image, inpaint_mask_model,
|
inpaint_input_image, inpaint_mask_model,
|
||||||
cloth_category
|
inpaint_mask_cloth_category
|
||||||
],
|
],
|
||||||
outputs=inpaint_mask_image)
|
outputs=inpaint_mask_image)
|
||||||
|
|
||||||
inpaint_mask_model.change(lambda x: gr.update(visible=x == 'u2net_cloth_seg'),
|
inpaint_mask_model.change(lambda x: gr.update(visible=x == 'u2net_cloth_seg'),
|
||||||
inputs=inpaint_mask_model,
|
inputs=inpaint_mask_model,
|
||||||
outputs=cloth_category,
|
outputs=inpaint_mask_cloth_category,
|
||||||
queue=False, show_progress=False)
|
queue=False, show_progress=False)
|
||||||
with gr.TabItem(label='Describe') as desc_tab:
|
with gr.TabItem(label='Describe') as desc_tab:
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
with gr.Column():
|
with gr.Column():
|
||||||
|
|||||||
Reference in New Issue
Block a user