mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-04-24 22:09:00 +08:00
Add types to split_grid
This commit is contained in:
parent
31992eff9b
commit
7aa27b000a
@ -64,9 +64,8 @@ def image_grid(imgs, batch_size=1, rows=None):
|
|||||||
Grid = namedtuple("Grid", ["tiles", "tile_w", "tile_h", "image_w", "image_h", "overlap"])
|
Grid = namedtuple("Grid", ["tiles", "tile_w", "tile_h", "image_w", "image_h", "overlap"])
|
||||||
|
|
||||||
|
|
||||||
def split_grid(image, tile_w=512, tile_h=512, overlap=64):
|
def split_grid(image: Image.Image, tile_w: int = 512, tile_h: int = 512, overlap: int = 64) -> Grid:
|
||||||
w = image.width
|
w, h = image.size
|
||||||
h = image.height
|
|
||||||
|
|
||||||
non_overlap_width = tile_w - overlap
|
non_overlap_width = tile_w - overlap
|
||||||
non_overlap_height = tile_h - overlap
|
non_overlap_height = tile_h - overlap
|
||||||
|
Loading…
x
Reference in New Issue
Block a user