From 3db125a206ad22088da6e17ad190dbb00ead90d7 Mon Sep 17 00:00:00 2001 From: ChrisColeTech Date: Tue, 20 Aug 2024 17:27:03 -0400 Subject: [PATCH 1/2] To resolve github CodeQL warning -To resolve github CodeQL warning -more code cleanup --- modules/async_worker.py | 12 +++++------- modules/bulk_enhance_helpers.py | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/async_worker.py b/modules/async_worker.py index 1980fc741..60aafb5f0 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -1839,10 +1839,9 @@ def callback(step, x0, x, total_steps, y): stop_processing(async_task, processing_start_time) return - def setup(async_task: AsyncTask, current_task_number): + def setup(async_task: AsyncTask): base_model_additional_loras = [] current_progress = 0 - tasks = [] use_synthetic_refiner = False if fooocus_expansion in async_task.style_selections: use_expansion = True @@ -1863,11 +1862,10 @@ def setup(async_task: AsyncTask, current_task_number): clip_vision_path, ip_negative_path, ip_adapter_face_path) inpaint_worker.current_task = None - loras = async_task.loras - tasks, use_expansion, loras, current_progress = process_prompt(async_task, async_task.prompt, async_task.negative_prompt, - base_model_additional_loras, 1, - async_task.disable_seed_increment, use_expansion, use_style, - use_synthetic_refiner, current_progress, advance_progress=True) + process_prompt(async_task, async_task.prompt, async_task.negative_prompt, + base_model_additional_loras, 1, + async_task.disable_seed_increment, use_expansion, use_style, + use_synthetic_refiner, current_progress, advance_progress=True) apply_patch_settings(async_task) return diff --git a/modules/bulk_enhance_helpers.py b/modules/bulk_enhance_helpers.py index 37e47ffd1..787d54766 100644 --- a/modules/bulk_enhance_helpers.py +++ b/modules/bulk_enhance_helpers.py @@ -80,7 +80,7 @@ def on_input_change(input_path, file_explorer): # Verify with normalised version of path input_path = os.path.normpath(os.path.realpath(input_path)) - if os.path.isdir(input_path): + if os.path.isdir(os.path.realpath(input_path)): # Return an empty list if input_path is a directory return None, gr.update(visible=True), gr.update(value=True) else: From 4b90d7013dd04b0cf320d88f294ee9ca9e250a21 Mon Sep 17 00:00:00 2001 From: ChrisColeTech Date: Tue, 20 Aug 2024 20:20:58 -0400 Subject: [PATCH 2/2] Update async_worker.py --- modules/async_worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/async_worker.py b/modules/async_worker.py index 60aafb5f0..1f08f8967 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -1780,7 +1780,7 @@ def callback(step, x0, x, total_steps, y): progressbar(async_task, current_progress, f'Preparing task {current_task_id + 1}/{async_task.image_number} ...') current_task_number = current_task_id + 1 - setup(async_task, current_task_number) + setup(async_task) patch_samplers(async_task) execution_start_time = time.perf_counter() try: