Fixed conditional blocks in imageInference

This commit is contained in:
Sirshendu Ganguly
2026-05-21 17:05:53 +05:30
parent efc0a7cd75
commit 5c70d766b7
2 changed files with 15 additions and 10 deletions
+1 -1
View File
@@ -351,7 +351,7 @@ class txt2img:
genConfig[0]["embeddings"] = runwareEmbedding
elif (isinstance(runwareEmbedding, dict)):
genConfig[0]["embeddings"] = [runwareEmbedding]
if (runwareOutpainting is not None):
if runwareOutpainting:
genConfig[0]["outpaint"] = runwareOutpainting
if (runwareVAE is not None):
genConfig[0]["vae"] = runwareVAE
+14 -9
View File
@@ -1,3 +1,8 @@
def _round_to_multiple_of_64(value: int) -> int:
"""Round pixel extension to the nearest multiple of 64 (API constraint)."""
return max(0, min(2048, round(value / 64) * 64))
class outpaintSettings:
@classmethod
def INPUT_TYPES(cls):
@@ -10,7 +15,7 @@ class outpaintSettings:
"Top": (
"INT",
{
"tooltip": "Number of pixels to extend at the top of the image. Must be a multiple of 64. Only used when 'Use Top' is enabled.",
"tooltip": "Number of pixels to extend at the top of the image. Rounded to the nearest multiple of 64 when sent to the API. Only used when 'Use Top' is enabled.",
"default": 64,
"min": 0,
"max": 2048,
@@ -24,7 +29,7 @@ class outpaintSettings:
"Right": (
"INT",
{
"tooltip": "Number of pixels to extend at the right of the image. Must be a multiple of 64. Only used when 'Use Right' is enabled.",
"tooltip": "Number of pixels to extend at the right of the image. Rounded to the nearest multiple of 64 when sent to the API. Only used when 'Use Right' is enabled.",
"default": 64,
"min": 0,
"max": 2048,
@@ -38,7 +43,7 @@ class outpaintSettings:
"Bottom": (
"INT",
{
"tooltip": "Number of pixels to extend at the bottom of the image. Must be a multiple of 64. Only used when 'Use Bottom' is enabled.",
"tooltip": "Number of pixels to extend at the bottom of the image. Rounded to the nearest multiple of 64 when sent to the API. Only used when 'Use Bottom' is enabled.",
"default": 64,
"min": 0,
"max": 2048,
@@ -52,7 +57,7 @@ class outpaintSettings:
"Left": (
"INT",
{
"tooltip": "Number of pixels to extend at the left of the image. Must be a multiple of 64. Only used when 'Use Left' is enabled.",
"tooltip": "Number of pixels to extend at the left of the image. Rounded to the nearest multiple of 64 when sent to the API. Only used when 'Use Left' is enabled.",
"default": 64,
"min": 0,
"max": 2048,
@@ -86,14 +91,14 @@ class outpaintSettings:
outpaint = {}
if kwargs.get("useTop", False):
outpaint["top"] = int(kwargs.get("Top", 0))
outpaint["top"] = _round_to_multiple_of_64(int(kwargs.get("Top", 0)))
if kwargs.get("useRight", False):
outpaint["right"] = int(kwargs.get("Right", 0))
outpaint["right"] = _round_to_multiple_of_64(int(kwargs.get("Right", 0)))
if kwargs.get("useBottom", False):
outpaint["bottom"] = int(kwargs.get("Bottom", 0))
outpaint["bottom"] = _round_to_multiple_of_64(int(kwargs.get("Bottom", 0)))
if kwargs.get("useLeft", False):
outpaint["left"] = int(kwargs.get("Left", 0))
outpaint["left"] = _round_to_multiple_of_64(int(kwargs.get("Left", 0)))
if kwargs.get("useBlur", False):
outpaint["blur"] = int(kwargs.get("Blur", 0))
return (outpaint,)
return (outpaint if outpaint else None,)