Added information about diffusion and total execution time (#463)
This commit is contained in:
parent
7e031b1b03
commit
726f684ff2
@ -336,6 +336,8 @@ def worker():
|
|||||||
outputs.append(['preview', (13, 'Starting tasks ...', None)])
|
outputs.append(['preview', (13, 'Starting tasks ...', None)])
|
||||||
for current_task_id, task in enumerate(tasks):
|
for current_task_id, task in enumerate(tasks):
|
||||||
try:
|
try:
|
||||||
|
execution_start_time = time.perf_counter()
|
||||||
|
|
||||||
imgs = pipeline.process_diffusion(
|
imgs = pipeline.process_diffusion(
|
||||||
positive_cond=task['c'],
|
positive_cond=task['c'],
|
||||||
negative_cond=task['uc'],
|
negative_cond=task['uc'],
|
||||||
@ -353,6 +355,9 @@ def worker():
|
|||||||
if inpaint_worker.current_task is not None:
|
if inpaint_worker.current_task is not None:
|
||||||
imgs = [inpaint_worker.current_task.post_process(x) for x in imgs]
|
imgs = [inpaint_worker.current_task.post_process(x) for x in imgs]
|
||||||
|
|
||||||
|
execution_time = time.perf_counter() - execution_start_time
|
||||||
|
print(f'Diffusion time: {execution_time:.2f} seconds')
|
||||||
|
|
||||||
for x in imgs:
|
for x in imgs:
|
||||||
d = [
|
d = [
|
||||||
('Prompt', raw_prompt),
|
('Prompt', raw_prompt),
|
||||||
|
|||||||
5
webui.py
5
webui.py
@ -15,6 +15,8 @@ from modules.sdxl_styles import style_keys, aspect_ratios, fooocus_expansion, de
|
|||||||
|
|
||||||
|
|
||||||
def generate_clicked(*args):
|
def generate_clicked(*args):
|
||||||
|
execution_start_time = time.perf_counter()
|
||||||
|
|
||||||
yield gr.update(visible=True, value=modules.html.make_progress_html(1, 'Initializing ...')), \
|
yield gr.update(visible=True, value=modules.html.make_progress_html(1, 'Initializing ...')), \
|
||||||
gr.update(visible=True, value=None), \
|
gr.update(visible=True, value=None), \
|
||||||
gr.update(visible=False)
|
gr.update(visible=False)
|
||||||
@ -36,6 +38,9 @@ def generate_clicked(*args):
|
|||||||
gr.update(visible=False), \
|
gr.update(visible=False), \
|
||||||
gr.update(visible=True, value=product)
|
gr.update(visible=True, value=product)
|
||||||
finished = True
|
finished = True
|
||||||
|
|
||||||
|
execution_time = time.perf_counter() - execution_start_time
|
||||||
|
print(f'Total time: {execution_time:.2f} seconds')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user