Skip to content

Commit

Permalink
fix(api): resize blend mask to match source
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Dec 21, 2023
1 parent 1fbee0a commit 2c2eda8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/onnx_web/diffusers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,15 @@ def run_blend_pipeline(
chain = ChainPipeline()
tile_size = get_base_tile(params, size)

# resize mask to match source size
stage_source = sources[1]
stage_mask = mask.resize(stage_source.size, Image.Resampling.BILINEAR)

chain.stage(
BlendMaskStage(),
StageParams(tile_size=tile_size),
stage_source=sources[1],
stage_mask=mask,
stage_source=stage_source,
stage_mask=stage_mask,
)

# apply upscaling and correction
Expand Down

0 comments on commit 2c2eda8

Please sign in to comment.