1
0
Fork 0

type lint

This commit is contained in:
Sean Sube 2023-12-26 08:06:16 -06:00
parent fab3ac68c2
commit 2b65077d82
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 13 additions and 10 deletions

View File

@ -25,7 +25,7 @@ class TileCallback(Protocol):
Definition for a tile job function.
"""
def __call__(self, image: Image.Image, dims: Tuple[int, int, int]) -> StageResult:
def __call__(self, sources: List[Image.Image], mask: Image.Image, dims: Tuple[int, int, int]) -> StageResult:
"""
Run this stage against a single tile.
"""
@ -366,10 +366,7 @@ def process_tile_order(
scale: int,
filters: List[TileCallback],
**kwargs,
) -> Image.Image:
"""
TODO: needs to handle more than one image
"""
) -> List[Image.Image]:
if order == TileOrder.grid:
logger.debug("using grid tile order with tile size: %s", tile)
return process_tile_stack(
@ -483,7 +480,7 @@ def generate_tile_grid(
height: int,
tile: int,
overlap: float = 0.0,
) -> List[Tuple[int, int]]:
) -> List[Tuple[int, int, Image.Image]]:
adj_tile = int(float(tile) * (1.0 - overlap))
tiles_x = ceil(width / adj_tile)
tiles_y = ceil(height / adj_tile)

View File

@ -1,5 +1,5 @@
from logging import getLogger
from typing import Dict, Optional, Tuple
from typing import Dict, Optional, Tuple, Union
from flask import request
@ -345,7 +345,7 @@ PipelineParams = Tuple[Optional[DeviceParams], ImageParams, Size]
def pipeline_from_json(
server: ServerContext,
data: Dict[str, str],
data: Dict[str, Union[str, Dict[str, str]]],
default_pipeline: str = "txt2img",
) -> PipelineParams:
"""

View File

@ -23,9 +23,14 @@ module = [
"basicsr",
"boto3",
"codeformer",
"codeformer.facelib.utils.misc",
"codeformer.facelib.utils",
"codeformer.basicsr",
"codeformer.basicsr.utils",
"codeformer.basicsr.utils.download_util",
"codeformer.basicsr.utils.registry",
"codeformer.facelib",
"codeformer.facelib.utils",
"codeformer.facelib.utils.misc",
"codeformer.facelib.utils.face_restoration_helper",
"compel",
"controlnet_aux",
"cv2",
@ -73,6 +78,7 @@ module = [
"safetensors",
"scipy",
"timm.models.layers",
"torchvision.transforms.functional",
"transformers",
"win10toast"
]