Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Jan 7, 2024
1 parent fe115a3 commit 4868793
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ai_diffusion/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import re
from itertools import chain
from pathlib import Path
from typing import Any, List, NamedTuple, Optional
from typing import Any, List, NamedTuple, Optional, overload

from .image import Bounds, Extent, Image, Mask, multiple_of
from .client import Client, resolve_sd_version
Expand Down Expand Up @@ -81,6 +81,12 @@ class ScaledExtent(NamedTuple):
desired: Extent # resolution for high res refinement pass
target: Extent # target resolution in canvas (may not be multiple of 8)

@overload
def convert(self, extent: Extent, src: str, dst: str) -> Extent: ...

@overload
def convert(self, extent: Bounds, src: str, dst: str) -> Bounds: ...

def convert(self, extent: Extent | Bounds, src: str, dst: str):
"""Converts an extent or bounds between two "resolution spaces"
by scaling with the respective ratio."""
Expand Down

0 comments on commit 4868793

Please sign in to comment.