1
0
Fork 0

fix(api): defer txt2img tiling to panorama pipeline when selected

This commit is contained in:
Sean Sube 2023-08-20 15:18:30 -05:00
parent d94a8d6f6e
commit 440e47f736
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 13 additions and 4 deletions

View File

@ -54,6 +54,8 @@ class SourceTxt2ImgStage(BaseStage):
) )
tile_size = params.tiles tile_size = params.tiles
# this works for panorama as well, because tile_size is already max(tile_size, *size)
latent_size = size.min(tile_size, tile_size) latent_size = size.min(tile_size, tile_size)
# generate new latents or slice existing # generate new latents or slice existing

View File

@ -42,19 +42,26 @@ def run_txt2img_pipeline(
upscale: UpscaleParams, upscale: UpscaleParams,
highres: HighresParams, highres: HighresParams,
) -> None: ) -> None:
# if using panorama, the pipeline will tile itself (views)
pipe_type = params.get_valid_pipeline("txt2img")
if pipe_type == "panorama":
tile_size = max(params.tiles, size.width, size.height)
else:
tile_size = params.tiles
# prepare the chain pipeline and first stage # prepare the chain pipeline and first stage
chain = ChainPipeline() chain = ChainPipeline()
stage = StageParams(
tile_size=params.tiles,
)
chain.stage( chain.stage(
SourceTxt2ImgStage(), SourceTxt2ImgStage(),
stage, StageParams(
tile_size=tile_size,
),
size=size, size=size,
overlap=params.overlap, overlap=params.overlap,
) )
# apply upscaling and correction, before highres # apply upscaling and correction, before highres
stage = StageParams(tile_size=params.tiles)
first_upscale, after_upscale = split_upscale(upscale) first_upscale, after_upscale = split_upscale(upscale)
if first_upscale: if first_upscale:
stage_upscale_correction( stage_upscale_correction(