Skip to content

Commit

Permalink
fix(api): use existing progress counter for highres and loopback
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 30, 2023
1 parent 942a75c commit 5dfb09b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions api/onnx_web/convert/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ def onnx_export(
opset_version=opset,
)

op_block_list=None
op_block_list = None
if v2:
op_block_list=["Attention", "MultiHeadAttention"]
op_block_list = ["Attention", "MultiHeadAttention"]

if half:
logger.info("converting model to fp16 internally: %s", output_file)
Expand Down
13 changes: 6 additions & 7 deletions api/onnx_web/diffusers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from PIL import Image

from ..chain import blend_mask, upscale_outpaint
from ..chain.base import ChainProgress
from ..chain.utils import process_tile_order
from ..output import save_image, save_params
from ..params import (
Expand Down Expand Up @@ -77,7 +76,7 @@ def loopback_iteration(source: Image.Image):
num_inference_steps=params.steps,
strength=strength,
eta=params.eta,
callback=loopback_progress,
callback=progress,
)
return result.images[0]
else:
Expand All @@ -92,7 +91,7 @@ def loopback_iteration(source: Image.Image):
num_inference_steps=params.steps,
strength=strength,
eta=params.eta,
callback=loopback_progress,
callback=progress,
)
return result.images[0]

Expand Down Expand Up @@ -132,7 +131,7 @@ def run_highres(
scale=1,
outscale=1,
),
callback=highres_progress,
callback=progress,
)

# load img2img pipeline once
Expand Down Expand Up @@ -173,7 +172,7 @@ def highres_tile(tile: Image.Image, dims):
scale=highres.scale,
outscale=highres.scale,
),
callback=highres_progress,
callback=progress,
)

if pipe_type == "lpw":
Expand All @@ -188,7 +187,7 @@ def highres_tile(tile: Image.Image, dims):
num_inference_steps=highres.steps,
strength=highres.strength,
eta=params.eta,
callback=highres_progress,
callback=progress,
)
return result.images[0]
else:
Expand All @@ -203,7 +202,7 @@ def highres_tile(tile: Image.Image, dims):
num_inference_steps=highres.steps,
strength=highres.strength,
eta=params.eta,
callback=highres_progress,
callback=progress,
)
return result.images[0]

Expand Down

0 comments on commit 5dfb09b

Please sign in to comment.