Skip to content

Commit

Permalink
fix: use 0 steps when upscaling with skip_prompt_processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mashb1t committed Jun 21, 2024
1 parent 7ed9852 commit bd3a29b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions modules/async_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ def prepare_upscale(async_task, goals, uov_input_image, uov_method, performance,
goals.append('upscale')
if 'fast' in uov_method:
skip_prompt_processing = True
steps = 0
else:
steps = performance.steps_uov()

Expand Down Expand Up @@ -977,7 +978,7 @@ def process_enhance(all_steps, async_task, callback, controlnet_canny_path, cont
progressbar(async_task, current_progress, f'Saving image {current_task_id + 1}/{total_count} to system ...')
uov_image_path = log(img, d, output_format=async_task.output_format)
yield_result(async_task, uov_image_path, current_progress, async_task.black_out_nsfw, False,
do_not_show_finished_images=True)
do_not_show_finished_images=not show_intermediate_results or async_task.disable_intermediate_results)
return current_progress, img

if 'inpaint' in goals and inpaint_parameterized:
Expand Down Expand Up @@ -1122,7 +1123,7 @@ def handler(async_task: AsyncTask):

if 'vary' in goals:
async_task.uov_input_image, denoising_strength, initial_latent, width, height, current_progress = apply_vary(
async_task, async_task.uov_method, denoising_strength, switch, async_task.uov_input_image,
async_task, async_task.uov_method, denoising_strength, async_task.uov_input_image, switch,
current_progress)

if 'upscale' in goals:
Expand Down Expand Up @@ -1178,7 +1179,13 @@ def handler(async_task: AsyncTask):
all_steps = steps * async_task.image_number

if async_task.enhance_checkbox and async_task.enhance_uov_method != flags.disabled.casefold():
enhance_upscale_steps, _, _, _ = apply_overrides(async_task, async_task.performance_selection.steps_uov(), height, width)
enhance_upscale_steps = async_task.performance_selection.steps()
if 'upscale' in async_task.enhance_uov_method:
if 'fast' in async_task.enhance_uov_method:
enhance_upscale_steps = 0
else:
enhance_upscale_steps = async_task.performance_selection.steps_uov()
enhance_upscale_steps, _, _, _ = apply_overrides(async_task, enhance_upscale_steps, height, width)
enhance_upscale_steps_total = async_task.image_number * enhance_upscale_steps
all_steps += enhance_upscale_steps_total

Expand Down

0 comments on commit bd3a29b

Please sign in to comment.