Added Support For outpainting

This commit is contained in:
Jack
2025-04-07 22:31:23 +02:00
parent 892eb42a7b
commit 9a8ddcb5c3
4 changed files with 94 additions and 1 deletions
+3 -1
View File
@@ -1,4 +1,5 @@
from .modules.imageInference import txt2img
from .modules.outpaintSettings import outpaintSettings
from .modules.bgremoval import bgremoval
from .modules.photoMaker import photoMaker
from .modules.upscaler import upscaler
@@ -19,7 +20,7 @@ from .modules.ipAdapter import ipAdapter
from .modules.ipAdapterCombine import ipAdapterCombine
from .modules.vaeSearch import vaeSearch
RUNWARE_COMFYUI_VERSION = "1.0.7 Beta"
RUNWARE_COMFYUI_VERSION = "1.0.8 Beta"
RESET_COLOR = "\033[0m"
BLUE_COLOR = "\033[94m"
@@ -32,6 +33,7 @@ print(BLUE_COLOR + "############################################################
NODE_CLASS_MAPPINGS = {
"Runware Image Inference": txt2img,
"Runware Outpaint": outpaintSettings,
"Runware Background Removal": bgremoval,
"Runware PhotoMaker V2": photoMaker,
"Runware Image Upscaler": upscaler,
+5
View File
@@ -48,6 +48,7 @@ const MODEL_LIST_TERMS = ["ModelList", "LoraList", "ControlNetList", "EmbeddingL
const RUNWARE_NODE_TYPES = {
IMAGEINFERENCE: "Runware Image Inference",
OUTPAINT: "Runware Outpaint",
PHOTOMAKER: "Runware PhotoMaker V2",
MODELSEARCH: "Runware Model Search",
LORASEARCH: "Runware Lora Search",
@@ -74,6 +75,10 @@ const RUNWARE_NODE_PROPS = {
liveDimensions: true,
promptEnhancer: true,
},
[RUNWARE_NODE_TYPES.OUTPAINT]: {
bgColor: DEFAULT_BGCOLOR,
colorModeOnly: true,
},
[RUNWARE_NODE_TYPES.PHOTOMAKER]: {
bgColor: DEFAULT_BGCOLOR,
liveDimensions: true,
+6
View File
@@ -104,6 +104,9 @@ class txt2img:
"Lora": ("RUNWARELORA", {
"tooltip": "Connect a Runware Lora From Lora Search Node Or Lora Combine For Multiple Lora's Together.",
}),
"Outpainting": ("RUNWAREOUTPAINT", {
"tooltip": "Connect a Runware Outpainting Node to extend the image boundaries in different directions.",
}),
"IPAdapters": ("RUNWAREIPAdapter", {
"tooltip": "Connect a Runware IP Adapter node or IP Adapter Combine node to use reference images for guiding the generation.",
}),
@@ -150,6 +153,7 @@ class txt2img:
promptWeighting = kwargs.get("Prompt Weighting", "Disabled")
runwareControlNet = kwargs.get("ControlNet", None)
runwareLora = kwargs.get("Lora", None)
runwareOutpainting = kwargs.get("Outpainting", None)
runwareIPAdapters = kwargs.get("IPAdapters", None)
runwareRefiner = kwargs.get("Refiner", None)
runwareEmbedding = kwargs.get("Embeddings", None)
@@ -216,6 +220,8 @@ class txt2img:
genConfig[0]["embeddings"] = runwareEmbedding
elif (isinstance(runwareEmbedding, dict)):
genConfig[0]["embeddings"] = [runwareEmbedding]
if (runwareOutpainting is not None):
genConfig[0]["outpaint"] = runwareOutpainting
if (runwareVAE is not None):
genConfig[0]["vae"] = runwareVAE
if (runwareControlNet is not None):
+80
View File
@@ -0,0 +1,80 @@
class outpaintSettings:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"Top": (
"INT",
{
"tooltip": "Number of pixels to extend at the top of the image. Must be a multiple of 64.",
"default": 64,
"min": 0,
"max": 2048,
"step": 64,
},
),
"Right": (
"INT",
{
"tooltip": "Number of pixels to extend at the right of the image. Must be a multiple of 64.",
"default": 64,
"min": 0,
"max": 2048,
"step": 64,
},
),
"Bottom": (
"INT",
{
"tooltip": "Number of pixels to extend at the bottom of the image. Must be a multiple of 64.",
"default": 64,
"min": 0,
"max": 2048,
"step": 64,
},
),
"Left": (
"INT",
{
"tooltip": "Number of pixels to extend at the left of the image. Must be a multiple of 64.",
"default": 64,
"min": 0,
"max": 2048,
"step": 64,
},
),
"Blur": (
"INT",
{
"tooltip": "The amount of blur to apply at the boundaries between the original image and the extended areas, measured in pixels.",
"default": 0,
"min": 0,
"max": 32,
"step": 1,
},
),
},
}
DESCRIPTION = "Can Be Added To Image Inference Nodes To Extend the image boundaries in specified directions. \n\nYou must provide the final dimensions using width and height parameters, which should account for the original image size plus the total extension (seedImage dimensions + top + bottom, left + right)."
FUNCTION = "outpaintSettings"
RETURN_TYPES = ("RUNWAREOUTPAINT",)
RETURN_NAMES = ("Outpaint Settings",)
CATEGORY = "Runware"
def outpaintSettings(self, **kwargs):
top = kwargs.get("Top", 0)
right = kwargs.get("Right", 0)
bottom = kwargs.get("Bottom", 0)
left = kwargs.get("Left", 0)
blur = kwargs.get("Blur", 0)
outpaint = {
"top": top,
"right": right,
"bottom": bottom,
"left": left,
"blur": blur,
}
return (outpaint,)