mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
refactor: add info to inpaint_mask_sam_prompt_text, rename variable for dino debugging
This commit is contained in:
@@ -33,11 +33,11 @@ def generate_mask_from_image(image: np.ndarray, mask_model: str, extras: dict, b
|
|||||||
|
|
||||||
if debug_dino:
|
if debug_dino:
|
||||||
from PIL import ImageDraw, Image
|
from PIL import ImageDraw, Image
|
||||||
image_with_boxes = Image.new("RGB", (image.shape[1], image.shape[0]), color="black")
|
debug_dino_image = Image.new("RGB", (image.shape[1], image.shape[0]), color="black")
|
||||||
draw = ImageDraw.Draw(image_with_boxes)
|
draw = ImageDraw.Draw(debug_dino_image)
|
||||||
for box in extras['sam_prompt']:
|
for box in extras['sam_prompt']:
|
||||||
draw.rectangle(box['data'], fill="white")
|
draw.rectangle(box['data'], fill="white")
|
||||||
return np.array(image_with_boxes)
|
return np.array(debug_dino_image)
|
||||||
|
|
||||||
return remove(
|
return remove(
|
||||||
image,
|
image,
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
"Mask generation model": "Mask generation model",
|
"Mask generation model": "Mask generation model",
|
||||||
"Cloth category": "Cloth category",
|
"Cloth category": "Cloth category",
|
||||||
"Segmentation prompt": "Segmentation prompt",
|
"Segmentation prompt": "Segmentation prompt",
|
||||||
|
"Use singular whenever possible": "Use singular whenever possible",
|
||||||
"Advanced options": "Advanced options",
|
"Advanced options": "Advanced options",
|
||||||
"SAM model": "SAM model",
|
"SAM model": "SAM model",
|
||||||
"Quantization": "Quantization",
|
"Quantization": "Quantization",
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ with shared.gradio_root:
|
|||||||
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)
|
||||||
inpaint_mask_sam_prompt_text = gr.Textbox(label='Segmentation prompt', value='', visible=False)
|
inpaint_mask_sam_prompt_text = gr.Textbox(label='Segmentation prompt', value='', visible=False, info='Use singular whenever possible')
|
||||||
with gr.Accordion("Advanced options", visible=False, open=False) as inpaint_mask_advanced_options:
|
with gr.Accordion("Advanced options", visible=False, open=False) as inpaint_mask_advanced_options:
|
||||||
inpaint_mask_sam_model = gr.Dropdown(label='SAM model', choices=flags.inpaint_mask_sam_model, value=modules.config.default_inpaint_mask_sam_model)
|
inpaint_mask_sam_model = gr.Dropdown(label='SAM model', choices=flags.inpaint_mask_sam_model, value=modules.config.default_inpaint_mask_sam_model)
|
||||||
inpaint_mask_sam_quant = gr.Checkbox(label='Quantization', value=False)
|
inpaint_mask_sam_quant = gr.Checkbox(label='Quantization', value=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user