avoid waiting for final progress
This commit is contained in:
parent
5a48447585
commit
9b5e894898
|
@ -112,7 +112,7 @@ def run_txt2img_pipeline(
|
|||
|
||||
# run and save
|
||||
latents = get_latents_from_seed(params.seed, size, batch=params.batch)
|
||||
progress = worker.get_progress_callback()
|
||||
progress = worker.get_progress_callback(reset=True)
|
||||
images = chain(
|
||||
worker, server, params, StageResult.empty(), callback=progress, latents=latents
|
||||
)
|
||||
|
@ -210,7 +210,7 @@ def run_img2img_pipeline(
|
|||
)
|
||||
|
||||
# run and append the filtered source
|
||||
progress = worker.get_progress_callback()
|
||||
progress = worker.get_progress_callback(reset=True)
|
||||
images = chain(
|
||||
worker, server, params, StageResult(images=[source]), callback=progress
|
||||
)
|
||||
|
@ -380,7 +380,7 @@ def run_inpaint_pipeline(
|
|||
|
||||
# run and save
|
||||
latents = get_latents_from_seed(params.seed, size, batch=params.batch)
|
||||
progress = worker.get_progress_callback()
|
||||
progress = worker.get_progress_callback(reset=True)
|
||||
images = chain(
|
||||
worker,
|
||||
server,
|
||||
|
@ -457,7 +457,7 @@ def run_upscale_pipeline(
|
|||
)
|
||||
|
||||
# run and save
|
||||
progress = worker.get_progress_callback()
|
||||
progress = worker.get_progress_callback(reset=True)
|
||||
images = chain(
|
||||
worker, server, params, StageResult(images=[source]), callback=progress
|
||||
)
|
||||
|
@ -506,7 +506,7 @@ def run_blend_pipeline(
|
|||
)
|
||||
|
||||
# run and save
|
||||
progress = worker.get_progress_callback()
|
||||
progress = worker.get_progress_callback(reset=True)
|
||||
images = chain(
|
||||
worker, server, params, StageResult(images=sources), callback=progress
|
||||
)
|
||||
|
|
|
@ -96,10 +96,10 @@ class WorkerContext:
|
|||
|
||||
return 0
|
||||
|
||||
def get_progress_callback(self) -> ProgressCallback:
|
||||
def get_progress_callback(self, reset=False) -> ProgressCallback:
|
||||
from ..chain.pipeline import ChainProgress
|
||||
|
||||
if self.callback is not None:
|
||||
if not reset and self.callback is not None:
|
||||
return self.callback
|
||||
|
||||
def on_progress(step: int, timestep: int, latents: Any):
|
||||
|
@ -157,10 +157,10 @@ class WorkerContext:
|
|||
self.job_type,
|
||||
self.device.device,
|
||||
JobStatus.SUCCESS,
|
||||
steps=self.last_progress.steps,
|
||||
stages=self.last_progress.stages,
|
||||
tiles=self.last_progress.tiles,
|
||||
results=self.last_progress.results,
|
||||
steps=self.callback.steps,
|
||||
stages=self.callback.stages,
|
||||
tiles=self.callback.tiles,
|
||||
results=self.callback.results,
|
||||
)
|
||||
self.progress.put(
|
||||
self.last_progress,
|
||||
|
|
Loading…
Reference in New Issue