1
0
Fork 0

fix(api): restore single-tile code path

This commit is contained in:
Sean Sube 2023-11-27 18:53:39 -06:00
parent a9b4303d25
commit 828c9511a6
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 11 additions and 5 deletions

View File

@ -266,6 +266,7 @@ def process_tile_stack(
tiles: List[Tuple[int, int, Image.Image]] = []
tile_coords = tile_generator(width, height, tile, overlap)
single_tile = len(tile_coords) == 1
for counter, (left, top) in enumerate(tile_coords):
logger.info(
@ -291,7 +292,12 @@ def process_tile_stack(
needs_margin = True
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(
"tiling with added margins: %s, %s, %s, %s",
left_margin,

View File

@ -229,9 +229,7 @@ def load_pipeline(
tokenizer_2=components.get("tokenizer_2", None),
)
else:
logger.debug(
"assembling SD pipeline for %s", pipeline_class.__name__
)
logger.debug("assembling SD pipeline for %s", pipeline_class.__name__)
if pipeline_class == OnnxStableDiffusionUpscalePipeline:
# upscale uses a single VAE

View File

@ -2,7 +2,9 @@ from logging import getLogger
from typing import Any, List
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
logger = getLogger(__name__)