Skip to content

Commit

Permalink
fix(scripts): update test MSE and references for recent tiling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Dec 1, 2023
1 parent 48d0d3e commit 74cb100
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 30 deletions.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/blend-512-muffin-white-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/outpaint-even-256-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/outpaint-horizontal-512-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/outpaint-vertical-512-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/txt2img-sd-v1-5-512-muffin-dpm-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/txt2img-sd-v1-5-512-muffin-heun-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/txt2img-sd-v2-1-512-muffin-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/upscale-sd-x4-2048-muffin-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/upscale-sd-x4-gfpgan-2048-muffin-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 21 additions & 10 deletions api/scripts/test-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
SLOW_TEST = 25
VERY_SLOW_TEST = 75

STRICT_TEST = 1e-4
LOOSE_TEST = 1e-2
VERY_LOOSE_TEST = 0.025


def test_path(relpath: str) -> str:
return path.join(path.dirname(__file__), relpath)
Expand All @@ -41,7 +45,7 @@ def __init__(
name: str,
query: str,
max_attempts: int = FAST_TEST,
mse_threshold: float = 1e-4,
mse_threshold: float = STRICT_TEST,
source: Union[Image.Image, List[Image.Image]] = None,
mask: Image.Image = None,
) -> None:
Expand Down Expand Up @@ -73,18 +77,20 @@ def __init__(
TestCase(
"txt2img-sd-v1-5-512-muffin-heun",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=heun",
mse_threshold=LOOSE_TEST,
),
TestCase(
"txt2img-sd-v1-5-512-muffin-unipc",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=unipc-multi",
mse_threshold=LOOSE_TEST,
),
TestCase(
"txt2img-sd-v2-1-512-muffin",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=ddim&model=stable-diffusion-onnx-v2-1",
),
TestCase(
"txt2img-sd-v2-1-768-muffin",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=ddim&model=stable-diffusion-onnx-v2-1&width=768&height=768",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=ddim&model=stable-diffusion-onnx-v2-1&width=768&height=768&unet_tile=768",
max_attempts=SLOW_TEST,
),
TestCase(
Expand All @@ -106,7 +112,7 @@ def __init__(
),
TestCase(
"img2img-sd-v1-5-256-pumpkin",
"img2img?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&sourceFilter=none",
"img2img?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&sourceFilter=none&unet_tile=256",
source="txt2img-sd-v1-5-256-muffin-0",
),
TestCase(
Expand All @@ -130,7 +136,7 @@ def __init__(
source="txt2img-sd-v1-5-512-muffin-0",
mask="mask-black",
max_attempts=SLOW_TEST,
mse_threshold=0.025,
mse_threshold=VERY_LOOSE_TEST,
),
TestCase(
"outpaint-vertical-512",
Expand All @@ -141,7 +147,7 @@ def __init__(
source="txt2img-sd-v1-5-512-muffin-0",
mask="mask-black",
max_attempts=SLOW_TEST,
mse_threshold=0.010,
mse_threshold=LOOSE_TEST,
),
TestCase(
"outpaint-horizontal-512",
Expand All @@ -152,7 +158,7 @@ def __init__(
source="txt2img-sd-v1-5-512-muffin-0",
mask="mask-black",
max_attempts=SLOW_TEST,
mse_threshold=0.010,
mse_threshold=LOOSE_TEST,
),
TestCase(
"upscale-resrgan-x2-1024-muffin",
Expand Down Expand Up @@ -229,7 +235,7 @@ def __init__(
source="txt2img-sd-v1-5-512-muffin-0",
mask="mask-black",
max_attempts=VERY_SLOW_TEST,
mse_threshold=0.025,
mse_threshold=VERY_LOOSE_TEST,
),
TestCase(
"outpaint-panorama-vertical-512",
Expand All @@ -240,7 +246,7 @@ def __init__(
source="txt2img-sd-v1-5-512-muffin-0",
mask="mask-black",
max_attempts=VERY_SLOW_TEST,
mse_threshold=0.025,
mse_threshold=VERY_LOOSE_TEST,
),
TestCase(
"outpaint-panorama-horizontal-512",
Expand All @@ -251,7 +257,7 @@ def __init__(
source="txt2img-sd-v1-5-512-muffin-0",
mask="mask-black",
max_attempts=VERY_SLOW_TEST,
mse_threshold=0.025,
mse_threshold=VERY_LOOSE_TEST,
),
TestCase(
"upscale-resrgan-x4-codeformer-2048-muffin",
Expand All @@ -260,6 +266,7 @@ def __init__(
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
),
TestCase(
"upscale-resrgan-x4-gfpgan-2048-muffin",
Expand All @@ -268,6 +275,7 @@ def __init__(
"&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
),
TestCase(
"upscale-swinir-x4-codeformer-2048-muffin",
Expand All @@ -276,6 +284,7 @@ def __init__(
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
),
TestCase(
"upscale-swinir-x4-gfpgan-2048-muffin",
Expand All @@ -284,6 +293,7 @@ def __init__(
"&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
),
TestCase(
"upscale-sd-x4-codeformer-2048-muffin",
Expand Down Expand Up @@ -316,7 +326,7 @@ def __init__(
),
TestCase(
"txt2img-sd-v1-5-tall-muffin",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=ddim&width=512&height=768",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=ddim&width=512&height=768&unet_tile=768",
),
TestCase(
"upscale-resrgan-x4-tall-muffin",
Expand All @@ -325,6 +335,7 @@ def __init__(
"&correction=correction-gfpgan&faces=false&faceOutscale=1&faceStrength=1.0"
),
source="txt2img-sd-v1-5-tall-muffin-0",
max_attempts=SLOW_TEST,
),
# TODO: non-square controlnet
]
Expand Down

0 comments on commit 74cb100

Please sign in to comment.