fix(api): restore single-tile code path
This commit is contained in:
parent
a9b4303d25
commit
828c9511a6
|
@ -266,6 +266,7 @@ def process_tile_stack(
|
||||||
|
|
||||||
tiles: List[Tuple[int, int, Image.Image]] = []
|
tiles: List[Tuple[int, int, Image.Image]] = []
|
||||||
tile_coords = tile_generator(width, height, tile, overlap)
|
tile_coords = tile_generator(width, height, tile, overlap)
|
||||||
|
single_tile = len(tile_coords) == 1
|
||||||
|
|
||||||
for counter, (left, top) in enumerate(tile_coords):
|
for counter, (left, top) in enumerate(tile_coords):
|
||||||
logger.info(
|
logger.info(
|
||||||
|
@ -291,7 +292,12 @@ def process_tile_stack(
|
||||||
needs_margin = True
|
needs_margin = True
|
||||||
bottom_margin = height - bottom
|
bottom_margin = height - bottom
|
||||||
|
|
||||||
if needs_margin:
|
if single_tile:
|
||||||
|
logger.debug("using single tile")
|
||||||
|
tile_stack = sources
|
||||||
|
if mask:
|
||||||
|
tile_mask = mask
|
||||||
|
elif needs_margin:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"tiling with added margins: %s, %s, %s, %s",
|
"tiling with added margins: %s, %s, %s, %s",
|
||||||
left_margin,
|
left_margin,
|
||||||
|
|
|
@ -229,9 +229,7 @@ def load_pipeline(
|
||||||
tokenizer_2=components.get("tokenizer_2", None),
|
tokenizer_2=components.get("tokenizer_2", None),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.debug(
|
logger.debug("assembling SD pipeline for %s", pipeline_class.__name__)
|
||||||
"assembling SD pipeline for %s", pipeline_class.__name__
|
|
||||||
)
|
|
||||||
|
|
||||||
if pipeline_class == OnnxStableDiffusionUpscalePipeline:
|
if pipeline_class == OnnxStableDiffusionUpscalePipeline:
|
||||||
# upscale uses a single VAE
|
# upscale uses a single VAE
|
||||||
|
|
|
@ -2,7 +2,9 @@ from logging import getLogger
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
from diffusers.pipelines.onnx_utils import OnnxRuntimeModel
|
from diffusers.pipelines.onnx_utils import OnnxRuntimeModel
|
||||||
from diffusers.pipelines.stable_diffusion import OnnxStableDiffusionUpscalePipeline as BasePipeline
|
from diffusers.pipelines.stable_diffusion import (
|
||||||
|
OnnxStableDiffusionUpscalePipeline as BasePipeline,
|
||||||
|
)
|
||||||
from diffusers.schedulers import DDPMScheduler
|
from diffusers.schedulers import DDPMScheduler
|
||||||
|
|
||||||
logger = getLogger(__name__)
|
logger = getLogger(__name__)
|
||||||
|
|
Loading…
Reference in New Issue