mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: add debug setting for enhance mask output
This commit is contained in:
@@ -110,6 +110,7 @@ class AsyncTask:
|
|||||||
|
|
||||||
self.debugging_dino = args.pop()
|
self.debugging_dino = args.pop()
|
||||||
self.dino_erode_or_dilate = args.pop()
|
self.dino_erode_or_dilate = args.pop()
|
||||||
|
self.debugging_enhance_masks_checkbox = args.pop()
|
||||||
|
|
||||||
self.enhance_checkbox = args.pop()
|
self.enhance_checkbox = args.pop()
|
||||||
self.enhance_ctrls = []
|
self.enhance_ctrls = []
|
||||||
@@ -1107,9 +1108,9 @@ def worker():
|
|||||||
if int(async_task.inpaint_erode_or_dilate) != 0:
|
if int(async_task.inpaint_erode_or_dilate) != 0:
|
||||||
mask = erode_or_dilate(mask, async_task.inpaint_erode_or_dilate)
|
mask = erode_or_dilate(mask, async_task.inpaint_erode_or_dilate)
|
||||||
|
|
||||||
async_task.yields.append(['preview', (current_progress, 'Loading ...', mask)])
|
if async_task.debugging_enhance_masks_checkbox:
|
||||||
# TODO also show do_not_show_finished_images=len(tasks) == 1
|
async_task.yields.append(['preview', (current_progress, 'Loading ...', mask)])
|
||||||
yield_result(async_task, mask, async_task.black_out_nsfw, False, do_not_show_finished_images=len(tasks) == 1 or async_task.disable_intermediate_results)
|
yield_result(async_task, mask, async_task.black_out_nsfw, False, async_task.disable_intermediate_results)
|
||||||
|
|
||||||
print(f'[Enhance] {dino_detection_count} boxes detected')
|
print(f'[Enhance] {dino_detection_count} boxes detected')
|
||||||
print(f'[Enhance] {sam_detection_count} segments detected in boxes')
|
print(f'[Enhance] {sam_detection_count} segments detected in boxes')
|
||||||
|
|||||||
@@ -712,8 +712,10 @@ with shared.gradio_root:
|
|||||||
|
|
||||||
with gr.Tab(label='Inpaint'):
|
with gr.Tab(label='Inpaint'):
|
||||||
debugging_inpaint_preprocessor = gr.Checkbox(label='Debug Inpaint Preprocessing', value=False)
|
debugging_inpaint_preprocessor = gr.Checkbox(label='Debug Inpaint Preprocessing', value=False)
|
||||||
|
debugging_enhance_masks_checkbox = gr.Checkbox(label='Debug Enhance Masks', value=False,
|
||||||
|
info='Show enhance masks in preview and final results')
|
||||||
debugging_dino = gr.Checkbox(label='Debug GroundingDINO', value=False,
|
debugging_dino = gr.Checkbox(label='Debug GroundingDINO', value=False,
|
||||||
info='Used for SAM object detection and box generation')
|
info='Use GroundingDINO boxes instead of more detailed SAM masks')
|
||||||
inpaint_disable_initial_latent = gr.Checkbox(label='Disable initial latent in inpaint', value=False)
|
inpaint_disable_initial_latent = gr.Checkbox(label='Disable initial latent in inpaint', value=False)
|
||||||
inpaint_engine = gr.Dropdown(label='Inpaint Engine',
|
inpaint_engine = gr.Dropdown(label='Inpaint Engine',
|
||||||
value=modules.config.default_inpaint_engine_version,
|
value=modules.config.default_inpaint_engine_version,
|
||||||
@@ -894,7 +896,8 @@ with shared.gradio_root:
|
|||||||
ctrls += [save_metadata_to_images, metadata_scheme]
|
ctrls += [save_metadata_to_images, metadata_scheme]
|
||||||
|
|
||||||
ctrls += ip_ctrls
|
ctrls += ip_ctrls
|
||||||
ctrls += [debugging_dino, dino_erode_or_dilate, enhance_checkbox] + enhance_ctrls
|
ctrls += [debugging_dino, dino_erode_or_dilate, debugging_enhance_masks_checkbox, enhance_checkbox]
|
||||||
|
ctrls += enhance_ctrls
|
||||||
|
|
||||||
def parse_meta(raw_prompt_txt, is_generating):
|
def parse_meta(raw_prompt_txt, is_generating):
|
||||||
loaded_json = None
|
loaded_json = None
|
||||||
|
|||||||
Reference in New Issue
Block a user