Skip to content

Commit

Permalink
fix(api): always use accumulating progress counters
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 30, 2023
1 parent bf2f77d commit 0573721
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 0 additions & 7 deletions api/onnx_web/diffusers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def run_loopback(
if params.loopback == 0:
return image

loopback_progress = ChainProgress.from_progress(progress)

# load img2img pipeline once
pipe_type = params.get_valid_pipeline("img2img")
if pipe_type == "controlnet":
Expand Down Expand Up @@ -120,8 +118,6 @@ def run_highres(
if highres.scale <= 1:
return image

highres_progress = ChainProgress.from_progress(progress)

if upscale.faces and (
upscale.upscale_order == "correction-both"
or upscale.upscale_order == "correction-first"
Expand Down Expand Up @@ -478,9 +474,6 @@ def run_inpaint_pipeline(

_prompt_pairs, loras, inversions = parse_prompt(params)

# calling the upscale_outpaint stage directly needs accumulating progress
progress = ChainProgress.from_progress(progress)

logger.debug("applying mask filter and generating noise source")
image = upscale_outpaint(
job,
Expand Down
3 changes: 2 additions & 1 deletion api/onnx_web/worker/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from torch.multiprocessing import Queue, Value

from ..chain.base import ChainProgress
from ..params import DeviceParams
from .command import JobCommand, ProgressCommand

Expand Down Expand Up @@ -80,7 +81,7 @@ def on_progress(step: int, timestep: int, latents: Any):
on_progress.step = step
self.set_progress(step)

return on_progress
return ChainProgress.from_progress(on_progress)

def set_cancel(self, cancel: bool = True) -> None:
with self.cancel.get_lock():
Expand Down

0 comments on commit 0573721

Please sign in to comment.