Skip to content

Commit

Permalink
fix(api): make sure upscaling only runs once regardless of correction…
Browse files Browse the repository at this point in the history
… options
  • Loading branch information
ssube committed Dec 31, 2023
1 parent 71fbc87 commit c6718a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions api/onnx_web/chain/upscale.py
Expand Up @@ -22,6 +22,7 @@ def split_upscale(
):
return (
upscale.with_args(
upscale=False,
scale=1,
outscale=1,
),
Expand Down
20 changes: 10 additions & 10 deletions api/scripts/test-release.py
Expand Up @@ -163,12 +163,12 @@ def __init__(
),
TestCase(
"upscale-resrgan-x2-1024-muffin",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-real-esrgan-x2-plus&scale=2&outscale=2",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-real-esrgan-x2-plus&scale=2&outscale=2&upscale=true",
source="txt2img-sd-v1-5-512-muffin-0",
),
TestCase(
"upscale-resrgan-x4-2048-muffin",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-real-esrgan-x4-plus&scale=4&outscale=4",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-real-esrgan-x4-plus&scale=4&outscale=4&upscale=true",
source="txt2img-sd-v1-5-512-muffin-0",
),
TestCase(
Expand Down Expand Up @@ -208,7 +208,7 @@ def __init__(
),
TestCase(
"upscale-swinir-x4-2048-muffin",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-swinir-real-large-x4&scale=4&outscale=4",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-swinir-real-large-x4&scale=4&outscale=4&upscale=true",
source="txt2img-sd-v1-5-512-muffin-0",
),
TestCase(
Expand All @@ -223,7 +223,7 @@ def __init__(
),
TestCase(
"upscale-sd-x4-2048-muffin",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-stable-diffusion-x4&scale=4&outscale=4",
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-stable-diffusion-x4&scale=4&outscale=4&upscale=true",
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=VERY_SLOW_TEST,
),
Expand Down Expand Up @@ -264,7 +264,7 @@ def __init__(
"upscale-resrgan-x4-codeformer-2048-muffin",
(
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-real-esrgan-x4-plus&scale=4&outscale=4"
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0"
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0&upscale=true"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
Expand All @@ -273,7 +273,7 @@ def __init__(
"upscale-resrgan-x4-gfpgan-2048-muffin",
(
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-real-esrgan-x4-plus&scale=4&outscale=4"
"&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0"
"&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0&upscale=true"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
Expand All @@ -282,7 +282,7 @@ def __init__(
"upscale-swinir-x4-codeformer-2048-muffin",
(
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-swinir-real-large-x4&scale=4&outscale=4"
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0"
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0&upscale=true"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
Expand All @@ -291,7 +291,7 @@ def __init__(
"upscale-swinir-x4-gfpgan-2048-muffin",
(
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-swinir-real-large-x4&scale=4&outscale=4"
"&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0"
"&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0&upscale=true"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=SLOW_TEST,
Expand All @@ -300,7 +300,7 @@ def __init__(
"upscale-sd-x4-codeformer-2048-muffin",
(
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-stable-diffusion-x4&scale=4&outscale=4"
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0"
"&correction=correction-codeformer&faces=true&faceOutscale=1&faceStrength=1.0&upscale=true"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=VERY_SLOW_TEST,
Expand All @@ -309,7 +309,7 @@ def __init__(
"upscale-sd-x4-gfpgan-2048-muffin",
(
"upscale?prompt=a+giant+pumpkin&seed=0&scheduler=ddim&upscaling=upscaling-stable-diffusion-x4"
"&scale=4&outscale=4&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0"
"&scale=4&outscale=4&correction=correction-gfpgan&faces=true&faceOutscale=1&faceStrength=1.0&upscale=true"
),
source="txt2img-sd-v1-5-512-muffin-0",
max_attempts=VERY_SLOW_TEST,
Expand Down

0 comments on commit c6718a3

Please sign in to comment.