From 80483138b54087b436c5f5b87590574df9d4b555 Mon Sep 17 00:00:00 2001 From: Jacob Segal Date: Sat, 22 Apr 2023 15:58:48 -0700 Subject: [PATCH] Initial Commit --- .gitignore | 2 + .gitmodules | 3 + MaskNodes.py | 1015 ++++ README.md | 262 + __init__.py | 3 + clipseg | 1 + examples/composition-by-photobashing.json | 2418 +++++++++ examples/filter-by-season.json | 1150 +++++ examples/inpaint-faces.json | 2265 +++++++++ examples/inpaint-with-lora.json | 1202 +++++ tests/general_tests.json | 5443 +++++++++++++++++++++ tests/multisubject_tests.json | 2318 +++++++++ tests/separation_tests.json | 990 ++++ 13 files changed, 17072 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 MaskNodes.py create mode 100644 README.md create mode 100644 __init__.py create mode 160000 clipseg create mode 100644 examples/composition-by-photobashing.json create mode 100644 examples/filter-by-season.json create mode 100644 examples/inpaint-faces.json create mode 100644 examples/inpaint-with-lora.json create mode 100644 tests/general_tests.json create mode 100644 tests/multisubject_tests.json create mode 100644 tests/separation_tests.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb3689d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +download_cache diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b232708 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "clipseg"] + path = clipseg + url = https://github.com/timojl/clipseg.git diff --git a/MaskNodes.py b/MaskNodes.py new file mode 100644 index 0000000..331c5fc --- /dev/null +++ b/MaskNodes.py @@ -0,0 +1,1015 @@ +from PIL import Image, ImageFilter, ImageOps +import os +import torch +import numpy as np +import math +from torchvision import transforms +from torchvision.ops import masks_to_boxes +import torchvision.transforms.functional as TF +import torch.nn.functional as torchfn +from .clipseg.models.clipseg import CLIPDensePredT + +DELIMITER = '|' +cached_clipseg_model = None +VERY_BIG_SIZE = 1024 * 1024 + +def tensor2mask(t: torch.Tensor) -> torch.Tensor: + size = t.size() + if (len(size) < 4): + return t + if size[3] == 1: + return t[:,:,:,0] + elif size[3] == 4: + # Not sure what the right thing to do here is. Going to try to be a little smart and use alpha unless all alpha is 1 in case we'll fallback to RGB behavior + if torch.min(t[:, :, :, 3]).item() != 1.: + return t[:,:,:,3] + + return TF.rgb_to_grayscale(tensor2rgb(t).permute(0,3,1,2), num_output_channels=1)[:,0,:,:] + +def tensor2rgb(t: torch.Tensor) -> torch.Tensor: + size = t.size() + if (len(size) < 4): + return t.unsqueeze(3).repeat(1, 1, 1, 3) + if size[3] == 1: + return t.repeat(1, 1, 1, 3) + elif size[3] == 4: + return t[:, :, :, :3] + else: + return t + +def tensor2rgba(t: torch.Tensor) -> torch.Tensor: + size = t.size() + if (len(size) < 4): + return t.unsqueeze(3).repeat(1, 1, 1, 4) + elif size[3] == 1: + return t.repeat(1, 1, 1, 4) + elif size[3] == 3: + alpha_tensor = torch.ones((size[0], size[1], size[2], 1)) + return torch.cat((t, alpha_tensor), dim=3) + else: + return t + +def tensor2batch(t: torch.Tensor, bs: torch.Size) -> torch.Tensor: + if len(t.size()) < len(bs): + t = t.unsqueeze(3) + if t.size()[0] < bs[0]: + t.repeat(bs[0], 1, 1, 1) + dim = bs[3] + if dim == 1: + return tensor2mask(t) + elif dim == 3: + return tensor2rgb(t) + elif dim == 4: + return tensor2rgba(t) + +def tensors2common(t1: torch.Tensor, t2: torch.Tensor) -> (torch.Tensor, torch.Tensor): + t1s = t1.size() + t2s = t2.size() + if len(t1s) < len(t2s): + t1 = t1.unsqueeze(3) + elif len(t1s) > len(t2s): + t2 = t2.unsqueeze(3) + + if len(t1.size()) == 3: + if t1s[0] < t2s[0]: + t1 = t1.repeat(t2s[0], 1, 1) + elif t1s[0] > t2s[0]: + t2 = t2.repeat(t1s[0], 1, 1) + else: + if t1s[0] < t2s[0]: + t1 = t1.repeat(t2s[0], 1, 1, 1) + elif t1s[0] > t2s[0]: + t2 = t2.repeat(t1s[0], 1, 1, 1) + + t1s = t1.size() + t2s = t2.size() + if len(t1s) > 3 and t1s[3] < t2s[3]: + return tensor2batch(t1, t2s), t2 + elif len(t1s) > 3 and t1s[3] > t2s[3]: + return t1, tensor2batch(t2, t1s) + else: + return t1, t2 + +class ClipSegNode: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "prompt": ("STRING", {"multiline": True}), + "negative_prompt": ("STRING", {"multiline": True}), + "precision": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01}), + "normalize": (["no", "yes"],), + }, + } + + RETURN_TYPES = ("IMAGE","IMAGE",) + FUNCTION = "get_mask" + + CATEGORY = "Masquerade Nodes" + + def get_mask(self, image, prompt, negative_prompt, precision, normalize): + model = self.load_model() + image = tensor2rgb(image) + B, H, W, _ = image.shape + # clipseg only works on square images, so we'll just use the larger dimension + # TODO - Should we pad instead of resize? + used_dim = max(W, H) + + transform = transforms.Compose([ + transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), + transforms.Resize((used_dim, used_dim), antialias=True) ]) + img = transform(image.permute(0, 3, 1, 2)) + + prompts = prompt.split(DELIMITER) + negative_prompts = negative_prompt.split(DELIMITER) if negative_prompt != '' else [] + with torch.no_grad(): + # Optimize me: Could do positive and negative prompts as part of one batch + dup_prompts = [item for item in prompts for _ in range(B)] + preds = model(img.repeat(len(prompts), 1, 1, 1), dup_prompts)[0] + dup_neg_prompts = [item for item in negative_prompts for _ in range(B)] + negative_preds = model(img.repeat(len(negative_prompts), 1, 1, 1), dup_neg_prompts)[0] if len(negative_prompts) > 0 else None + + preds = torch.nn.functional.interpolate(preds, size=(H, W), mode='nearest') + preds = torch.sigmoid(preds) + preds = preds.reshape(len(prompts), B, H, W) + mask = torch.max(preds, dim=0).values + + if len(negative_prompts) > 0: + negative_preds = torch.nn.functional.interpolate(negative_preds, size=(H, W), mode='nearest') + negative_preds = torch.sigmoid(negative_preds) + negative_preds = negative_preds.reshape(len(negative_prompts), B, H, W) + mask_neg = torch.max(negative_preds, dim=0).values + mask = torch.min(mask, 1. - mask_neg) + + if normalize == "yes": + mask_min = torch.min(mask) + mask_max = torch.max(mask) + mask_range = mask_max - mask_min + mask = (mask - mask_min) / mask_range + thresholded = torch.where(mask >= precision, 1., 0.) + # import code + # code.interact(local=locals()) + return (thresholded.to(device=image.device), mask.to(device=image.device),) + + def load_model(self): + global cached_clipseg_model + if cached_clipseg_model == None: + model = CLIPDensePredT(version='ViT-B/16', reduce_dim=64, complex_trans_conv=True) + model.eval() + + d64_file = self.download_and_cache('rd64-uni-refined.pth', 'https://owncloud.gwdg.de/index.php/s/ioHbRzFx6th32hn/download?path=%2F&files=rd64-uni-refined.pth') + d16_file = self.download_and_cache('rd16-uni.pth', 'https://owncloud.gwdg.de/index.php/s/ioHbRzFx6th32hn/download?path=%2F&files=rd16-uni.pth') + # Use CUDA if it's available + device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') + model.load_state_dict(torch.load(d64_file, map_location=device), strict=False) + model = model.eval().to(device=device) + cached_clipseg_model = model + return cached_clipseg_model + + def download_and_cache(self, cache_name, url): + cache_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'download_cache') + os.makedirs(cache_dir, exist_ok=True) + + file_name = os.path.join(cache_dir, cache_name) + if not os.path.exists(file_name): + print(f'Downloading and caching file: {cache_name}') + with open(file_name, 'wb') as file: + import requests + r = requests.get(url, stream=True) + r.raise_for_status() + for block in r.iter_content(4096): + file.write(block) + print('Finished downloading.') + + return file_name + +class MaskMorphologyNode: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "distance": ("INT", {"default": 5, "min": 0, "max": 128, "step": 1}), + "op": (["dilate", "erode", "open", "close"],), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "morph" + + CATEGORY = "Masquerade Nodes" + + def morph(self, image, distance, op): + image = tensor2mask(image) + if op == "dilate": + image = self.dilate(image, distance) + elif op == "erode": + image = self.erode(image, distance) + elif op == "open": + image = self.erode(image, distance) + image = self.dilate(image, distance) + elif op == "close": + image = self.dilate(image, distance) + image = self.erode(image, distance) + return (image,) + + def erode(self, image, distance): + return 1. - self.dilate(1. - image, distance) + + def dilate(self, image, distance): + kernel_size = 1 + distance * 2 + # Add the channels dimension + image = image.unsqueeze(1) + out = torchfn.max_pool2d(image, kernel_size=kernel_size, stride=1, padding=kernel_size // 2).squeeze(1) + return out + +class MaskCombineOp: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image1": ("IMAGE",), + "image2": ("IMAGE",), + "op": (["union (max)", "intersection (min)", "difference", "multiply", "multiply_alpha", "add", "greater_or_equal", "greater"],), + "clamp_result": (["yes", "no"],), + "round_result": (["no", "yes"],), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "combine" + + CATEGORY = "Masquerade Nodes" + + def combine(self, image1, image2, op, clamp_result, round_result): + image1, image2 = tensors2common(image1, image2) + + if op == "union (max)": + result = torch.max(image1, image2) + elif op == "intersection (min)": + result = torch.min(image1, image2) + elif op == "difference": + result = image1 - image2 + elif op == "multiply": + result = image1 * image2 + elif op == "multiply_alpha": + image1 = tensor2rgba(image1) + image2 = tensor2mask(image2) + result = torch.cat((image1[:, :, :, :3], (image1[:, :, :, 3] * image2).unsqueeze(3)), dim=3) + elif op == "add": + result = image1 + image2 + elif op == "greater_or_equal": + result = torch.where(image1 >= image2, 1., 0.) + elif op == "greater": + result = torch.where(image1 > image2, 1., 0.) + + if clamp_result == "yes": + result = torch.min(torch.max(result, torch.tensor(0.)), torch.tensor(1.)) + if round_result == "yes": + result = torch.round(result) + + return (result,) + +class UnaryMaskOp: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "op": (["invert", "average", "round", "clamp"],), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "op_mask" + + CATEGORY = "Masquerade Nodes" + + def op_mask(self, image, op): + image = tensor2mask(image) + if op == "invert": + return (1. - image,) + elif op == "average": + mean = torch.mean(torch.mean(image,dim=2),dim=1) + return (mean.unsqueeze(1).unsqueeze(2).repeat(1, image.shape[1], image.shape[2]),) + elif op == "round": + return (torch.round(image),) + elif op == "clamp": + return (torch.min(torch.max(image, torch.tensor(0.)), torch.tensor(1.)),) + + +class BlurNode: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "radius": ("INT", {"default": 10, "min": 0, "max": 48, "step": 1}), + "sigma_factor": ("FLOAT", {"default": 1.0, "min": 0.01, "max": 3., "step": 0.01}), + }, + } + + def gaussian_blur(self, image, kernel_size, sigma): + # I'll be honest, I'm not sure this calculation is actually correct for a Gaussian blur, but it looks close enough + kernel = torch.Tensor(kernel_size, kernel_size).to(device=image.device) + center = kernel_size // 2 + variance = sigma**2 + for i in range(kernel_size): + for j in range(kernel_size): + x = i - center + y = j - center + kernel[i, j] = math.exp(-(x**2 + y**2)/(2*variance)) + kernel /= kernel.sum() + + # Pad the input tensor + padding = (kernel_size - 1) // 2 + input_pad = torch.nn.functional.pad(image, (padding, padding, padding, padding), mode='reflect') + + # Reshape the padded input tensor for batched convolution + batch_size, num_channels, height, width = image.shape + input_reshaped = input_pad.reshape(batch_size*num_channels, 1, height+padding*2, width+padding*2) + + # Perform batched convolution with the Gaussian kernel + output_reshaped = torch.nn.functional.conv2d(input_reshaped, kernel.unsqueeze(0).unsqueeze(0)) + + # Reshape the output tensor to its original shape + output_tensor = output_reshaped.reshape(batch_size, num_channels, height, width) + + return output_tensor + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "blur" + + CATEGORY = "Masquerade Nodes" + + def blur(self, image, radius, sigma_factor): + if len(image.size()) == 3: + image = image.unsqueeze(3) + image = image.permute(0, 3, 1, 2) + kernel_size = radius * 2 + 1 + sigma = sigma_factor * (0.6 * radius - 0.3) + result = self.gaussian_blur(image, kernel_size, sigma).permute(0, 2, 3, 1) + if result.size()[3] == 1: + result = result[:, :, :, 0] + return (result,) + +class ImageToMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "method": (["intensity", "alpha"],), + }, + } + + RETURN_TYPES = ("MASK",) + FUNCTION = "convert" + + CATEGORY = "Masquerade Nodes" + + def convert(self, image, method): + if method == "intensity": + if len(image.shape) > 3 and image.shape[3] == 4: + image = tensor2rgb(image) + return (tensor2mask(image),) + else: + return (tensor2rgba(image)[:,:,:,0],) + +class MixByMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image1": ("IMAGE",), + "image2": ("IMAGE",), + "mask": ("IMAGE",), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "mix" + + CATEGORY = "Masquerade Nodes" + + def mix(self, image1, image2, mask): + image1, image2 = tensors2common(image1, image2) + mask = tensor2batch(mask, image1.size()) + return (image1 * (1. - mask) + image2 * mask,) + +class MixColorByMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "r": ("INT", {"default": 0, "min": 0, "max": 255, "step": 1}), + "g": ("INT", {"default": 0, "min": 0, "max": 255, "step": 1}), + "b": ("INT", {"default": 0, "min": 0, "max": 255, "step": 1}), + "mask": ("IMAGE",), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "mix" + + CATEGORY = "Masquerade Nodes" + + def mix(self, image, r, g, b, mask): + image_size = image.size() + image2 = torch.tensor([r, g, b]).to(device=image.device).unsqueeze(0).unsqueeze(0).unsqueeze(0).repeat(image_size[0], image_size[1], image_size[2], 1) + image, image2 = tensors2common(image, image2) + mask = tensor2batch(tensor2mask(mask), image.size()) + return (image * (1. - mask) + image2 * mask,) + +class CreateRectMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "mode": (["percent", "pixels"],), + "origin": (["topleft", "bottomleft", "topright", "bottomright"],), + "x": ("FLOAT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "y": ("FLOAT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "width": ("FLOAT", {"default": 50, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "height": ("FLOAT", {"default": 50, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "image_width": ("INT", {"default": 512, "min": 64, "max": VERY_BIG_SIZE, "step": 64}), + "image_height": ("INT", {"default": 512, "min": 64, "max": VERY_BIG_SIZE, "step": 64}), + }, + "optional": { + "copy_image_size": ("IMAGE",), + } + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "create_mask" + + CATEGORY = "Masquerade Nodes" + + def create_mask(self, mode, origin, x, y, width, height, image_width, image_height, copy_image_size = None): + min_x = x + min_y = y + + max_x = min_x + width + max_y = min_y + height + if copy_image_size is not None: + size = copy_image_size.size() + image_width = size[2] + image_height = size[1] + if mode == "percent": + min_x = min_x / 100.0 * image_width + max_x = max_x / 100.0 * image_width + min_y = min_y / 100.0 * image_height + max_y = max_y / 100.0 * image_height + + if origin == "bottomleft" or origin == "bottomright": + min_y, max_y = image_height - max_y, image_height - min_y + if origin == "topright" or origin == "bottomright": + min_x, max_x = image_width - max_x, image_width - min_x + + mask = torch.zeros((image_height, image_width)) + mask[int(min_y):int(max_y)+1, int(min_x):int(max_x)+1] = 1 + return (mask.unsqueeze(0),) + +class MaskToRegion: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "mask": ("IMAGE",), + "padding": ("INT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "constraints": (["keep_ratio", "keep_ratio_divisible", "multiple_of", "ignore"],), + "constraint_x": ("INT", {"default": 64, "min": 2, "max": VERY_BIG_SIZE, "step": 1}), + "constraint_y": ("INT", {"default": 64, "min": 2, "max": VERY_BIG_SIZE, "step": 1}), + "min_width": ("INT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "min_height": ("INT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "batch_behavior": (["match_ratio", "match_size"],), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "get_region" + + CATEGORY = "Masquerade Nodes" + + def get_region(self, mask, padding, constraints, constraint_x, constraint_y, min_width, min_height, batch_behavior): + mask = tensor2mask(mask) + mask_size = mask.size() + mask_width = int(mask_size[2]) + mask_height = int(mask_size[1]) + + # masks_to_boxes errors if the tensor is all zeros, so we'll add a single pixel and zero it out at the end + is_empty = ~torch.gt(torch.max(torch.reshape(mask,[mask_size[0], mask_width * mask_height]), dim=1).values, 0.) + mask[is_empty,0,0] = 1. + boxes = masks_to_boxes(mask) + mask[is_empty,0,0] = 0. + + # Account for padding + min_x = torch.max(boxes[:,0] - padding, torch.tensor(0.)) + min_y = torch.max(boxes[:,1] - padding, torch.tensor(0.)) + max_x = torch.min(boxes[:,2] + padding, torch.tensor(mask_width)) + max_y = torch.min(boxes[:,3] + padding, torch.tensor(mask_height)) + + width = max_x - min_x + height = max_y - min_y + + # Make sure the width and height are big enough + target_width = torch.max(width, torch.tensor(min_width)) + target_height = torch.max(height, torch.tensor(min_height)) + + if constraints == "keep_ratio": + target_width = torch.max(target_width, target_height * constraint_x // constraint_y) + target_height = torch.max(target_height, target_width * constraint_y // constraint_x) + elif constraints == "keep_ratio_divisible": + # Probably a more efficient way to do this, but given the bounds it's not too bad + max_factors = torch.min(constraint_x // target_width, constraint_y // target_height) + max_factor = int(torch.max(max_factors).item()) + for i in range(1, max_factor+1): + divisible = constraint_x % i == 0 and constraint_y % i == 0 + if divisible: + big_enough = ~torch.lt(target_width, constraint_x // i) * ~torch.lt(target_height, constraint_y // i) + target_width[big_enough] = constraint_x // i + target_height[big_enough] = constraint_y // i + elif constraints == "multiple_of": + target_width[torch.gt(target_width % constraint_x, 0)] = (target_width // constraint_x + 1) * constraint_x + target_height[torch.gt(target_height % constraint_y, 0)] = (target_height // constraint_y + 1) * constraint_y + + if batch_behavior == "match_size": + target_width[:] = torch.max(target_width) + target_height[:] = torch.max(target_height) + elif batch_behavior == "match_ratio": + # We'll target the ratio that's closest to 1:1, but don't want to take into account empty masks + ratios = torch.abs(target_width / target_height - 1) + ratios[is_empty] = 10000 + match_ratio = torch.min(ratios,dim=0).indices.item() + target_width = torch.max(target_width, target_height * target_width[match_ratio] // target_height[match_ratio]) + target_height = torch.max(target_height, target_width * target_height[match_ratio] // target_width[match_ratio]) + + missing = target_width - width + min_x = min_x - missing // 2 + max_x = max_x + (missing - missing // 2) + + missing = target_height - height + min_y = min_y - missing // 2 + max_y = max_y + (missing - missing // 2) + + # Move the region into range if needed + bad = torch.lt(min_x,0) + max_x[bad] -= min_x[bad] + min_x[bad] = 0 + + bad = torch.lt(min_y,0) + max_y[bad] -= min_y[bad] + min_y[bad] = 0 + + bad = torch.gt(max_x, mask_width) + min_x[bad] -= (max_x[bad] - mask_width) + max_x[bad] = mask_width + + bad = torch.gt(max_y, mask_height) + min_y[bad] -= (max_y[bad] - mask_height) + max_y[bad] = mask_height + + region = torch.zeros((mask_size[0], mask_height, mask_width)) + for i in range(0, mask_size[0]): + if not is_empty[i]: + ymin = int(min_y[i].item()) + ymax = int(max_y[i].item()) + xmin = int(min_x[i].item()) + xmax = int(max_x[i].item()) + region[i, ymin:ymax+1, xmin:xmax+1] = 1 + return (region,) + +class CutByMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "mask": ("IMAGE",), + "force_resize_width": ("INT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "force_resize_height": ("INT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + }, + "optional": { + "mask_mapping_optional": ("MASK_MAPPING",), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "cut" + + CATEGORY = "Masquerade Nodes" + + def cut(self, image, mask, force_resize_width, force_resize_height, mask_mapping_optional = None): + if len(image.shape) < 4: + C = 1 + else: + C = image.shape[3] + + # We operate on RGBA to keep the code clean and then convert back after + image = tensor2rgba(image) + mask = tensor2mask(mask) + + if mask_mapping_optional is not None: + image = image[mask_mapping_optional] + + # Scale the mask to be a matching size if it isn't + B, H, W, _ = image.shape + mask = torch.nn.functional.interpolate(mask.unsqueeze(1), size=(H, W), mode='nearest')[:,0,:,:] + MB, _, _ = mask.shape + + if MB < B: + assert(B % MB == 0) + mask = mask.repeat(B // MB, 1, 1) + + # masks_to_boxes errors if the tensor is all zeros, so we'll add a single pixel and zero it out at the end + is_empty = ~torch.gt(torch.max(torch.reshape(mask,[MB, H * W]), dim=1).values, 0.) + mask[is_empty,0,0] = 1. + boxes = masks_to_boxes(mask) + mask[is_empty,0,0] = 0. + + min_x = boxes[:,0] + min_y = boxes[:,1] + max_x = boxes[:,2] + max_y = boxes[:,3] + + width = max_x - min_x + 1 + height = max_y - min_y + 1 + + use_width = int(torch.max(width).item()) + use_height = int(torch.max(height).item()) + + if force_resize_width > 0: + use_width = force_resize_width + + if force_resize_height > 0: + use_height = force_resize_height + + alpha_mask = torch.ones((B, H, W, 4)) + alpha_mask[:,:,:,3] = mask + + image = image * alpha_mask + + result = torch.zeros((B, use_height, use_width, 4)) + for i in range(0, B): + if not is_empty[i]: + ymin = int(min_y[i].item()) + ymax = int(max_y[i].item()) + xmin = int(min_x[i].item()) + xmax = int(max_x[i].item()) + single = (image[i, ymin:ymax+1, xmin:xmax+1,:]).unsqueeze(0) + resized = torch.nn.functional.interpolate(single.permute(0, 3, 1, 2), size=(use_height, use_width), mode='bicubic').permute(0, 2, 3, 1) + result[i] = resized[0] + + # Preserve our type unless we were previously RGB and added non-opaque alpha due to the mask size + if C == 1: + return (tensor2mask(result),) + elif C == 3 and torch.min(result[:,:,:,3]) == 1: + return (tensor2rgb(result),) + else: + return (result,) + +class SeparateMaskComponents: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "mask": ("IMAGE",), + }, + } + + RETURN_TYPES = ("IMAGE","MASK_MAPPING") + FUNCTION = "separate" + + CATEGORY = "Masquerade Nodes" + + def separate(self, mask): + mask = tensor2mask(mask) + + thresholded = torch.gt(mask,0).unsqueeze(1) + B, H, W = mask.shape + components = torch.arange(B * H * W, device=mask.device, dtype=mask.dtype).reshape(B, 1, H, W) + 1 + components[~thresholded] = 0 + + while True: + previous_components = components + components = torch.nn.functional.max_pool2d(components, kernel_size=3, stride=1, padding=1) + components[~thresholded] = 0 + if torch.equal(previous_components, components): + break + + components = components.reshape(B, H, W) + segments = torch.unique(components) + result = torch.zeros([len(segments) - 1, H, W]) + index = 0 + mapping = torch.zeros([len(segments) - 1], device=mask.device, dtype=torch.int) + for i in range(len(segments)): + segment = segments[i].item() + if segment == 0: + continue + image_index = int((segment - 1) // (H * W)) + segment_mask = (components[image_index,:,:] == segment) + result[index][segment_mask] = mask[image_index][segment_mask] + mapping[index] = image_index + index += 1 + + return (result,mapping,) + + +class PasteByMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image_base": ("IMAGE",), + "image_to_paste": ("IMAGE",), + "mask": ("IMAGE",), + "resize_behavior": (["resize", "keep_ratio_fill", "keep_ratio_fit", "source_size", "source_size_unmasked"],) + }, + "optional": { + "mask_mapping_optional": ("MASK_MAPPING",), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "paste" + + CATEGORY = "Masquerade Nodes" + + def paste(self, image_base, image_to_paste, mask, resize_behavior, mask_mapping_optional = None): + image_base = tensor2rgba(image_base) + image_to_paste = tensor2rgba(image_to_paste) + mask = tensor2mask(mask) + + # Scale the mask to be a matching size if it isn't + B, H, W, C = image_base.shape + MB = mask.shape[0] + if mask_mapping_optional is None and MB < B: + assert(B % MB == 0) + mask = mask.repeat(B // MB, 1, 1) + mask = torch.nn.functional.interpolate(mask.unsqueeze(1), size=(H, W), mode='nearest')[:,0,:,:] + MB, MH, MW = mask.shape + + # masks_to_boxes errors if the tensor is all zeros, so we'll add a single pixel and zero it out at the end + is_empty = ~torch.gt(torch.max(torch.reshape(mask,[MB, MH * MW]), dim=1).values, 0.) + mask[is_empty,0,0] = 1. + boxes = masks_to_boxes(mask) + mask[is_empty,0,0] = 0. + + min_x = boxes[:,0] + min_y = boxes[:,1] + max_x = boxes[:,2] + max_y = boxes[:,3] + mid_x = (min_x + max_x) / 2 + mid_y = (min_y + max_y) / 2 + + target_width = max_x - min_x + 1 + target_height = max_y - min_y + 1 + + result = image_base.detach().clone() + for i in range(0, MB): + if is_empty[i]: + continue + else: + image_index = i + if mask_mapping_optional is not None: + image_index = mask_mapping_optional[i].item() + source_size = image_to_paste.size() + SB, SH, SW, _ = image_to_paste.shape + + # Figure out the desired size + width = int(target_width[i].item()) + height = int(target_height[i].item()) + if resize_behavior == "keep_ratio_fill": + target_ratio = width / height + actual_ratio = SW / SH + if actual_ratio > target_ratio: + width = int(height * actual_ratio) + elif actual_ratio < target_ratio: + height = int(width / actual_ratio) + elif resize_behavior == "keep_ratio_fit": + target_ratio = width / height + actual_ratio = SW / SH + if actual_ratio > target_ratio: + height = int(width / actual_ratio) + elif actual_ratio < target_ratio: + width = int(height * actual_ratio) + elif resize_behavior == "source_size" or resize_behavior == "source_size_unmasked": + width = SW + height = SH + + # Resize the image we're pasting if needed + resized_image = image_to_paste[i].unsqueeze(0) + if SH != height or SW != width: + resized_image = torch.nn.functional.interpolate(resized_image.permute(0, 3, 1, 2), size=(height,width), mode='bicubic').permute(0, 2, 3, 1) + + pasting = torch.ones([H, W, C]) + ymid = float(mid_y[i].item()) + ymin = int(math.floor(ymid - height / 2)) + 1 + ymax = int(math.floor(ymid + height / 2)) + 1 + xmid = float(mid_x[i].item()) + xmin = int(math.floor(xmid - width / 2)) + 1 + xmax = int(math.floor(xmid + width / 2)) + 1 + + _, source_ymax, source_xmax, _ = resized_image.shape + source_ymin, source_xmin = 0, 0 + + if xmin < 0: + source_xmin = abs(xmin) + xmin = 0 + if ymin < 0: + source_ymin = abs(ymin) + ymin = 0 + if xmax > W: + source_xmax -= (xmax - W) + xmax = W + if ymax > H: + source_ymax -= (ymax - H) + ymax = H + + pasting[ymin:ymax, xmin:xmax, :] = resized_image[0, source_ymin:source_ymax, source_xmin:source_xmax, :] + pasting[:, :, 3] = 1. + + pasting_alpha = torch.zeros([H, W]) + pasting_alpha[ymin:ymax, xmin:xmax] = resized_image[0, source_ymin:source_ymax, source_xmin:source_xmax, 3] + + if resize_behavior == "keep_ratio_fill" or resize_behavior == "source_size_unmasked": + # If we explicitly want to fill the area, we are ok with extending outside + paste_mask = pasting_alpha.unsqueeze(2).repeat(1, 1, 4) + else: + paste_mask = torch.min(pasting_alpha, mask[i]).unsqueeze(2).repeat(1, 1, 4) + result[image_index] = pasting * paste_mask + result[image_index] * (1. - paste_mask) + return (result,) + +class GetImageSize: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + }, + } + + RETURN_TYPES = ("INT","INT",) + FUNCTION = "get_size" + + CATEGORY = "Masquerade Nodes" + + def get_size(self, image): + image_size = image.size() + image_width = int(image_size[2]) + image_height = int(image_size[1]) + return (image_width, image_height,) + +class ChangeChannelCount: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "kind": (["mask", "RGB", "RGBA"],), + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "change_channels" + + CATEGORY = "Masquerade Nodes" + + def change_channels(self, image, kind): + image_size = image.size() + + if kind == "mask": + return (tensor2mask(image),) + elif kind == "RGBA": + return (tensor2rgba(image),) + else: # RGB + return (tensor2rgb(image),) + +class ConstantMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "value": ("FLOAT", {"default": 0.0, "min": -8.0, "max": 8.0, "step": 0.01}), + "explicit_height": ("INT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + "explicit_width": ("INT", {"default": 0, "min": 0, "max": VERY_BIG_SIZE, "step": 1}), + }, + "optional": { + "copy_image_size": ("IMAGE",), + } + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "constant_mask" + + CATEGORY = "Masquerade Nodes" + + def constant_mask(self, value, explicit_height, explicit_width, copy_image_size = None): + height = explicit_height + width = explicit_width + if copy_image_size is not None: + size = copy_image_size.size() + height = size[1] + width = size[2] + elif explicit_height == 0 or explicit_width == 0: + # We'll just make a tiny mask and let it get resized by nodes further downstream + height = 16 + width = 16 + + result = torch.zeros([1, height, width]) + result[:,:,:] = value + return (result,) + +class PruneByMask: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE",), + "mask": ("IMAGE",), + } + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "prune" + + CATEGORY = "Masquerade Nodes" + + def prune(self, image, mask): + mask = tensor2mask(mask) + + mean = torch.mean(torch.mean(mask,dim=2),dim=1) + return (image[mean >= 0.5],) + +NODE_CLASS_MAPPINGS = { + "Mask By Text": ClipSegNode, + "Mask Morphology": MaskMorphologyNode, + "Combine Masks": MaskCombineOp, + "Unary Mask Op": UnaryMaskOp, + "Blur": BlurNode, + "Image To Mask": ImageToMask, + "Mix Images By Mask": MixByMask, + "Mix Color By Mask": MixColorByMask, + "Mask To Region": MaskToRegion, + "Cut By Mask": CutByMask, + "Paste By Mask": PasteByMask, + "Get Image Size": GetImageSize, + "Change Channel Count": ChangeChannelCount, + "Constant Mask": ConstantMask, + "Prune By Mask": PruneByMask, + "Separate Mask Components": SeparateMaskComponents, + "Create Rect Mask": CreateRectMask, +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..a3b184d --- /dev/null +++ b/README.md @@ -0,0 +1,262 @@ +# Masquerade Nodes + +This is a node pack for ComfyUI, primarily dealing with masks. Some example workflows this pack enables are: + +(Note that all examples use the default 1.5 and 1.5-inpainting models. Results are generally better with fine-tuned models.) + +1. Fine control over composition via automatic photobashing (see `examples/composition-by-photobashing.json`) +![CompositionExample](https://user-images.githubusercontent.com/3157454/233810990-4f873506-90c4-4594-ad7f-def400c54885.png) +2. Inpaint all faces at a higher resolution (see `examples/inpaint-faces.json`) +![FaceInpaintingExample](https://user-images.githubusercontent.com/3157454/233810991-dc56d0cb-7477-4e7e-aa7c-b822612c42e5.png) +3. Inpaint all buildings with a particular LORA (see `examples/inpaint-with-lora.json`) +![LoRAInpaintingExample](https://user-images.githubusercontent.com/3157454/233810996-a4e2f30b-a9a6-414f-9e6f-054da37d02ff.png) +4. Filtering out images/change save location of images that contain certain objects/concepts without the side-effects caused by placing those concepts in a negative prompt (see `examples/filter-by-season.json`) +![FilterImagesExample](https://user-images.githubusercontent.com/3157454/233810992-849858e5-64d4-46d4-9d7f-afa20dde622f.png) + +The lynchpin of these workflows is the [Mask by Text](#mask-by-text) node. This node makes use of ClipSeg to dynamically create masks from images via text prompts. + +All nodes in this pack have been tested with batch sizes greater than one. If you encounter any batch-related issues (or any other issues), please create an issue (or even better, a pull request) on Github. + +# Node Descriptions + +## Mask By Text +#### Inputs +* `image` - The image to use to calculate the mask for. +* `prompt` - One or more prompts to select, separated by the `|` symbol. +* `negative_prompt` - Zero or more prompts to select, separated by the `|` symbol. +* `precision` - How sure to be about the mask created. +* `normalize` - Whether results should be normalized across the image. + * Note - This can be useful if you know for certain that your prompt exists in the image, but the model inconsistently recognizes it. I would generally recommend trying with normalize turned off first. +#### Outputs +1. Thresholded Mask - The calculated mask after taking precision and normalization into account. +2. Raw ClipSeg Results - The raw results from ClipSeg. Values are between 0.0 and 1.0. + +#### Tips +* Using multiple prompts/negative prompts within one node is an ease-of-use and runtime optimization feature. The same result can be achieved with multiple Mask by Text nodes by using `Combine Masks -> Union` and `Combine Masks -> Difference`. +* You can use the raw ClipSeg results for more complex operations (like comparing the relative likelihood of two concepts). + +## Mask Morphology +#### Inputs +* `image` - The mask to perform the operation on. +* `distance` - The distance across which to perform the operation. +* `op` - The operation to perform. + * `dilate` - Expand the size of the mask. + * `erode` - Contract the size of the mask. + * `open` - Erode and then dilate. Useful to remove white specs in the mask. + * `close` - Dilate and then erode. Useful to remove black specs in the mask. + +#### Outputs +1. The resultant mask. + +#### Tips +* Open is useful to remove white specs in a mask. You should generally use it before a Separate Mask Components node. +* Close is useful to remove black specs in a mask. + +## Combine Masks +#### Inputs +* `image1` - The first mask to use. +* `image2` - The second mask to use. +* `op` - The operation to perform. + * `union (max)` - The maximum value between the two masks. + * `intersection (min)` - The minimum, value between the two masks. + * `difference` - The pixels that are white in the first mask but black in the second. + * `multiply` - The result of multiplying the two masks together. Same as intersection for any thresholded masks. + * `multiply_alpha` - An alpha channel is added to the first image if required and then the second image (treated as a mask) is multiplied on top. + * `add` - The result of adding the two masks together. Same as union for any thresholded masks (if clamped). + * `greater_or_equal` - image1 >= image1. + * `greater` - image1 > image1. Same as difference for any thresholded masks. +* `clamp_result` - Whether results should be clamped between 0 and 1. Usually you want this. +* `round_result` - Whether results should be rounded to 0 or 1. + +#### Outputs +1. The resultant mask or image. + +#### Tips +* This node can also be used with RGB/RGBA images. This can be useful to alpha out part of an image based on a mask (via multiplication). + +## Unary Mask Op +#### Inputs +* `image` - The mask to operate on. +* `op` - The operation to perform. + * `invert` - Inverts the mask. + * `average` - Sets the value of all pixels in the mask to be equal to the value of the average pixel. + * `round` - Rounds all pixels to the nearest integer (generally 0 or 1). + * `clamp` - Clamps all values between 0 and 1. + +#### Outputs +1. The resultant mask. + +#### Tips +* Average is deceptively useful. For example, you can use two Mask to Text nodes with different concepts (like 'New York' and 'Chicago') and average the raw ClipSeg result to see which city the image is more likely to depict. + +## Blur +#### Inputs +* `image` - The image to blur. +* `radius` - How much to blur the image. +* `sigma_factor` - Control the falloff speed of the blur. + +#### Outputs +1. The resultant mask or image. + +#### Tips +* This node can be used on both masks and images. +* You can usually leave the sigma factor at 1. + +## Image To Mask +#### Inputs +* `image` - The image to convert. +* `method` - The method to use for conversion. + * `intensity` - Uses the grayscale color of the image. + * `alpha` - Uses the alpha mask of the image. + +#### Outputs +1. The resultant mask in a form usable by inpainting. + +## Mix Images By Mask +#### Inputs +* `image1` - The first image. +* `image2` - The second image. +* `mask` - The mask to use to interpolate between the two images. + +#### Outputs +1. The resultant image. + +## Mix Color By Mask +#### Inputs +* `image` - The first image. +* `r, g, b` - The red, green and blue components to use for the color. +* `mask` - The mask to use to interpolate between the image and the color. + +#### Outputs +1. The resultant image. + +## Mask To Region +#### Inputs +* `mask` - The mask to use to calculate the region for. +* `padding` - How much padding to add around the mask. +* `constraints` - Once we determine a minimum size, the mask will be grown until it meets the specified constraint. + * `keep_ratio` - The region's ratio will be the same as the ratio between `constraint_x` and `constraint_y`. + * `keep_ratio_divisible` - The region's ratio will be the same as the ratio between `constraint_x` and `constraint_y`. Additionally, the region's width will divide evenly into `constraint_x` and the region's height will divide evenly into `constraint_y`. + * `multiple_of` - The region's width will be a multiple of `constraint_x` and the region's height will be a multiple of `constraint_y`. + * `ignore` - No special constraints (`constraint_x` and `constraint_y` are meaningless). +* `constraint_x` - See constraints. +* `constraint_y` - See constraints. +* `min_width` - The minimum width of the region. +* `min_height` - The minimum height of the region. +* `batch_behavior` - How to handle batches of multiple images/masks. + * `match_ratio` - The region will have the same ratio for all masks. Additionally, all masks will be scaled to the size of the largest mask with bicubic filtering applied. + * `match_size` - All regions will grow to the size of the largest mask. + +#### Outputs +1. A mask of the resultant region. + +#### Tips +* This node is particularly useful for an inpainting at full resolution. You can use it to select a reasonable area around the masked area you want to inpaint. + +## Cut By Mask +#### Inputs +* `image` - The image or mask to cut the masked area out of. +* `mask` - The mask specifying the area to cut. +* `force_resize_width` - If non-zero, the image will be resized to this width. +* `force_resize_height` - If non-zero, the image will be resized to this height. +* `mask_mapping_optional` - If there are a variable number of masks for each image (due to use of [Separate Mask Components](#separate-mask-components)), use the mask mapping output of that node to cut the masks out of the correct image. Leave this unused otherwise. + +#### Outputs +1. The resultant image or mask. + +#### Notes +* If there are multiple masks/images and `force_resize_width` and `force_resize_height` are zero, all images will be resized to the size of the largest. +* If the mask is not rectangular, alpha will be applied to areas outside of the mask. If you paste the image back with [Paste By Mask](#paste-by-mask), areas with 0 alpha will not be pasted. + +#### Tips +* You will frequently want to use [Mask To Region](#mask-to-region) to generate the mask to cut out. You can then cut out both the image and the original mask to get your inpainting target. +* If you are using a batch size greater than one, you should use `keep_ratio` when creating the region to ensure that masks aren't distorted due to resizing. + +## Paste By Mask +#### Inputs +* `image_base` - The image to paste the mask into. +* `image_to_paste` - The image to paste. +* `mask` - The mask (over the base image) specifying where to paste the image. +* `resize_behavior` - How to handle pasted images that don't match the size of the area to paste. + * `resize` - Resize the image to match the size of the area to paste. + * `keep_ratio_fill` - Resize the image to match the size of the region to paste while preserving aspect ratio. The resize will extent outside the masked area. + * `keep_ratio_fit` - Resize the image to match the size of the region to paste while preserving aspect ratio. The resize will be entirely contained within the masked area. + * `source_size` - Use the size of the image to paste as the size of the region to paste. It will be centered on the masked area and areas outside of the mask will not be pasted. + * `source_size_unmasked` - Use the size of the image to paste as the size of the region to paste. It will be centered on the masked area and may extend outside the masked area. +* `mask_mapping_optional` - If there are a variable number of masks for each image (due to use of [Separate Mask Components](#separate-mask-components)), use the mask mapping output of that node to paste the masks into the correct image. Leave this unused otherwise. +#### Outputs +1. The resultant image. + +#### Tips +* Because modifying the paste mask to be different than the mask used to cut may alter the size/position at which it is pasted, you can add alpha to the `image_to_paste` (e.g. via [Combine Masks](#combine-masks) -> `multiply_alpha`) to paste only some parts. + +## Get Image Size +#### Inputs +* `image` - The image to get the size of. + +#### Outputs +1. The width of the image. +2. The height of the image. + +#### Notes +* This utility function can be useful to propagate sizes through a graph so they only have to be updated at the original latent image location. + +## Change Channel Count +#### Inputs +* `image` - The image to change the channel count of. +* `kind` + * `mask` - Convert the image to one channel. If there is variable alpha, alpha will be used. Otherwise, image intensity will be used. + * `RGB` - Convert the image to three channels. Any alpha is discarded. + * `RGBA` - Convert the image to four channels. If there are already 3 channels, the image is purely opaque. If there is only 1 channel, all 4 channels will be equal to that value (so both intensity and alpha conversions back to a mask will result in the same value). + +#### Outputs +1. The resultant image. + +#### Notes +* All nodes in this pack will perform automatic conversions to appropriate channel counts. You only need to use this node when interfacing with an external node that assumes a specific count. (For example, inpainting requires `RGB` images.) + +## Constant Mask +#### Inputs +* `value` - The value to use for the mask. +* `explicit_height` - The explicit height of the mask. Will only be used if `copy_image_size` is empty. +* `explicit_width` - The explicit width of the mask. Will only be used if `copy_image_size` is empty. +* `copy_image_size` - If specified, the mask will have the same size as the given image. + +#### Outputs +1. The resultant mask. + +#### Tips +* This is generally used with [Combine Masks](#combine-masks). + +## Prune By Mask +#### Inputs +* `image` - The batch of images to prune. +* `mask` - Masks determining which images to keep. + +#### Outputs +1. The pruned batch of images. Only images with an associated mask with an average value greater than 0.5 will be included. + +#### Tips +* This node is only useful when using batch sizes > 1. + +## Separate Mask Components +#### Inputs +* `mask` - The mask to separate into contiguous components. + +#### Outputs +1. A batch of masks. Each contiguous area of the mask will be separated into its own mask. Any values greater than 0 are considered part of a contiguous area. +2. A mapping from the original mask to the new masks. This is useful when using [Cut By Mask](#cut-by-mask) and [Paste By Mask](#paste-by-mask) when a batch size larger than one was fed into this node. + +## Create Rect Mask +#### Inputs +* `mode` + * `percent` - Input values (`x`, `y`, `width`, and `height`) are treated as a percentage of the overall image (for example, 50.0 is half the image). + * `pixels` - Input values (`x`, `y`, `width`, and `height`) are treated as pixel values. +* `origin` - The origin to use for `x` and `y` (`topleft`, `bottomleft`, `topright`, `bottomright`). +* `x` - The x offset from the selected `origin` of the rect. +* `y` - The y offset from the selected `origin` of the rect. +* `width` - The width of the rect. +* `height` - The height of the rect. +* `image_width` - The width of the overall image to use. Will only be used if `copy_image_size` is empty. +* `image_height` - The height of the overall image to use. Will only be used if `copy_image_size` is empty. +* `copy_image_size` - If specified, the mask will have the same size as the given image. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..6394ad8 --- /dev/null +++ b/__init__.py @@ -0,0 +1,3 @@ +from .MaskNodes import NODE_CLASS_MAPPINGS + +__all__ = ['NODE_CLASS_MAPPINGS'] diff --git a/clipseg b/clipseg new file mode 160000 index 0000000..bbc86cf --- /dev/null +++ b/clipseg @@ -0,0 +1 @@ +Subproject commit bbc86cfbb7e6a47fb6dae47ba01d3e1c2d6158b0 diff --git a/examples/composition-by-photobashing.json b/examples/composition-by-photobashing.json new file mode 100644 index 0000000..fc15933 --- /dev/null +++ b/examples/composition-by-photobashing.json @@ -0,0 +1,2418 @@ +{ + "last_node_id": 59, + "last_link_id": 86, + "nodes": [ + { + "id": 34, + "type": "CheckpointLoaderSimple", + "pos": [ + -65.09565259765502, + -497.6210079101566 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": true + }, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 41 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 45, + 46 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 48 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "v1-5-pruned-emaonly.ckpt" + ] + }, + { + "id": 36, + "type": "CLIPTextEncode", + "pos": [ + 231.90434740234372, + -515.6210079101565 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 45 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 42 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a cat sitting in a garden" + ] + }, + { + "id": 37, + "type": "CLIPTextEncode", + "pos": [ + 259.9043474023438, + -297.62100791015655 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 46 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 43 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, (cropped:1.2)" + ] + }, + { + "id": 35, + "type": "EmptyLatentImage", + "pos": [ + 266.9043474023438, + -223.6210079101567 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": true + }, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 44 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 33, + "type": "KSampler", + "pos": [ + 793.9043474023435, + -452.62100791015666 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": true + }, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 41 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 42 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 43 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 44 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 47 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019332, + "fixed", + 20, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 38, + "type": "VAEDecode", + "pos": [ + 960.9043474023433, + -460.62100791015666 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": { + "collapsed": true + }, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 47 + }, + { + "name": "vae", + "type": "VAE", + "link": 48 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 49, + 50, + 52 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 40, + "type": "Mask By Text", + "pos": [ + 1634.3463375561516, + -453.70436388671925 + ], + "size": [ + 210, + 194 + ], + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 50 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 51, + 72 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": null + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "cat", + "", + 0.5, + "no" + ] + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + -85.31077308288576, + 4.173759730224779 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": true + }, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "v1-5-pruned-emaonly.ckpt" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 236.6191908300782, + -22.912266240234402 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a dog sitting in a garden" + ] + }, + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 272.61919083007774, + 206.08773375976557 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, (cropped:1.2)" + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 267.6191908300778, + 261.0877337597657 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": true + }, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 780.619190830078, + 61.08773375976565 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": true + }, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019176, + "fixed", + 20, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 960.619190830078, + 5.087733759765561 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": { + "collapsed": true + }, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 10, + 11, + 29 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 52, + "type": "PreviewImage", + "pos": [ + 1921.8838887548811, + -575.3182576171876 + ], + "size": [ + 309.69307861328025, + 382.5009643554682 + ], + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 72 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 42, + "type": "PreviewImage", + "pos": [ + 2681.883888754881, + -568.3182576171876 + ], + "size": [ + 319.675769042969, + 361.5376953125 + ], + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 53 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 25, + "type": "Cut By Mask", + "pos": [ + 2317.4753361572266, + 5.157430092773351 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 29 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 30 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 33, + 82 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 56, + "type": "PreviewImage", + "pos": [ + 2714.1491902197267, + -124.13625049316397 + ], + "size": { + "0": 319.67578125, + "1": 361.5376892089844 + }, + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 82 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 55, + "type": "PreviewImage", + "pos": [ + 1947.1491902197265, + -134.13625049316397 + ], + "size": { + "0": 309.6930847167969, + "1": 382.5009765625 + }, + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 81 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 18, + "type": "CheckpointLoaderSimple", + "pos": [ + -91.35859603027352, + 538.558002216797 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": true + }, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 17 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 21, + 22 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 24 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "v1-5-pruned-emaonly.ckpt" + ] + }, + { + "id": 20, + "type": "CLIPTextEncode", + "pos": [ + 240.6414039697265, + 475.558002216797 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 21 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 18 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a a garden" + ] + }, + { + "id": 21, + "type": "CLIPTextEncode", + "pos": [ + 276.64140396972647, + 692.558002216797 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 22 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 19 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, cropped" + ] + }, + { + "id": 19, + "type": "EmptyLatentImage", + "pos": [ + 300.6414039697264, + 760.558002216797 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": true + }, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 20 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 17, + "type": "KSampler", + "pos": [ + 783.6414039697265, + 560.558002216797 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": true + }, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 17 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 18 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 19 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 20 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 23 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019225, + "fixed", + 20, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 10, + "type": "PreviewImage", + "pos": [ + 1196.9891426123045, + -134.65223083984375 + ], + "size": [ + 371.5328049316395, + 401.0691884765621 + ], + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 10 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 22, + "type": "VAEDecode", + "pos": [ + 986.6414039697265, + 511.55800221679704 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": { + "collapsed": true + }, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 23 + }, + { + "name": "vae", + "type": "VAE", + "link": 24 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 36, + 79, + 80, + 83 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 54, + "type": "Create Rect Mask", + "pos": [ + 1674.3756046199999, + 394.3444587464061 + ], + "size": { + "0": 315, + "1": 226 + }, + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "copy_image_size", + "type": "IMAGE", + "link": 80 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 76, + 77 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Create Rect Mask" + }, + "widgets_values": [ + "percent", + "bottomleft", + 55, + 13, + 33, + 43, + 512, + 512 + ] + }, + { + "id": 27, + "type": "Paste By Mask", + "pos": [ + 2420.7583392426595, + 446.73262239507955 + ], + "size": { + "0": 342.5999755859375, + "1": 118 + }, + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "image_base", + "type": "IMAGE", + "link": 36 + }, + { + "name": "image_to_paste", + "type": "IMAGE", + "link": 33 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 77 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 54, + 84 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Paste By Mask" + }, + "widgets_values": [ + "keep_ratio_fit" + ] + }, + { + "id": 53, + "type": "Create Rect Mask", + "pos": [ + 1656.8459437625, + 716.897508603906 + ], + "size": { + "0": 315, + "1": 226 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "copy_image_size", + "type": "IMAGE", + "link": 79 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 73, + 75 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Create Rect Mask" + }, + "widgets_values": [ + "percent", + "bottomleft", + 12, + 13, + 35, + 61, + 512, + 512 + ] + }, + { + "id": 58, + "type": "PreviewImage", + "pos": [ + 2789.5061655468753, + 376.6739150976562 + ], + "size": { + "0": 517.0797729492188, + "1": 517.5382080078125 + }, + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 84 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 28, + "type": "PreviewImage", + "pos": [ + 2797.0649307031244, + 1029 + ], + "size": { + "0": 517.0797729492188, + "1": 517.5382080078125 + }, + "flags": {}, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 55 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 45, + "type": "CheckpointLoaderSimple", + "pos": [ + -76.77548427733902, + 1266.1004119335912 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": true + }, + "order": 6, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 60 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 64, + 65 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 67, + 69 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "v1-5-pruned-emaonly.ckpt" + ] + }, + { + "id": 47, + "type": "CLIPTextEncode", + "pos": [ + 195.22451572266087, + 1123.1004119335912 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 64 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 61 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a cat sitting next to a puppy in a garden" + ] + }, + { + "id": 48, + "type": "CLIPTextEncode", + "pos": [ + 257.22451572266084, + 1363.1004119335912 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 65 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 62 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, cropped" + ] + }, + { + "id": 44, + "type": "KSampler", + "pos": [ + 763.2245157226606, + 1210.1004119335912 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 60 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 61 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 62 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 70 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 66 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019059, + "fixed", + 60, + 8, + "euler", + "normal", + 0.7000000000000002 + ] + }, + { + "id": 49, + "type": "VAEDecode", + "pos": [ + 1148.224515722661, + 1223.1004119335912 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 43, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 66 + }, + { + "name": "vae", + "type": "VAE", + "link": 67 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 71 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 39, + "type": "PreviewImage", + "pos": [ + 1178, + -583 + ], + "size": [ + 376.7598495507807, + 400.38239378906235 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 49 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 30, + "type": "PreviewImage", + "pos": [ + 2013.5191819637496, + 375.70346314093774 + ], + "size": [ + 222.47553651280828, + 257.912007503592 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 76 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 43, + "type": "Paste By Mask", + "pos": [ + 2420.8435702645315, + 1014.4642147589055 + ], + "size": { + "0": 342.5999755859375, + "1": 118 + }, + "flags": {}, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "image_base", + "type": "IMAGE", + "link": 54 + }, + { + "name": "image_to_paste", + "type": "IMAGE", + "link": 56 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 75 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 55, + 85 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Paste By Mask" + }, + "widgets_values": [ + "keep_ratio_fill" + ] + }, + { + "id": 59, + "type": "Reroute", + "pos": [ + -26, + 1398 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 85 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 86 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 50, + "type": "VAEEncode", + "pos": [ + 294, + 1420 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": { + "collapsed": true + }, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 86 + }, + { + "name": "vae", + "type": "VAE", + "link": 69 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 70 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncode" + } + }, + { + "id": 57, + "type": "PreviewImage", + "pos": [ + 1175, + 396 + ], + "size": { + "0": 371.5328063964844, + "1": 401.0691833496094 + }, + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 83 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 41, + "type": "Cut By Mask", + "pos": [ + 2278.9043702905274, + -514.8095261914067 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 52 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 51 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 53, + 56 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 11, + "type": "Mask By Text", + "pos": [ + 1648, + 26 + ], + "size": [ + 210, + 194 + ], + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 11 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 30, + 81 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": null + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "dog", + "", + 0.5, + "no" + ] + }, + { + "id": 16, + "type": "PreviewImage", + "pos": [ + 2011, + 679 + ], + "size": [ + 231.7736984765579, + 263.1595106445293 + ], + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 73 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 51, + "type": "PreviewImage", + "pos": [ + 1665, + 1064 + ], + "size": [ + 528.6822269531208, + 518.2059276367154 + ], + "flags": {}, + "order": 44, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 71 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 10, + 8, + 0, + 10, + 0, + "IMAGE" + ], + [ + 11, + 8, + 0, + 11, + 0, + "IMAGE" + ], + [ + 17, + 18, + 0, + 17, + 0, + "MODEL" + ], + [ + 18, + 20, + 0, + 17, + 1, + "CONDITIONING" + ], + [ + 19, + 21, + 0, + 17, + 2, + "CONDITIONING" + ], + [ + 20, + 19, + 0, + 17, + 3, + "LATENT" + ], + [ + 21, + 18, + 1, + 20, + 0, + "CLIP" + ], + [ + 22, + 18, + 1, + 21, + 0, + "CLIP" + ], + [ + 23, + 17, + 0, + 22, + 0, + "LATENT" + ], + [ + 24, + 18, + 2, + 22, + 1, + "VAE" + ], + [ + 29, + 8, + 0, + 25, + 0, + "IMAGE" + ], + [ + 30, + 11, + 0, + 25, + 1, + "IMAGE" + ], + [ + 33, + 25, + 0, + 27, + 1, + "IMAGE" + ], + [ + 36, + 22, + 0, + 27, + 0, + "IMAGE" + ], + [ + 41, + 34, + 0, + 33, + 0, + "MODEL" + ], + [ + 42, + 36, + 0, + 33, + 1, + "CONDITIONING" + ], + [ + 43, + 37, + 0, + 33, + 2, + "CONDITIONING" + ], + [ + 44, + 35, + 0, + 33, + 3, + "LATENT" + ], + [ + 45, + 34, + 1, + 36, + 0, + "CLIP" + ], + [ + 46, + 34, + 1, + 37, + 0, + "CLIP" + ], + [ + 47, + 33, + 0, + 38, + 0, + "LATENT" + ], + [ + 48, + 34, + 2, + 38, + 1, + "VAE" + ], + [ + 49, + 38, + 0, + 39, + 0, + "IMAGE" + ], + [ + 50, + 38, + 0, + 40, + 0, + "IMAGE" + ], + [ + 51, + 40, + 0, + 41, + 1, + "IMAGE" + ], + [ + 52, + 38, + 0, + 41, + 0, + "IMAGE" + ], + [ + 53, + 41, + 0, + 42, + 0, + "IMAGE" + ], + [ + 54, + 27, + 0, + 43, + 0, + "IMAGE" + ], + [ + 55, + 43, + 0, + 28, + 0, + "IMAGE" + ], + [ + 56, + 41, + 0, + 43, + 1, + "IMAGE" + ], + [ + 60, + 45, + 0, + 44, + 0, + "MODEL" + ], + [ + 61, + 47, + 0, + 44, + 1, + "CONDITIONING" + ], + [ + 62, + 48, + 0, + 44, + 2, + "CONDITIONING" + ], + [ + 64, + 45, + 1, + 47, + 0, + "CLIP" + ], + [ + 65, + 45, + 1, + 48, + 0, + "CLIP" + ], + [ + 66, + 44, + 0, + 49, + 0, + "LATENT" + ], + [ + 67, + 45, + 2, + 49, + 1, + "VAE" + ], + [ + 69, + 45, + 2, + 50, + 1, + "VAE" + ], + [ + 70, + 50, + 0, + 44, + 3, + "LATENT" + ], + [ + 71, + 49, + 0, + 51, + 0, + "IMAGE" + ], + [ + 72, + 40, + 0, + 52, + 0, + "IMAGE" + ], + [ + 73, + 53, + 0, + 16, + 0, + "IMAGE" + ], + [ + 75, + 53, + 0, + 43, + 2, + "IMAGE" + ], + [ + 76, + 54, + 0, + 30, + 0, + "IMAGE" + ], + [ + 77, + 54, + 0, + 27, + 2, + "IMAGE" + ], + [ + 79, + 22, + 0, + 53, + 0, + "IMAGE" + ], + [ + 80, + 22, + 0, + 54, + 0, + "IMAGE" + ], + [ + 81, + 11, + 0, + 55, + 0, + "IMAGE" + ], + [ + 82, + 25, + 0, + 56, + 0, + "IMAGE" + ], + [ + 83, + 22, + 0, + 57, + 0, + "IMAGE" + ], + [ + 84, + 27, + 0, + 58, + 0, + "IMAGE" + ], + [ + 85, + 43, + 0, + 59, + 0, + "*" + ], + [ + 86, + 59, + 0, + 50, + 0, + "IMAGE" + ] + ], + "groups": [ + { + "title": "1. Make a cat", + "bounding": [ + -141, + -612, + 1273, + 433 + ], + "color": "#A88" + }, + { + "title": "4. Make a dog", + "bounding": [ + -142, + -158, + 1277, + 448 + ], + "color": "#b06634" + }, + { + "title": "2. Get the mask for the cat", + "bounding": [ + 1588, + -565, + 301, + 354 + ], + "color": "#A88" + }, + { + "title": "3. Cut out the cat", + "bounding": [ + 2262, + -587, + 413, + 370 + ], + "color": "#A88" + }, + { + "title": "5. Get the mask for the dog", + "bounding": [ + 1593, + -136, + 314, + 370 + ], + "color": "#b06634" + }, + { + "title": "6. Cut out the dog", + "bounding": [ + 2274, + -135, + 411, + 374 + ], + "color": "#b06634" + }, + { + "title": "7. Create the background", + "bounding": [ + -149, + 309, + 1728, + 550 + ], + "color": "#8A8" + }, + { + "title": "8. Set up the composition", + "bounding": [ + 1620, + 300, + 663, + 658 + ], + "color": "#b58b2a" + }, + { + "title": "9. Paste the dog", + "bounding": [ + 2355, + 295, + 982, + 626 + ], + "color": "#3f789e" + }, + { + "title": "10. Paste the cat", + "bounding": [ + 2361, + 938, + 980, + 655 + ], + "color": "#3f789e" + }, + { + "title": "11. Img2Img the pasted result to fix shadows/coloring", + "bounding": [ + -134, + 984, + 2398, + 626 + ], + "color": "#88A" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/filter-by-season.json b/examples/filter-by-season.json new file mode 100644 index 0000000..e257135 --- /dev/null +++ b/examples/filter-by-season.json @@ -0,0 +1,1150 @@ +{ + "last_node_id": 34, + "last_link_id": 51, + "nodes": [ + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + 39, + 123 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": true + }, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "v1-5-pruned-emaonly.ckpt" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 357, + 94 + ], + "size": { + "0": 210, + "1": 119.83519744873047 + }, + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "4k uhd landscape photo, beautiful, breathtaking, panorama" + ] + }, + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 346, + 262 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark" + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 368, + 321 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": true + }, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 640, + 512, + 4 + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 676, + 120 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": true + }, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 156680208701053, + "fixed", + 36, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 835, + 121 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 10, + 43 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 30, + "type": "PreviewImage", + "pos": [ + 1530, + 577 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 42 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 29, + "type": "PreviewImage", + "pos": [ + 864, + 830 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 41 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 28, + "type": "PreviewImage", + "pos": [ + 865, + 517 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 40 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 10, + "type": "PreviewImage", + "pos": [ + 1180, + 90 + ], + "size": { + "0": 362.9639892578125, + "1": 319.97320556640625 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 10 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 27, + "type": "Reroute", + "pos": [ + 63, + 679 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 43 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 38, + 39, + 44 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 19, + "type": "Combine Masks", + "pos": [ + 1150, + 690 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 25 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 27 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 42, + 45 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "greater", + "yes", + "yes" + ] + }, + { + "id": 25, + "type": "Unary Mask Op", + "pos": [ + 234, + 1468 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": { + "collapsed": false + }, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 48 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 33 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Unary Mask Op" + }, + "widgets_values": [ + "invert" + ] + }, + { + "id": 23, + "type": "Prune By Mask", + "pos": [ + 269, + 1224 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 46 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 47 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 50 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Prune By Mask" + } + }, + { + "id": 24, + "type": "Prune By Mask", + "pos": [ + 618, + 1456 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 49 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 33 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 51 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Prune By Mask" + } + }, + { + "id": 34, + "type": "SaveImage", + "pos": [ + 1354, + 1173 + ], + "size": { + "0": 365.71478271484375, + "1": 373.92706298828125 + }, + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 51 + } + ], + "properties": {}, + "widgets_values": [ + "FallImages/" + ] + }, + { + "id": 33, + "type": "SaveImage", + "pos": [ + 911, + 1175 + ], + "size": { + "0": 403.44207763671875, + "1": 368.29071044921875 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 50 + } + ], + "properties": {}, + "widgets_values": [ + "SummerImages/" + ] + }, + { + "id": 31, + "type": "Reroute", + "pos": [ + 82, + 1215 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 44 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 46, + 49 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 32, + "type": "Reroute", + "pos": [ + 88, + 1301 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 45 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 47, + 48 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 14, + "type": "Mask By Text", + "pos": [ + 237, + 846 + ], + "size": { + "0": 210, + "1": 194.00003051757812 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 39 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": null + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 26 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "fall", + "", + 0.5, + "no" + ] + }, + { + "id": 22, + "type": "Unary Mask Op", + "pos": [ + 474, + 896 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": { + "collapsed": false + }, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 26 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 27, + 41 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Unary Mask Op" + }, + "widgets_values": [ + "average" + ] + }, + { + "id": 13, + "type": "Mask By Text", + "pos": [ + 242, + 591 + ], + "size": { + "0": 210, + "1": 194 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 38 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": null + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 24 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "summer", + "", + 0.5, + "no" + ] + }, + { + "id": 21, + "type": "Unary Mask Op", + "pos": [ + 496, + 597 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 24 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 25, + 40 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Unary Mask Op" + }, + "widgets_values": [ + "average" + ] + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 10, + 8, + 0, + 10, + 0, + "IMAGE" + ], + [ + 24, + 13, + 1, + 21, + 0, + "IMAGE" + ], + [ + 25, + 21, + 0, + 19, + 0, + "IMAGE" + ], + [ + 26, + 14, + 1, + 22, + 0, + "IMAGE" + ], + [ + 27, + 22, + 0, + 19, + 1, + "IMAGE" + ], + [ + 33, + 25, + 0, + 24, + 1, + "IMAGE" + ], + [ + 38, + 27, + 0, + 13, + 0, + "IMAGE" + ], + [ + 39, + 27, + 0, + 14, + 0, + "IMAGE" + ], + [ + 40, + 21, + 0, + 28, + 0, + "IMAGE" + ], + [ + 41, + 22, + 0, + 29, + 0, + "IMAGE" + ], + [ + 42, + 19, + 0, + 30, + 0, + "IMAGE" + ], + [ + 43, + 8, + 0, + 27, + 0, + "*" + ], + [ + 44, + 27, + 0, + 31, + 0, + "*" + ], + [ + 45, + 19, + 0, + 32, + 0, + "*" + ], + [ + 46, + 31, + 0, + 23, + 0, + "IMAGE" + ], + [ + 47, + 32, + 0, + 23, + 1, + "IMAGE" + ], + [ + 48, + 32, + 0, + 25, + 0, + "IMAGE" + ], + [ + 49, + 31, + 0, + 24, + 0, + "IMAGE" + ], + [ + 50, + 23, + 0, + 33, + 0, + "IMAGE" + ], + [ + 51, + 24, + 0, + 34, + 0, + "IMAGE" + ] + ], + "groups": [ + { + "title": "Generate images for testing", + "bounding": [ + 6, + 10, + 1747, + 422 + ], + "color": "#a1309b" + }, + { + "title": "Get the average of the raw ClipSeg results", + "bounding": [ + 7, + 440, + 1115, + 658 + ], + "color": "#A88" + }, + { + "title": "Compare the averages", + "bounding": [ + 1131, + 443, + 620, + 654 + ], + "color": "#8A8" + }, + { + "title": "Filter images by season", + "bounding": [ + 4, + 1108, + 1748, + 480 + ], + "color": "#3f789e" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/inpaint-faces.json b/examples/inpaint-faces.json new file mode 100644 index 0000000..cab1bf7 --- /dev/null +++ b/examples/inpaint-faces.json @@ -0,0 +1,2265 @@ +{ + "last_node_id": 62, + "last_link_id": 110, + "nodes": [ + { + "id": 11, + "type": "Mask By Text", + "pos": [ + 1602.6495599269872, + 134.00794678115872 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 34 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 14 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "face", + "", + 0.2999999999999999, + "no" + ] + }, + { + "id": 14, + "type": "Mask Morphology", + "pos": [ + 2077.6495599269874, + 119.00794678115875 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 14 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 16 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 10, + "open" + ] + }, + { + "id": 17, + "type": "PreviewImage", + "pos": [ + 639, + 490 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 19 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#332922", + "bgcolor": "#593930" + }, + { + "id": 28, + "type": "Reroute", + "pos": [ + 1137.5800390625, + 447 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 42 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 43 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 26, + "type": "Reroute", + "pos": [ + 1117.5800390625, + 497 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 39 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 41 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#332922", + "bgcolor": "#593930" + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + 20, + 100 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": true + }, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "v1-5-pruned-emaonly.ckpt" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 230, + 90 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": { + "collapsed": true + }, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of four soccer players posing for a photo" + ] + }, + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 230, + 130 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark" + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 230, + 170 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": true + }, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 640, + 2 + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 520, + 100 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": true + }, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 156680208700289, + "fixed", + 36, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 30, + "type": "Reroute", + "pos": [ + 1118, + 549 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 47 + } + ], + "outputs": [ + { + "name": "", + "type": "MASK_MAPPING", + "links": [ + 48 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#332922", + "bgcolor": "#593930" + }, + { + "id": 41, + "type": "VAEEncodeForInpaint", + "pos": [ + 657.6900002670287, + 1118.8018789062505 + ], + "size": { + "0": 226.8000030517578, + "1": 66 + }, + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 70 + }, + { + "name": "vae", + "type": "VAE", + "link": 66 + }, + { + "name": "mask", + "type": "MASK", + "link": 65 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 67 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncodeForInpaint" + } + }, + { + "id": 18, + "type": "Cut By Mask", + "pos": [ + 1677, + 530 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 43 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 25 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": 48 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 23, + 61 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 512, + 512 + ] + }, + { + "id": 23, + "type": "Cut By Mask", + "pos": [ + 1679, + 747 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 29 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 30 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 52, + 62 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 512, + 512 + ] + }, + { + "id": 39, + "type": "Reroute", + "pos": [ + 85.69000026702881, + 1105.8018789062505 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 61, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 69 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 43, + "type": "Change Channel Count", + "pos": [ + 223.6900002670288, + 1099.8018789062505 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 69 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 70 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Change Channel Count" + }, + "widgets_values": [ + "RGB" + ] + }, + { + "id": 32, + "type": "KSampler", + "pos": [ + 984.6900002670287, + 1120.8018789062505 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": false + }, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 53 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 54 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 55 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 67 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 59 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 156680208699480, + "fixed", + 80, + 8, + "euler", + "normal", + 0.9 + ] + }, + { + "id": 36, + "type": "CLIPTextEncode", + "pos": [ + 669.6900002670287, + 1348.8018789062505 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 58 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 55 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "mask, scary, deformed, distorted" + ] + }, + { + "id": 37, + "type": "VAEDecode", + "pos": [ + 1396.690000267029, + 1157.8018789062505 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 59 + }, + { + "name": "vae", + "type": "VAE", + "link": 60 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 68, + 71 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 40, + "type": "Reroute", + "pos": [ + 79, + 1168 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 62, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 64, + 93 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 24, + "type": "Reroute", + "pos": [ + 1479, + 160 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 33 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 34 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 49, + "type": "Reroute", + "pos": [ + 2083.3911387109383, + 1073.526967734375 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 78 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 82 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 20, + "type": "Mask To Region", + "pos": [ + 1226, + 648 + ], + "size": { + "0": 315, + "1": 202 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "IMAGE", + "link": 41 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 25, + 30, + 84 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask To Region" + }, + "widgets_values": [ + 64, + "keep_ratio", + 2, + 2, + 0, + 0, + "match_ratio" + ] + }, + { + "id": 16, + "type": "Separate Mask Components", + "pos": [ + 308.38000053405756, + 534.54001953125 + ], + "size": { + "0": 216.59999084472656, + "1": 46 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "IMAGE", + "link": 38 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 19, + 29, + 39 + ], + "slot_index": 0 + }, + { + "name": "MASK_MAPPING", + "type": "MASK_MAPPING", + "links": [ + 47, + 86 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Separate Mask Components" + } + }, + { + "id": 53, + "type": "Reroute", + "pos": [ + 2050.3911387109383, + 1390.526967734375 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 86 + } + ], + "outputs": [ + { + "name": "", + "type": "MASK_MAPPING", + "links": [ + 87 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#332922", + "bgcolor": "#593930" + }, + { + "id": 52, + "type": "Reroute", + "pos": [ + 2073.3911387109383, + 1308.526967734375 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 84 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 85 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 19, + "type": "PreviewImage", + "pos": [ + 2283, + 470 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 23 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 22, + "type": "PreviewImage", + "pos": [ + 2299, + 773 + ], + "size": { + "0": 188.9236297607422, + "1": 199.47840881347656 + }, + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 52 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 42, + "type": "PreviewImage", + "pos": [ + 1733, + 1144 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 68 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 680, + 80 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 33, + 36, + 42, + 78 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 44, + "type": "Reroute", + "pos": [ + 2084.3911387109383, + 1138.526967734375 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 71 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 108 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 45, + "type": "Reroute", + "pos": [ + 2080.3911387109383, + 1225.526967734375 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 93, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 109 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 54, + "type": "Combine Masks", + "pos": [ + 2213.391138710938, + 1151.526967734375 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 108 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 109 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 97, + 100 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "multiply_alpha", + "yes", + "no" + ] + }, + { + "id": 51, + "type": "Paste By Mask", + "pos": [ + 2618.3911387109374, + 1099.526967734375 + ], + "size": { + "0": 342.5999755859375, + "1": 118 + }, + "flags": {}, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "image_base", + "type": "IMAGE", + "link": 82 + }, + { + "name": "image_to_paste", + "type": "IMAGE", + "link": 97 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 85 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": 87 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 103 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Paste By Mask" + }, + "widgets_values": [ + "resize" + ] + }, + { + "id": 58, + "type": "PreviewImage", + "pos": [ + 2673.3911387109374, + 1282.526967734375 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 100 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 15, + "type": "Mask Morphology", + "pos": [ + 2084.6495599269874, + 248.0079467811585 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 16 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 17, + 110 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 8, + "dilate" + ] + }, + { + "id": 25, + "type": "Reroute", + "pos": [ + 91, + 482 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 110 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 38 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 38, + "type": "Image To Mask", + "pos": [ + 222, + 1193 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 64 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 65 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Image To Mask" + }, + "widgets_values": [ + "intensity" + ] + }, + { + "id": 33, + "type": "CheckpointLoaderSimple", + "pos": [ + 232, + 1286 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": false + }, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 53 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 57, + 58 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 60, + 66 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "sd-v1-5-inpainting.ckpt" + ] + }, + { + "id": 35, + "type": "CLIPTextEncode", + "pos": [ + 663, + 1267 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": { + "collapsed": true + }, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 57 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 54 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a smiling soccer player" + ] + }, + { + "id": 10, + "type": "PreviewImage", + "pos": [ + 2738, + -40 + ], + "size": [ + 754.3332751464841, + 491.52761657714836 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 36 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 56, + "type": "PreviewImage", + "pos": [ + 2719, + 499 + ], + "size": [ + 777.8332751464841, + 492.8176165771483 + ], + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 103 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 12, + "type": "PreviewImage", + "pos": [ + 2487, + 75 + ], + "size": [ + 161.91327514648447, + 285.7476165771484 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 17 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#232", + "bgcolor": "#353" + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 14, + 11, + 0, + 14, + 0, + "IMAGE" + ], + [ + 16, + 14, + 0, + 15, + 0, + "IMAGE" + ], + [ + 17, + 15, + 0, + 12, + 0, + "IMAGE" + ], + [ + 19, + 16, + 0, + 17, + 0, + "IMAGE" + ], + [ + 23, + 18, + 0, + 19, + 0, + "IMAGE" + ], + [ + 25, + 20, + 0, + 18, + 1, + "IMAGE" + ], + [ + 29, + 16, + 0, + 23, + 0, + "IMAGE" + ], + [ + 30, + 20, + 0, + 23, + 1, + "IMAGE" + ], + [ + 33, + 8, + 0, + 24, + 0, + "*" + ], + [ + 34, + 24, + 0, + 11, + 0, + "IMAGE" + ], + [ + 36, + 8, + 0, + 10, + 0, + "IMAGE" + ], + [ + 38, + 25, + 0, + 16, + 0, + "IMAGE" + ], + [ + 39, + 16, + 0, + 26, + 0, + "*" + ], + [ + 41, + 26, + 0, + 20, + 0, + "IMAGE" + ], + [ + 42, + 8, + 0, + 28, + 0, + "*" + ], + [ + 43, + 28, + 0, + 18, + 0, + "IMAGE" + ], + [ + 47, + 16, + 1, + 30, + 0, + "*" + ], + [ + 48, + 30, + 0, + 18, + 2, + "MASK_MAPPING" + ], + [ + 52, + 23, + 0, + 22, + 0, + "IMAGE" + ], + [ + 53, + 33, + 0, + 32, + 0, + "MODEL" + ], + [ + 54, + 35, + 0, + 32, + 1, + "CONDITIONING" + ], + [ + 55, + 36, + 0, + 32, + 2, + "CONDITIONING" + ], + [ + 57, + 33, + 1, + 35, + 0, + "CLIP" + ], + [ + 58, + 33, + 1, + 36, + 0, + "CLIP" + ], + [ + 59, + 32, + 0, + 37, + 0, + "LATENT" + ], + [ + 60, + 33, + 2, + 37, + 1, + "VAE" + ], + [ + 61, + 18, + 0, + 39, + 0, + "*" + ], + [ + 62, + 23, + 0, + 40, + 0, + "*" + ], + [ + 64, + 40, + 0, + 38, + 0, + "IMAGE" + ], + [ + 65, + 38, + 0, + 41, + 2, + "MASK" + ], + [ + 66, + 33, + 2, + 41, + 1, + "VAE" + ], + [ + 67, + 41, + 0, + 32, + 3, + "LATENT" + ], + [ + 68, + 37, + 0, + 42, + 0, + "IMAGE" + ], + [ + 69, + 39, + 0, + 43, + 0, + "IMAGE" + ], + [ + 70, + 43, + 0, + 41, + 0, + "IMAGE" + ], + [ + 71, + 37, + 0, + 44, + 0, + "*" + ], + [ + 78, + 8, + 0, + 49, + 0, + "*" + ], + [ + 82, + 49, + 0, + 51, + 0, + "IMAGE" + ], + [ + 84, + 20, + 0, + 52, + 0, + "*" + ], + [ + 85, + 52, + 0, + 51, + 2, + "IMAGE" + ], + [ + 86, + 16, + 1, + 53, + 0, + "*" + ], + [ + 87, + 53, + 0, + 51, + 3, + "MASK_MAPPING" + ], + [ + 93, + 40, + 0, + 45, + 0, + "*" + ], + [ + 97, + 54, + 0, + 51, + 1, + "IMAGE" + ], + [ + 100, + 54, + 0, + 58, + 0, + "IMAGE" + ], + [ + 103, + 51, + 0, + 56, + 0, + "IMAGE" + ], + [ + 108, + 44, + 0, + 54, + 0, + "IMAGE" + ], + [ + 109, + 45, + 0, + 54, + 1, + "IMAGE" + ], + [ + 110, + 15, + 0, + 25, + 0, + "*" + ] + ], + "groups": [ + { + "title": "Generate images for testing", + "bounding": [ + 2, + -2, + 1415, + 315 + ], + "color": "#a1309b" + }, + { + "title": "Create masks for the faces", + "bounding": [ + 1435, + -3, + 1288, + 377 + ], + "color": "#8A8" + }, + { + "title": "Separate face masks", + "bounding": [ + 12, + 402, + 914, + 389 + ], + "color": "#b06634" + }, + { + "title": "Cut out regions for inpainting", + "bounding": [ + 1079, + 401, + 1439, + 592 + ], + "color": "#88A" + }, + { + "title": "Cut the original image", + "bounding": [ + 1664, + 454, + 400, + 209 + ], + "color": "#3f789e" + }, + { + "title": "Cut the generated masks", + "bounding": [ + 1665, + 672, + 379, + 207 + ], + "color": "#3f789e" + }, + { + "title": "Inpaint faces", + "bounding": [ + 10, + 1017, + 1976, + 530 + ], + "color": "#b58b2a" + }, + { + "title": "Paste the faces back into the original image", + "bounding": [ + 2022, + 1020, + 1434, + 524 + ], + "color": "#3f789e" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/inpaint-with-lora.json b/examples/inpaint-with-lora.json new file mode 100644 index 0000000..53ffe80 --- /dev/null +++ b/examples/inpaint-with-lora.json @@ -0,0 +1,1202 @@ +{ + "last_node_id": 64, + "last_link_id": 133, + "nodes": [ + { + "id": 11, + "type": "Mask By Text", + "pos": [ + 1164.6093572902685, + 146.20794436121014 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 34 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 14 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "building", + "man", + 0.2999999999999999, + "no" + ] + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + 17.16000001311302, + 106.10000019073486 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": true + }, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "v1-5-pruned-emaonly.ckpt" + ] + }, + { + "id": 41, + "type": "VAEEncodeForInpaint", + "pos": [ + 646.7780743255616, + 499.53183862304724 + ], + "size": { + "0": 226.8000030517578, + "1": 66 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 117 + }, + { + "name": "vae", + "type": "VAE", + "link": 66 + }, + { + "name": "mask", + "type": "MASK", + "link": 65 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 67 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncodeForInpaint" + } + }, + { + "id": 24, + "type": "Reroute", + "pos": [ + 1040.9597973632815, + 172.19999758005142 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 33 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 34 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 12, + "type": "PreviewImage", + "pos": [ + 2048.9597973632813, + 87.19999758005144 + ], + "size": { + "0": 161.91326904296875, + "1": 285.74761962890625 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 131 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 710.160000013113, + 102.10000019073486 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 33, + 36, + 117 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 38, + "type": "Image To Mask", + "pos": [ + 190.57998470306393, + 507.21998535156234 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 118 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 65 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Image To Mask" + }, + "widgets_values": [ + "intensity" + ] + }, + { + "id": 25, + "type": "Reroute", + "pos": [ + 57.579984703063886, + 502.21998535156234 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 132 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 118 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 33, + "type": "CheckpointLoaderSimple", + "pos": [ + 69.60000019073489, + 681.7999633789061 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": { + "collapsed": false + }, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 120 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 122 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 60, + 66 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "sd-v1-5-inpainting.ckpt" + ] + }, + { + "id": 37, + "type": "VAEDecode", + "pos": [ + 1687.6000001907353, + 519.7999633789061 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 59 + }, + { + "name": "vae", + "type": "VAE", + "link": 60 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 119 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 63, + "type": "LoraLoader", + "pos": [ + 455.60000019073476, + 695.7999633789061 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 120 + }, + { + "name": "clip", + "type": "CLIP", + "link": 122 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 121 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 123, + 124 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LoraLoader" + }, + "widgets_values": [ + "FantasyArchitecturePhotography.safetensors", + 1, + 1 + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 584, + 223 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": true + }, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 156680208700289, + "fixed", + 36, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 221, + 281 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": true + }, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 640, + 2 + ] + }, + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 218, + 229 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 214, + 80 + ], + "size": { + "0": 371.7103576660156, + "1": 85.56720733642578 + }, + "flags": { + "collapsed": false + }, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a man standing in a futuristic city, beautiful complex fantasy building in the background" + ] + }, + { + "id": 36, + "type": "CLIPTextEncode", + "pos": [ + 973.6000001907346, + 712.7999633789061 + ], + "size": { + "0": 215.51036071777344, + "1": 76.0000228881836 + }, + "flags": { + "collapsed": false + }, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 123 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 55 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "emptiness, clouds" + ] + }, + { + "id": 35, + "type": "CLIPTextEncode", + "pos": [ + 882.6000001907346, + 590.7999633789061 + ], + "size": { + "0": 319.9103698730469, + "1": 88.46720886230469 + }, + "flags": { + "collapsed": false + }, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 124 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 54 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "fantasy architecture photography, futuristic buildings, complex, beautiful" + ] + }, + { + "id": 10, + "type": "PreviewImage", + "pos": [ + 2319, + 19 + ], + "size": { + "0": 754.333251953125, + "1": 491.5276184082031 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 36 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 56, + "type": "PreviewImage", + "pos": [ + 2323, + 559 + ], + "size": { + "0": 777.833251953125, + "1": 492.817626953125 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 119 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 32, + "type": "KSampler", + "pos": [ + 1309.6000001907353, + 511.79996337890617 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": { + "collapsed": false + }, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 121 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 54 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 55 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 67 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 59 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 156680208699480, + "fixed", + 80, + 8, + "euler", + "normal", + 1 + ] + }, + { + "id": 64, + "type": "Mask Morphology", + "pos": [ + 1639, + 252 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 133 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 131, + 132 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 2, + "erode" + ] + }, + { + "id": 14, + "type": "Mask Morphology", + "pos": [ + 1629, + 111 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 14 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 133 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 10, + "open" + ] + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 14, + 11, + 0, + 14, + 0, + "IMAGE" + ], + [ + 33, + 8, + 0, + 24, + 0, + "*" + ], + [ + 34, + 24, + 0, + 11, + 0, + "IMAGE" + ], + [ + 36, + 8, + 0, + 10, + 0, + "IMAGE" + ], + [ + 54, + 35, + 0, + 32, + 1, + "CONDITIONING" + ], + [ + 55, + 36, + 0, + 32, + 2, + "CONDITIONING" + ], + [ + 59, + 32, + 0, + 37, + 0, + "LATENT" + ], + [ + 60, + 33, + 2, + 37, + 1, + "VAE" + ], + [ + 65, + 38, + 0, + 41, + 2, + "MASK" + ], + [ + 66, + 33, + 2, + 41, + 1, + "VAE" + ], + [ + 67, + 41, + 0, + 32, + 3, + "LATENT" + ], + [ + 117, + 8, + 0, + 41, + 0, + "IMAGE" + ], + [ + 118, + 25, + 0, + 38, + 0, + "IMAGE" + ], + [ + 119, + 37, + 0, + 56, + 0, + "IMAGE" + ], + [ + 120, + 33, + 0, + 63, + 0, + "MODEL" + ], + [ + 121, + 63, + 0, + 32, + 0, + "MODEL" + ], + [ + 122, + 33, + 1, + 63, + 1, + "CLIP" + ], + [ + 123, + 63, + 1, + 36, + 0, + "CLIP" + ], + [ + 124, + 63, + 1, + 35, + 0, + "CLIP" + ], + [ + 131, + 64, + 0, + 12, + 0, + "IMAGE" + ], + [ + 132, + 64, + 0, + 25, + 0, + "*" + ], + [ + 133, + 14, + 0, + 64, + 0, + "IMAGE" + ] + ], + "groups": [ + { + "title": "Generate images for testing", + "bounding": [ + -1, + 4, + 988, + 383 + ], + "color": "#a1309b" + }, + { + "title": "Create a mask for the building", + "bounding": [ + 997, + 9, + 1288, + 377 + ], + "color": "#8A8" + }, + { + "title": "Inpaint buildings with the LoRA", + "bounding": [ + 0, + 398, + 1976, + 530 + ], + "color": "#b58b2a" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/tests/general_tests.json b/tests/general_tests.json new file mode 100644 index 0000000..3ba1b2f --- /dev/null +++ b/tests/general_tests.json @@ -0,0 +1,5443 @@ +{ + "last_node_id": 126, + "last_link_id": 220, + "nodes": [ + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 636.7320016059878, + 233.48600479888924 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": { + "collapsed": true + }, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "bad hands" + ] + }, + { + "id": 11, + "type": "PreviewImage", + "pos": [ + 2107, + 163 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 10 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 21, + "type": "Mask Morphology", + "pos": [ + 238.04907879607012, + 1705.1816389125004 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 53, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 21 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 25 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 10, + "dilate" + ] + }, + { + "id": 26, + "type": "PreviewImage", + "pos": [ + 2117.1795805500005, + 1676.9741219171876 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 72, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 25 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 27, + "type": "PreviewImage", + "pos": [ + 2427.359161100001, + 1682.8714474156247 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 73, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 26 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 28, + "type": "PreviewImage", + "pos": [ + 2713.2305960750004, + 1676.2816571406252 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 74, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 27 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 29, + "type": "PreviewImage", + "pos": [ + 3001.2305960750004, + 1676.0765522781253 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 75, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 28 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 23, + "type": "Mask Morphology", + "pos": [ + 595.4941815859863, + 1709.3794458656253 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 54, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 22 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 26 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 10, + "erode" + ] + }, + { + "id": 24, + "type": "Mask Morphology", + "pos": [ + 972.4941815859863, + 1712.3794458656253 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 55, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 23 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 27 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 10, + "open" + ] + }, + { + "id": 25, + "type": "Mask Morphology", + "pos": [ + 1423.494181585986, + 1705.3794458656253 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 56, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 24 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 28 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 10, + "close" + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1374, + 166 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 10, + 50 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 41, + "type": "PreviewImage", + "pos": [ + 2111.203200149717, + 2584.5260897985804 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 90, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 200 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 47, + "type": "PreviewImage", + "pos": [ + 2430.6291180704548, + 2602.843774249716 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 87, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 54 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 42, + "type": "Blur", + "pos": [ + 658.086293965431, + 2593.9582585511366 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 80, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 49 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 54 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Blur" + }, + "widgets_values": [ + 5, + 1 + ] + }, + { + "id": 48, + "type": "PreviewImage", + "pos": [ + 2782.668690006534, + 2586.004277047443 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 43, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 55 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 46, + "type": "Blur", + "pos": [ + 1064.0862939654307, + 2695.9582585511366 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 53 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 55 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Blur" + }, + "widgets_values": [ + 5, + 1 + ] + }, + { + "id": 49, + "type": "Mix Color By Mask", + "pos": [ + 207.1795335413575, + 2968.1535472968753 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 81, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 58 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 59 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 60, + 63 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mix Color By Mask" + }, + "widgets_values": [ + 0, + 0, + 0 + ] + }, + { + "id": 51, + "type": "Mix Images By Mask", + "pos": [ + 778.1795335413573, + 2988.1535472968753 + ], + "size": { + "0": 210, + "1": 66 + }, + "flags": {}, + "order": 89, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 62 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 63 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 67 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 65 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mix Images By Mask" + } + }, + { + "id": 50, + "type": "PreviewImage", + "pos": [ + 2118.6994885883537, + 2954.5807190207397 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 88, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 60 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 52, + "type": "PreviewImage", + "pos": [ + 2478.943921246307, + 2958.8645125741473 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 94, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 65 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 45, + "type": "Reroute", + "pos": [ + -126, + 1959 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 56 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 53, + 58, + 62 + ], + "slot_index": 0 + } + ], + "title": "Source Image", + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 44, + "type": "Reroute", + "pos": [ + -823, + 750 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 50 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 51, + 56, + 70 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 934.7320016059878, + 150.48600479888924 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 8566257, + "fixed", + 15, + 8, + "dpmpp_2m", + "normal", + 1 + ] + }, + { + "id": 63, + "type": "PreviewImage", + "pos": [ + 2782.4101766249996, + 3371.3071152531243 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 76, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 78 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 61, + "type": "Reroute", + "pos": [ + 16.898775228125082, + 3328.9122691085945 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 76 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 77 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 65, + "type": "Cut By Mask", + "pos": [ + 1320.6410525230467, + 3509.8203656906253 + ], + "size": { + "0": 228.39999389648438, + "1": 122 + }, + "flags": {}, + "order": 77, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 79 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 83 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 81 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 64, + "type": "PreviewImage", + "pos": [ + 3098.691821325, + 3375.2043186812502 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 86, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 81 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 56, + "type": "Cut By Mask", + "pos": [ + 593.6410525230472, + 3359.8203656906253 + ], + "size": { + "0": 228.39999389648438, + "1": 122 + }, + "flags": {}, + "order": 84, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 71 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 72 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 73 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 53, + "type": "Reroute", + "pos": [ + 47.17953354135741, + 3065.1535472968753 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 50, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 66 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 67, + 68, + 89 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 58, + "type": "PreviewImage", + "pos": [ + 2452.3329043656245, + 3345.3331278468754 + ], + "size": { + "0": 221.7496337890625, + "1": 263.6103820800781 + }, + "flags": {}, + "order": 91, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 73 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 70, + "type": "Reroute", + "pos": [ + 34.00981720356446, + 3929.440204521876 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 69, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 89 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 92, + 126 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 55, + "type": "PreviewImage", + "pos": [ + 2101.3846854124995, + 3363.3073593937497 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 83, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 69 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 75, + "type": "Mix Color By Mask", + "pos": [ + 1486.0098172035648, + 4143.440204521875 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": { + "collapsed": true + }, + "order": 97, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 131 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 130 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 135 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mix Color By Mask" + }, + "widgets_values": [ + 0, + 242, + 0 + ] + }, + { + "id": 80, + "type": "CheckpointLoaderSimple", + "pos": [ + 49.00981720356446, + 4435.440204521874 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 143 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 136, + 137 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 141, + 147 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "sd-v1-5-inpainting.ckpt" + ] + }, + { + "id": 57, + "type": "Reroute", + "pos": [ + -112, + 2698 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 70 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 71, + 79, + 97, + 156 + ], + "slot_index": 0 + } + ], + "title": "Source Image", + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 69, + "type": "Cut By Mask", + "pos": [ + 586.2307855775875, + 4118.998481396874 + ], + "size": { + "0": 228.39999389648438, + "1": 122 + }, + "flags": { + "collapsed": false + }, + "order": 92, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 97 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 98 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 131, + 133, + 150 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 512, + 512 + ] + }, + { + "id": 67, + "type": "Cut By Mask", + "pos": [ + 548.2307855775874, + 3895.9984813968763 + ], + "size": { + "0": 228.39999389648438, + "1": 122 + }, + "flags": {}, + "order": 93, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 126 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 127 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 130, + 153 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 512, + 512 + ] + }, + { + "id": 89, + "type": "Mask Morphology", + "pos": [ + 847.2307855775875, + 3908.9984813968763 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 98, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 153 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 154, + 155 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 12, + "dilate" + ] + }, + { + "id": 76, + "type": "PreviewImage", + "pos": [ + 2173.9792056531246, + 3943.523177990625 + ], + "size": { + "0": 247.3739776611328, + "1": 318.11297607421875 + }, + "flags": {}, + "order": 95, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 133 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 77, + "type": "PreviewImage", + "pos": [ + 2520.1332618906245, + 3926.7418396281237 + ], + "size": { + "0": 247.3739776611328, + "1": 318.11297607421875 + }, + "flags": {}, + "order": 101, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 155 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 78, + "type": "PreviewImage", + "pos": [ + 2888.589235793749, + 3903.0764860781264 + ], + "size": { + "0": 247.3739776611328, + "1": 318.11297607421875 + }, + "flags": {}, + "order": 99, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 135 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 87, + "type": "PreviewImage", + "pos": [ + 2200.584505828126, + 4445.32189273125 + ], + "size": { + "0": 209.9818572998047, + "1": 320.5836486816406 + }, + "flags": {}, + "order": 105, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 148 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 88, + "type": "Change Channel Count", + "pos": [ + 863.2307855775875, + 4190.998481396874 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": { + "collapsed": true + }, + "order": 96, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 150 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 151 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Change Channel Count" + }, + "widgets_values": [ + "RGB" + ] + }, + { + "id": 83, + "type": "VAEEncodeForInpaint", + "pos": [ + 1084.2307855775884, + 4263.998481396874 + ], + "size": { + "0": 226.8000030517578, + "1": 66 + }, + "flags": {}, + "order": 102, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 151 + }, + { + "name": "vae", + "type": "VAE", + "link": 141 + }, + { + "name": "mask", + "type": "MASK", + "link": 140 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 142 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncodeForInpaint" + } + }, + { + "id": 84, + "type": "Image To Mask", + "pos": [ + 859.2307855775875, + 4265.998481396874 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": { + "collapsed": true + }, + "order": 100, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 154 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 140 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Image To Mask" + }, + "widgets_values": [ + "intensity" + ] + }, + { + "id": 85, + "type": "KSampler", + "pos": [ + 1369.2307855775884, + 4325.998481396873 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 103, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 143 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 144 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 145 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 142 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 152 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 200, + "fixed", + 36, + 8, + "dpmpp_2m", + "karras", + 0.8 + ] + }, + { + "id": 86, + "type": "VAEDecode", + "pos": [ + 1750.2307855775884, + 4394.998481396873 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 104, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 152 + }, + { + "name": "vae", + "type": "VAE", + "link": 147 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 148, + 157 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 81, + "type": "CLIPTextEncode", + "pos": [ + 965.2307855775875, + 4388.998481396873 + ], + "size": { + "0": 210, + "1": 105.05672454833984 + }, + "flags": { + "collapsed": false + }, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 136 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 144 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "a (photo:1.2) of a woman" + ] + }, + { + "id": 82, + "type": "CLIPTextEncode", + "pos": [ + 979.2307855775875, + 4538.998481396873 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": { + "collapsed": true + }, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 137 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 145 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "deformed, blurry, illustration" + ] + }, + { + "id": 54, + "type": "Mask To Region", + "pos": [ + 191.64105252304688, + 3396.8203656906253 + ], + "size": { + "0": 308.341552734375, + "1": 205.26095581054688 + }, + "flags": {}, + "order": 68, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "IMAGE", + "link": 68 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 69, + 72 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask To Region" + }, + "widgets_values": [ + 32, + "keep_ratio", + 512, + 512, + 0, + 0, + "match_ratio" + ] + }, + { + "id": 62, + "type": "Mask To Region", + "pos": [ + 815.6410525230472, + 3452.8203656906253 + ], + "size": { + "0": 305.8291320800781, + "1": 205.45928955078125 + }, + "flags": {}, + "order": 57, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "IMAGE", + "link": 77 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 78, + 83 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask To Region" + }, + "widgets_values": [ + 8, + "ignore", + 512, + 512, + 0, + 0, + "match_ratio" + ] + }, + { + "id": 66, + "type": "Mask To Region", + "pos": [ + 129.2307855775879, + 4032.9984813968745 + ], + "size": { + "0": 305.6142578125, + "1": 202 + }, + "flags": {}, + "order": 85, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "IMAGE", + "link": 92 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 98, + 127, + 158 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask To Region" + }, + "widgets_values": [ + 64, + "keep_ratio", + 512, + 512, + 0, + 0, + "match_ratio" + ] + }, + { + "id": 16, + "type": "PreviewImage", + "pos": [ + 2111, + 729 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 161 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 17, + "type": "PreviewImage", + "pos": [ + 2394, + 738 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 16 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 94, + "type": "PreviewImage", + "pos": [ + 2394, + 1100 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 166 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 18, + "type": "PreviewImage", + "pos": [ + 2661, + 732 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 17 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 95, + "type": "PreviewImage", + "pos": [ + 2666, + 1098 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 167 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 60, + "type": "PreviewImage", + "pos": [ + 2943, + 734 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 164 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 96, + "type": "PreviewImage", + "pos": [ + 2940, + 1088 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 168 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 20, + "type": "PreviewImage", + "pos": [ + 3206, + 730 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 18 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 97, + "type": "PreviewImage", + "pos": [ + 3222, + 1089 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 169 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 93, + "type": "PreviewImage", + "pos": [ + 2117, + 1097 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 165 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 59, + "type": "Mask By Text", + "pos": [ + 980, + 751 + ], + "size": { + "0": 210, + "1": 194 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 74 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 76, + 164 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 168 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "a white dress", + "", + 0.5, + "no" + ] + }, + { + "id": 22, + "type": "Reroute", + "pos": [ + 101, + 1714 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 171 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 21, + 22, + 23, + 24 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 14, + "type": "Mask By Text", + "pos": [ + 375, + 726 + ], + "size": { + "0": 210, + "1": 203.12893676757812 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 13 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 16, + 30 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 166, + 173 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "a street", + "", + 0.5, + "no" + ] + }, + { + "id": 15, + "type": "Mask By Text", + "pos": [ + 655, + 735 + ], + "size": { + "0": 210, + "1": 194 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 14 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 17, + 40 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 167, + 174 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "face", + "", + 0.5, + "no" + ] + }, + { + "id": 30, + "type": "Combine Masks", + "pos": [ + 270, + 2070 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 44, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 32 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 33 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 36, + 47 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "union (max)", + "yes", + "no" + ] + }, + { + "id": 38, + "type": "Combine Masks", + "pos": [ + 1040, + 2060 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 49, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 42 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 43 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 44 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "difference", + "yes", + "no" + ] + }, + { + "id": 34, + "type": "PreviewImage", + "pos": [ + 2120, + 2050 + ], + "size": { + "0": 217.47195434570312, + "1": 194.07412719726562 + }, + "flags": {}, + "order": 61, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 36 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 36, + "type": "PreviewImage", + "pos": [ + 2440, + 2070 + ], + "size": { + "0": 210.2938995361328, + "1": 167.33441162109375 + }, + "flags": {}, + "order": 66, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 39 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 39, + "type": "PreviewImage", + "pos": [ + 2750, + 2060 + ], + "size": { + "0": 228.95291137695312, + "1": 179.9588623046875 + }, + "flags": {}, + "order": 67, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 44 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 104, + "type": "PreviewImage", + "pos": [ + 2118, + 2282 + ], + "size": { + "0": 217.47195434570312, + "1": 194.07412719726562 + }, + "flags": {}, + "order": 64, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 186 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 105, + "type": "PreviewImage", + "pos": [ + 2458, + 2282 + ], + "size": { + "0": 210.2938995361328, + "1": 167.33441162109375 + }, + "flags": {}, + "order": 70, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 187 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 101, + "type": "Combine Masks", + "pos": [ + 294, + 2291 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 46, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 179 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 181 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 186 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "union (max)", + "yes", + "no" + ] + }, + { + "id": 102, + "type": "Combine Masks", + "pos": [ + 701, + 2285 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 51, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 182 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 183 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 187 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "intersection (min)", + "yes", + "no" + ] + }, + { + "id": 103, + "type": "Combine Masks", + "pos": [ + 1054, + 2287 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 52, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 184 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 185 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 188 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "difference", + "yes", + "no" + ] + }, + { + "id": 35, + "type": "Combine Masks", + "pos": [ + 660, + 2070 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 48, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 37 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 41 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 39 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "intersection (min)", + "yes", + "no" + ] + }, + { + "id": 37, + "type": "Reroute", + "pos": [ + 97, + 2123 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 40 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 41, + 43, + 66 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 100, + "type": "Reroute", + "pos": [ + 78, + 2314 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 174 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 183, + 185 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 109, + "type": "PreviewImage", + "pos": [ + 3052, + 2059 + ], + "size": { + "0": 217.28285217285156, + "1": 167.4579620361328 + }, + "flags": {}, + "order": 63, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 193 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 106, + "type": "PreviewImage", + "pos": [ + 2753, + 2279 + ], + "size": { + "0": 228.95291137695312, + "1": 179.9588623046875 + }, + "flags": {}, + "order": 71, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 188 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 110, + "type": "PreviewImage", + "pos": [ + 3049, + 2269 + ], + "size": { + "0": 216.75193786621094, + "1": 168.81077575683594 + }, + "flags": {}, + "order": 65, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 194 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 31, + "type": "Reroute", + "pos": [ + 90, + 2036 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 29 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 32, + 37, + 42, + 195 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 32, + "type": "Reroute", + "pos": [ + 99, + 2077 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 30 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 33, + 196 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 98, + "type": "Reroute", + "pos": [ + 95, + 2216 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 172 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 179, + 182, + 184, + 197 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 99, + "type": "Reroute", + "pos": [ + 93, + 2264 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 173 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 181, + 198 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 107, + "type": "Combine Masks", + "pos": [ + 1407, + 2065 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 45, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 195 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 196 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 193 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "multiply", + "yes", + "no" + ] + }, + { + "id": 108, + "type": "Combine Masks", + "pos": [ + 1433, + 2290 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 47, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 197 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 198 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 194 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "multiply", + "yes", + "no" + ] + }, + { + "id": 43, + "type": "Reroute", + "pos": [ + 77.08629396543076, + 2595.9582585511366 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 62, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 47 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 49, + 59, + 199 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 111, + "type": "Unary Mask Op", + "pos": [ + 391, + 2731 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 82, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 199 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 200 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Unary Mask Op" + }, + "widgets_values": [ + "invert" + ] + }, + { + "id": 19, + "type": "Mask By Text", + "pos": [ + 1462, + 739 + ], + "size": { + "0": 210, + "1": 211.70193481445312 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 19 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 18, + 171 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 169 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "woman | street", + "purse | trees", + 0.5, + "no" + ] + }, + { + "id": 13, + "type": "Mask By Text", + "pos": [ + 78, + 722 + ], + "size": { + "0": 210, + "1": 203.12893676757812 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 12 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 29, + 161 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 165, + 172 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "a woman", + "", + 0.5, + "no" + ] + }, + { + "id": 112, + "type": "Mask By Text", + "pos": [ + 94, + 997 + ], + "size": { + "0": 210, + "1": 203.12893676757812 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 201 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 202, + 215 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "Rainy", + "", + 0.5, + "no" + ] + }, + { + "id": 113, + "type": "PreviewImage", + "pos": [ + 3479, + 765 + ], + "size": { + "0": 217.2265167236328, + "1": 241.5360565185547 + }, + "flags": {}, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 202 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 115, + "type": "PreviewImage", + "pos": [ + 3761, + 765 + ], + "size": { + "0": 222.04226684570312, + "1": 241.76449584960938 + }, + "flags": {}, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 204 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 123, + "type": "PreviewImage", + "pos": [ + 3479, + 1124 + ], + "size": { + "0": 217.2265167236328, + "1": 241.5360565185547 + }, + "flags": {}, + "order": 59, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 216 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 124, + "type": "PreviewImage", + "pos": [ + 3766, + 1137 + ], + "size": { + "0": 217.2265167236328, + "1": 241.5360565185547 + }, + "flags": {}, + "order": 78, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 217 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 114, + "type": "Mask By Text", + "pos": [ + 328, + 1004 + ], + "size": { + "0": 210, + "1": 203.12893676757812 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 203 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 204, + 214 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "Sunny", + "", + 0.5, + "no" + ] + }, + { + "id": 121, + "type": "Unary Mask Op", + "pos": [ + 1127, + 1090 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": { + "collapsed": false + }, + "order": 58, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 210 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 217 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Unary Mask Op" + }, + "widgets_values": [ + "average" + ] + }, + { + "id": 12, + "type": "Reroute", + "pos": [ + -195, + 765 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 51 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 12, + 13, + 14, + 19, + 74, + 201, + 203, + 218 + ], + "slot_index": 0 + } + ], + "title": "Source Image", + "properties": { + "showOutputText": false, + "horizontal": false + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 119, + "type": "Combine Masks", + "pos": [ + 759, + 1034 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 215 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 214 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 210, + 216, + 219 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "greater", + "yes", + "no" + ] + }, + { + "id": 125, + "type": "Prune By Mask", + "pos": [ + 1486, + 1329 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 60, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 218 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 219 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 220 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Prune By Mask" + } + }, + { + "id": 126, + "type": "PreviewImage", + "pos": [ + 4035, + 1139 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 79, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 220 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 532, + 282 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": false + }, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 640, + 4 + ] + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + 94, + 161 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "deliberate_v11.safetensors" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 639, + 189 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": { + "collapsed": true + }, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo, a woman standing on a busy street corner in a bustling modern city, facing the camera, stylish" + ] + }, + { + "id": 91, + "type": "PreviewImage", + "pos": [ + 2528, + 4440 + ], + "size": { + "0": 699.5516357421875, + "1": 471.59600830078125 + }, + "flags": {}, + "order": 107, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 159 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 90, + "type": "Paste By Mask", + "pos": [ + 1061.2307855775882, + 4797.998481396874 + ], + "size": { + "0": 254.40000915527344, + "1": 118 + }, + "flags": {}, + "order": 106, + "mode": 0, + "inputs": [ + { + "name": "image_base", + "type": "IMAGE", + "link": 156 + }, + { + "name": "image_to_paste", + "type": "IMAGE", + "link": 157 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 158 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 159 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Paste By Mask" + }, + "widgets_values": [ + "resize" + ] + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 10, + 8, + 0, + 11, + 0, + "IMAGE" + ], + [ + 12, + 12, + 0, + 13, + 0, + "IMAGE" + ], + [ + 13, + 12, + 0, + 14, + 0, + "IMAGE" + ], + [ + 14, + 12, + 0, + 15, + 0, + "IMAGE" + ], + [ + 16, + 14, + 0, + 17, + 0, + "IMAGE" + ], + [ + 17, + 15, + 0, + 18, + 0, + "IMAGE" + ], + [ + 18, + 19, + 0, + 20, + 0, + "IMAGE" + ], + [ + 19, + 12, + 0, + 19, + 0, + "IMAGE" + ], + [ + 21, + 22, + 0, + 21, + 0, + "IMAGE" + ], + [ + 22, + 22, + 0, + 23, + 0, + "IMAGE" + ], + [ + 23, + 22, + 0, + 24, + 0, + "IMAGE" + ], + [ + 24, + 22, + 0, + 25, + 0, + "IMAGE" + ], + [ + 25, + 21, + 0, + 26, + 0, + "IMAGE" + ], + [ + 26, + 23, + 0, + 27, + 0, + "IMAGE" + ], + [ + 27, + 24, + 0, + 28, + 0, + "IMAGE" + ], + [ + 28, + 25, + 0, + 29, + 0, + "IMAGE" + ], + [ + 29, + 13, + 0, + 31, + 0, + "*" + ], + [ + 30, + 14, + 0, + 32, + 0, + "*" + ], + [ + 32, + 31, + 0, + 30, + 0, + "IMAGE" + ], + [ + 33, + 32, + 0, + 30, + 1, + "IMAGE" + ], + [ + 36, + 30, + 0, + 34, + 0, + "IMAGE" + ], + [ + 37, + 31, + 0, + 35, + 0, + "IMAGE" + ], + [ + 39, + 35, + 0, + 36, + 0, + "IMAGE" + ], + [ + 40, + 15, + 0, + 37, + 0, + "*" + ], + [ + 41, + 37, + 0, + 35, + 1, + "IMAGE" + ], + [ + 42, + 31, + 0, + 38, + 0, + "IMAGE" + ], + [ + 43, + 37, + 0, + 38, + 1, + "IMAGE" + ], + [ + 44, + 38, + 0, + 39, + 0, + "IMAGE" + ], + [ + 47, + 30, + 0, + 43, + 0, + "*" + ], + [ + 49, + 43, + 0, + 42, + 0, + "IMAGE" + ], + [ + 50, + 8, + 0, + 44, + 0, + "*" + ], + [ + 51, + 44, + 0, + 12, + 0, + "*" + ], + [ + 53, + 45, + 0, + 46, + 0, + "IMAGE" + ], + [ + 54, + 42, + 0, + 47, + 0, + "IMAGE" + ], + [ + 55, + 46, + 0, + 48, + 0, + "IMAGE" + ], + [ + 56, + 44, + 0, + 45, + 0, + "*" + ], + [ + 58, + 45, + 0, + 49, + 0, + "IMAGE" + ], + [ + 59, + 43, + 0, + 49, + 1, + "IMAGE" + ], + [ + 60, + 49, + 0, + 50, + 0, + "IMAGE" + ], + [ + 62, + 45, + 0, + 51, + 0, + "IMAGE" + ], + [ + 63, + 49, + 0, + 51, + 1, + "IMAGE" + ], + [ + 65, + 51, + 0, + 52, + 0, + "IMAGE" + ], + [ + 66, + 37, + 0, + 53, + 0, + "*" + ], + [ + 67, + 53, + 0, + 51, + 2, + "IMAGE" + ], + [ + 68, + 53, + 0, + 54, + 0, + "IMAGE" + ], + [ + 69, + 54, + 0, + 55, + 0, + "IMAGE" + ], + [ + 70, + 44, + 0, + 57, + 0, + "*" + ], + [ + 71, + 57, + 0, + 56, + 0, + "IMAGE" + ], + [ + 72, + 54, + 0, + 56, + 1, + "IMAGE" + ], + [ + 73, + 56, + 0, + 58, + 0, + "IMAGE" + ], + [ + 74, + 12, + 0, + 59, + 0, + "IMAGE" + ], + [ + 76, + 59, + 0, + 61, + 0, + "*" + ], + [ + 77, + 61, + 0, + 62, + 0, + "IMAGE" + ], + [ + 78, + 62, + 0, + 63, + 0, + "IMAGE" + ], + [ + 79, + 57, + 0, + 65, + 0, + "IMAGE" + ], + [ + 81, + 65, + 0, + 64, + 0, + "IMAGE" + ], + [ + 83, + 62, + 0, + 65, + 1, + "IMAGE" + ], + [ + 89, + 53, + 0, + 70, + 0, + "*" + ], + [ + 92, + 70, + 0, + 66, + 0, + "IMAGE" + ], + [ + 97, + 57, + 0, + 69, + 0, + "IMAGE" + ], + [ + 98, + 66, + 0, + 69, + 1, + "IMAGE" + ], + [ + 126, + 70, + 0, + 67, + 0, + "IMAGE" + ], + [ + 127, + 66, + 0, + 67, + 1, + "IMAGE" + ], + [ + 130, + 67, + 0, + 75, + 1, + "IMAGE" + ], + [ + 131, + 69, + 0, + 75, + 0, + "IMAGE" + ], + [ + 133, + 69, + 0, + 76, + 0, + "IMAGE" + ], + [ + 135, + 75, + 0, + 78, + 0, + "IMAGE" + ], + [ + 136, + 80, + 1, + 81, + 0, + "CLIP" + ], + [ + 137, + 80, + 1, + 82, + 0, + "CLIP" + ], + [ + 140, + 84, + 0, + 83, + 2, + "MASK" + ], + [ + 141, + 80, + 2, + 83, + 1, + "VAE" + ], + [ + 142, + 83, + 0, + 85, + 3, + "LATENT" + ], + [ + 143, + 80, + 0, + 85, + 0, + "MODEL" + ], + [ + 144, + 81, + 0, + 85, + 1, + "CONDITIONING" + ], + [ + 145, + 82, + 0, + 85, + 2, + "CONDITIONING" + ], + [ + 147, + 80, + 2, + 86, + 1, + "VAE" + ], + [ + 148, + 86, + 0, + 87, + 0, + "IMAGE" + ], + [ + 150, + 69, + 0, + 88, + 0, + "IMAGE" + ], + [ + 151, + 88, + 0, + 83, + 0, + "IMAGE" + ], + [ + 152, + 85, + 0, + 86, + 0, + "LATENT" + ], + [ + 153, + 67, + 0, + 89, + 0, + "IMAGE" + ], + [ + 154, + 89, + 0, + 84, + 0, + "IMAGE" + ], + [ + 155, + 89, + 0, + 77, + 0, + "IMAGE" + ], + [ + 156, + 57, + 0, + 90, + 0, + "IMAGE" + ], + [ + 157, + 86, + 0, + 90, + 1, + "IMAGE" + ], + [ + 158, + 66, + 0, + 90, + 2, + "IMAGE" + ], + [ + 159, + 90, + 0, + 91, + 0, + "IMAGE" + ], + [ + 161, + 13, + 0, + 16, + 0, + "IMAGE" + ], + [ + 164, + 59, + 0, + 60, + 0, + "IMAGE" + ], + [ + 165, + 13, + 1, + 93, + 0, + "IMAGE" + ], + [ + 166, + 14, + 1, + 94, + 0, + "IMAGE" + ], + [ + 167, + 15, + 1, + 95, + 0, + "IMAGE" + ], + [ + 168, + 59, + 1, + 96, + 0, + "IMAGE" + ], + [ + 169, + 19, + 1, + 97, + 0, + "IMAGE" + ], + [ + 171, + 19, + 0, + 22, + 0, + "*" + ], + [ + 172, + 13, + 1, + 98, + 0, + "*" + ], + [ + 173, + 14, + 1, + 99, + 0, + "*" + ], + [ + 174, + 15, + 1, + 100, + 0, + "*" + ], + [ + 179, + 98, + 0, + 101, + 0, + "IMAGE" + ], + [ + 181, + 99, + 0, + 101, + 1, + "IMAGE" + ], + [ + 182, + 98, + 0, + 102, + 0, + "IMAGE" + ], + [ + 183, + 100, + 0, + 102, + 1, + "IMAGE" + ], + [ + 184, + 98, + 0, + 103, + 0, + "IMAGE" + ], + [ + 185, + 100, + 0, + 103, + 1, + "IMAGE" + ], + [ + 186, + 101, + 0, + 104, + 0, + "IMAGE" + ], + [ + 187, + 102, + 0, + 105, + 0, + "IMAGE" + ], + [ + 188, + 103, + 0, + 106, + 0, + "IMAGE" + ], + [ + 193, + 107, + 0, + 109, + 0, + "IMAGE" + ], + [ + 194, + 108, + 0, + 110, + 0, + "IMAGE" + ], + [ + 195, + 31, + 0, + 107, + 0, + "IMAGE" + ], + [ + 196, + 32, + 0, + 107, + 1, + "IMAGE" + ], + [ + 197, + 98, + 0, + 108, + 0, + "IMAGE" + ], + [ + 198, + 99, + 0, + 108, + 1, + "IMAGE" + ], + [ + 199, + 43, + 0, + 111, + 0, + "IMAGE" + ], + [ + 200, + 111, + 0, + 41, + 0, + "IMAGE" + ], + [ + 201, + 12, + 0, + 112, + 0, + "IMAGE" + ], + [ + 202, + 112, + 1, + 113, + 0, + "IMAGE" + ], + [ + 203, + 12, + 0, + 114, + 0, + "IMAGE" + ], + [ + 204, + 114, + 1, + 115, + 0, + "IMAGE" + ], + [ + 210, + 119, + 0, + 121, + 0, + "IMAGE" + ], + [ + 214, + 114, + 1, + 119, + 1, + "IMAGE" + ], + [ + 215, + 112, + 1, + 119, + 0, + "IMAGE" + ], + [ + 216, + 119, + 0, + 123, + 0, + "IMAGE" + ], + [ + 217, + 121, + 0, + 124, + 0, + "IMAGE" + ], + [ + 218, + 12, + 0, + 125, + 0, + "IMAGE" + ], + [ + 219, + 119, + 0, + 125, + 1, + "IMAGE" + ], + [ + 220, + 125, + 0, + 126, + 0, + "IMAGE" + ] + ], + "groups": [ + { + "title": "Create Images For Testing", + "bounding": [ + 12, + 6, + 1978, + 600 + ], + "color": "#a1309b" + }, + { + "title": "Results", + "bounding": [ + 2048, + -1, + 2450, + 6383 + ], + "color": "#8A8" + }, + { + "title": "Test ClipSeg", + "bounding": [ + 13, + 640, + 1986, + 840 + ], + "color": "#3f789e" + }, + { + "title": "Generated Images", + "bounding": [ + 2074, + 80, + 290, + 383 + ], + "color": "#3f789e" + }, + { + "title": "ClipSeg: Woman", + "bounding": [ + 2096, + 650, + 252, + 789 + ], + "color": "#3f789e" + }, + { + "title": "ClipSeg: Street", + "bounding": [ + 2376, + 655, + 246, + 780 + ], + "color": "#3f789e" + }, + { + "title": "ClipSeg: Face", + "bounding": [ + 2644, + 652, + 243, + 776 + ], + "color": "#3f789e" + }, + { + "title": "(Woman | Street) - (Purse | Trees)", + "bounding": [ + 3186, + 648, + 258, + 782 + ], + "color": "#b06634" + }, + { + "title": "Mask Morphology", + "bounding": [ + -12, + 1575, + 1947, + 376 + ], + "color": "#3f789e" + }, + { + "title": "Dilate", + "bounding": [ + 2092, + 1606, + 257, + 340 + ], + "color": "#b06634" + }, + { + "title": "Erode", + "bounding": [ + 2404, + 1603, + 256, + 347 + ], + "color": "#b06634" + }, + { + "title": "Open", + "bounding": [ + 2700, + 1595, + 251, + 346 + ], + "color": "#b06634" + }, + { + "title": "Close", + "bounding": [ + 2983, + 1600, + 244, + 349 + ], + "color": "#b06634" + }, + { + "title": "Combine Masks", + "bounding": [ + -22, + 1977, + 1975, + 499 + ], + "color": "#3f789e" + }, + { + "title": "Woman u Street", + "bounding": [ + 2095, + 1976, + 269, + 508 + ], + "color": "#3f789e" + }, + { + "title": "Woman n Face", + "bounding": [ + 2422, + 1983, + 253, + 485 + ], + "color": "#3f789e" + }, + { + "title": "Woman - Face", + "bounding": [ + 2724, + 1974, + 283, + 492 + ], + "color": "#3f789e" + }, + { + "title": "Unary Ops", + "bounding": [ + -6, + 2504, + 1956, + 351 + ], + "color": "#3f789e" + }, + { + "title": "Invert Mask", + "bounding": [ + 2081, + 2498, + 276, + 373 + ], + "color": "#3f789e" + }, + { + "title": "Blur Mask", + "bounding": [ + 2399, + 2504, + 284, + 363 + ], + "color": "#3f789e" + }, + { + "title": "Blur Image", + "bounding": [ + 2746, + 2495, + 272, + 375 + ], + "color": "#3f789e" + }, + { + "title": "Mix", + "bounding": [ + -37, + 2875, + 1984, + 308 + ], + "color": "#3f789e" + }, + { + "title": "Mix Color", + "bounding": [ + 2090, + 2879, + 291, + 338 + ], + "color": "#3f789e" + }, + { + "title": "Mix Images", + "bounding": [ + 2441, + 2880, + 286, + 347 + ], + "color": "#3f789e" + }, + { + "title": "Regions", + "bounding": [ + -9, + 3247, + 1998, + 492 + ], + "color": "#3f789e" + }, + { + "title": "Face Region", + "bounding": [ + 2082, + 3281, + 254, + 345 + ], + "color": "#3f789e" + }, + { + "title": "Cut To Face", + "bounding": [ + 2418, + 3267, + 280, + 360 + ], + "color": "#3f789e" + }, + { + "title": "ClipSeg: White Dress", + "bounding": [ + 2919, + 652, + 247, + 776 + ], + "color": "#3f789e" + }, + { + "title": "White Dress Region", + "bounding": [ + 2760, + 3288, + 267, + 350 + ], + "color": "#3f789e" + }, + { + "title": "Cut To White Dress", + "bounding": [ + 3069, + 3292, + 270, + 351 + ], + "color": "#3f789e" + }, + { + "title": "Inpaint Full Resolution", + "bounding": [ + -7, + 3786, + 2005, + 1206 + ], + "color": "#3f789e" + }, + { + "title": "Cut Image", + "bounding": [ + 2156, + 3863, + 286, + 422 + ], + "color": "#3f789e" + }, + { + "title": "Cut Mask", + "bounding": [ + 2502, + 3849, + 283, + 422 + ], + "color": "#3f789e" + }, + { + "title": "Mask Visualization", + "bounding": [ + 2863, + 3823, + 294, + 427 + ], + "color": "#3f789e" + }, + { + "title": "Inpainted Faces", + "bounding": [ + 2178, + 4362, + 263, + 436 + ], + "color": "#3f789e" + }, + { + "title": "Pasted Inpainting", + "bounding": [ + 2544, + 4361, + 732, + 575 + ], + "color": "#3f789e" + }, + { + "title": "Woman * Street", + "bounding": [ + 3024, + 1970, + 272, + 484 + ], + "color": "#3f789e" + }, + { + "title": "Rainy", + "bounding": [ + 3458, + 686, + 259, + 340 + ], + "color": "#3f789e" + }, + { + "title": "Sunny", + "bounding": [ + 3739, + 688, + 272, + 338 + ], + "color": "#3f789e" + }, + { + "title": "Rainy > Sunny", + "bounding": [ + 3461, + 1050, + 259, + 369 + ], + "color": "#3f789e" + }, + { + "title": "Mean(Rainy > Sunny)", + "bounding": [ + 3739, + 1051, + 270, + 364 + ], + "color": "#3f789e" + }, + { + "title": "Prune To Rainy", + "bounding": [ + 4020, + 1049, + 239, + 366 + ], + "color": "#3f789e" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/tests/multisubject_tests.json b/tests/multisubject_tests.json new file mode 100644 index 0000000..ee068c5 --- /dev/null +++ b/tests/multisubject_tests.json @@ -0,0 +1,2318 @@ +{ + "last_node_id": 54, + "last_link_id": 80, + "nodes": [ + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + -110, + 430 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "deliberate_v11.safetensors" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 420, + 190 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a dog sitting in a garden" + ] + }, + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 410, + 390 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, cropped" + ] + }, + { + "id": 18, + "type": "CheckpointLoaderSimple", + "pos": [ + -45, + 981 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 17 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 21, + 22 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 24 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "deliberate_v11.safetensors" + ] + }, + { + "id": 20, + "type": "CLIPTextEncode", + "pos": [ + 431, + 830 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 21 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 18 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a a garden" + ] + }, + { + "id": 21, + "type": "CLIPTextEncode", + "pos": [ + 417, + 1042 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 22 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 19 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, cropped" + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 860, + 190 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019192, + "fixed", + 20, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 470, + 610 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 17, + "type": "KSampler", + "pos": [ + 1006, + 893 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 17 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 18 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 19 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 20 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 23 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019294, + "fixed", + 20, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 19, + "type": "EmptyLatentImage", + "pos": [ + 441, + 1292 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 20 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1210, + 190 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 10, + 11, + 29 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 32, + "type": "Combine Masks", + "pos": [ + 2572, + 1808 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 74 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 78 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 40 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "union (max)", + "yes", + "no" + ] + }, + { + "id": 36, + "type": "CLIPTextEncode", + "pos": [ + 280, + -490 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 45 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 42 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a cat sitting in a garden" + ] + }, + { + "id": 37, + "type": "CLIPTextEncode", + "pos": [ + 480, + -220 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 46 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 43 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, cropped" + ] + }, + { + "id": 34, + "type": "CheckpointLoaderSimple", + "pos": [ + -210, + -230 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 41 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 45, + 46 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 48 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "deliberate_v11.safetensors" + ] + }, + { + "id": 11, + "type": "Mask By Text", + "pos": [ + 1270, + 587 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 11 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 12, + 30 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": null + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "dog", + "", + 0.5, + "no" + ] + }, + { + "id": 35, + "type": "EmptyLatentImage", + "pos": [ + 540, + 0 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 44 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 33, + "type": "KSampler", + "pos": [ + 930, + -420 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 41 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 42 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 43 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 44 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 47 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019204, + "fixed", + 20, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 25, + "type": "Cut By Mask", + "pos": [ + 1529, + 1139 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 29 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 30 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 31, + 33 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 38, + "type": "VAEDecode", + "pos": [ + 1280, + -420 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 47 + }, + { + "name": "vae", + "type": "VAE", + "link": 48 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 49, + 50, + 52 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 41, + "type": "Cut By Mask", + "pos": [ + 1911, + -22 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 52 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 51 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 53, + 56 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 27, + "type": "Paste By Mask", + "pos": [ + 1981, + 2224 + ], + "size": { + "0": 342.5999755859375, + "1": 118 + }, + "flags": {}, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "image_base", + "type": "IMAGE", + "link": 36 + }, + { + "name": "image_to_paste", + "type": "IMAGE", + "link": 33 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 77 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 54 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Paste By Mask" + }, + "widgets_values": [ + "keep_ratio_fit" + ] + }, + { + "id": 47, + "type": "CLIPTextEncode", + "pos": [ + 3671.3897620952075, + 2568.6014762395357 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 64 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 61 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "photo of a cat sitting next to a puppy in a garden" + ] + }, + { + "id": 48, + "type": "CLIPTextEncode", + "pos": [ + 3661.3897620952075, + 2768.6014762395357 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 65 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 62 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark, cropped" + ] + }, + { + "id": 45, + "type": "CheckpointLoaderSimple", + "pos": [ + 3141.3897620952075, + 2808.6014762395357 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 6, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 60 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 64, + 65 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 67, + 69 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "deliberate_v11.safetensors" + ] + }, + { + "id": 46, + "type": "EmptyLatentImage", + "pos": [ + 3735, + 3127 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 7, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 4 + ] + }, + { + "id": 50, + "type": "VAEEncode", + "pos": [ + 3481, + 3018 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 68 + }, + { + "name": "vae", + "type": "VAE", + "link": 69 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 70 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncode" + } + }, + { + "id": 49, + "type": "VAEDecode", + "pos": [ + 4685, + 2547 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 44, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 66 + }, + { + "name": "vae", + "type": "VAE", + "link": 67 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 71 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 14, + "type": "PreviewImage", + "pos": [ + 3781, + -209 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 26 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 39, + "type": "PreviewImage", + "pos": [ + 3527, + -217 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 49 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 10, + "type": "PreviewImage", + "pos": [ + 3307, + -216 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 10 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 12, + "type": "PreviewImage", + "pos": [ + 3305, + 77 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 12 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 40, + "type": "Mask By Text", + "pos": [ + 1436, + -75 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 50 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 51, + 72 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": null + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "cat", + "", + 0.5, + "no" + ] + }, + { + "id": 52, + "type": "PreviewImage", + "pos": [ + 3535, + 77 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 72 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 26, + "type": "PreviewImage", + "pos": [ + 3308, + 364 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 31 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 42, + "type": "PreviewImage", + "pos": [ + 3545, + 367 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 53 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 16, + "type": "PreviewImage", + "pos": [ + 3544, + 673 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 73 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 31, + "type": "PreviewImage", + "pos": [ + 3801, + 677 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 40 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 28, + "type": "PreviewImage", + "pos": [ + 3294, + 965 + ], + "size": { + "0": 517.0797729492188, + "1": 517.5382080078125 + }, + "flags": {}, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 55 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 30, + "type": "PreviewImage", + "pos": [ + 3302, + 664 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 76 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 22, + "type": "VAEDecode", + "pos": [ + 1357, + 940 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 23 + }, + { + "name": "vae", + "type": "VAE", + "link": 24 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 26, + 36, + 79, + 80 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 51, + "type": "PreviewImage", + "pos": [ + 3299, + 1530 + ], + "size": { + "0": 512.1533203125, + "1": 537.00537109375 + }, + "flags": {}, + "order": 45, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 71 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 43, + "type": "Paste By Mask", + "pos": [ + 2468, + 2276 + ], + "size": { + "0": 342.5999755859375, + "1": 118 + }, + "flags": {}, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "image_base", + "type": "IMAGE", + "link": 54 + }, + { + "name": "image_to_paste", + "type": "IMAGE", + "link": 56 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 75 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 55, + 68 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Paste By Mask" + }, + "widgets_values": [ + "keep_ratio_fill" + ] + }, + { + "id": 53, + "type": "Create Rect Mask", + "pos": [ + 1254, + 1520 + ], + "size": { + "0": 315, + "1": 226 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "copy_image_size", + "type": "IMAGE", + "link": 79 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 73, + 74, + 75 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Create Rect Mask" + }, + "widgets_values": [ + "percent", + "bottomleft", + 27, + 13, + 35, + 61, + 512, + 512 + ] + }, + { + "id": 54, + "type": "Create Rect Mask", + "pos": [ + 1237, + 2016 + ], + "size": { + "0": 315, + "1": 226 + }, + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "copy_image_size", + "type": "IMAGE", + "link": 80 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 76, + 77, + 78 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Create Rect Mask" + }, + "widgets_values": [ + "percent", + "bottomleft", + 47, + 13, + 33, + 43, + 512, + 512 + ] + }, + { + "id": 44, + "type": "KSampler", + "pos": [ + 4176, + 2561 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 43, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 60 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 61 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 62 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 70 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 66 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 739721985019059, + "fixed", + 36, + 8, + "dpmpp_2m", + "karras", + 0.55 + ] + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 10, + 8, + 0, + 10, + 0, + "IMAGE" + ], + [ + 11, + 8, + 0, + 11, + 0, + "IMAGE" + ], + [ + 12, + 11, + 0, + 12, + 0, + "IMAGE" + ], + [ + 17, + 18, + 0, + 17, + 0, + "MODEL" + ], + [ + 18, + 20, + 0, + 17, + 1, + "CONDITIONING" + ], + [ + 19, + 21, + 0, + 17, + 2, + "CONDITIONING" + ], + [ + 20, + 19, + 0, + 17, + 3, + "LATENT" + ], + [ + 21, + 18, + 1, + 20, + 0, + "CLIP" + ], + [ + 22, + 18, + 1, + 21, + 0, + "CLIP" + ], + [ + 23, + 17, + 0, + 22, + 0, + "LATENT" + ], + [ + 24, + 18, + 2, + 22, + 1, + "VAE" + ], + [ + 26, + 22, + 0, + 14, + 0, + "IMAGE" + ], + [ + 29, + 8, + 0, + 25, + 0, + "IMAGE" + ], + [ + 30, + 11, + 0, + 25, + 1, + "IMAGE" + ], + [ + 31, + 25, + 0, + 26, + 0, + "IMAGE" + ], + [ + 33, + 25, + 0, + 27, + 1, + "IMAGE" + ], + [ + 36, + 22, + 0, + 27, + 0, + "IMAGE" + ], + [ + 40, + 32, + 0, + 31, + 0, + "IMAGE" + ], + [ + 41, + 34, + 0, + 33, + 0, + "MODEL" + ], + [ + 42, + 36, + 0, + 33, + 1, + "CONDITIONING" + ], + [ + 43, + 37, + 0, + 33, + 2, + "CONDITIONING" + ], + [ + 44, + 35, + 0, + 33, + 3, + "LATENT" + ], + [ + 45, + 34, + 1, + 36, + 0, + "CLIP" + ], + [ + 46, + 34, + 1, + 37, + 0, + "CLIP" + ], + [ + 47, + 33, + 0, + 38, + 0, + "LATENT" + ], + [ + 48, + 34, + 2, + 38, + 1, + "VAE" + ], + [ + 49, + 38, + 0, + 39, + 0, + "IMAGE" + ], + [ + 50, + 38, + 0, + 40, + 0, + "IMAGE" + ], + [ + 51, + 40, + 0, + 41, + 1, + "IMAGE" + ], + [ + 52, + 38, + 0, + 41, + 0, + "IMAGE" + ], + [ + 53, + 41, + 0, + 42, + 0, + "IMAGE" + ], + [ + 54, + 27, + 0, + 43, + 0, + "IMAGE" + ], + [ + 55, + 43, + 0, + 28, + 0, + "IMAGE" + ], + [ + 56, + 41, + 0, + 43, + 1, + "IMAGE" + ], + [ + 60, + 45, + 0, + 44, + 0, + "MODEL" + ], + [ + 61, + 47, + 0, + 44, + 1, + "CONDITIONING" + ], + [ + 62, + 48, + 0, + 44, + 2, + "CONDITIONING" + ], + [ + 64, + 45, + 1, + 47, + 0, + "CLIP" + ], + [ + 65, + 45, + 1, + 48, + 0, + "CLIP" + ], + [ + 66, + 44, + 0, + 49, + 0, + "LATENT" + ], + [ + 67, + 45, + 2, + 49, + 1, + "VAE" + ], + [ + 68, + 43, + 0, + 50, + 0, + "IMAGE" + ], + [ + 69, + 45, + 2, + 50, + 1, + "VAE" + ], + [ + 70, + 50, + 0, + 44, + 3, + "LATENT" + ], + [ + 71, + 49, + 0, + 51, + 0, + "IMAGE" + ], + [ + 72, + 40, + 0, + 52, + 0, + "IMAGE" + ], + [ + 73, + 53, + 0, + 16, + 0, + "IMAGE" + ], + [ + 74, + 53, + 0, + 32, + 0, + "IMAGE" + ], + [ + 75, + 53, + 0, + 43, + 2, + "IMAGE" + ], + [ + 76, + 54, + 0, + 30, + 0, + "IMAGE" + ], + [ + 77, + 54, + 0, + 27, + 2, + "IMAGE" + ], + [ + 78, + 54, + 0, + 32, + 1, + "IMAGE" + ], + [ + 79, + 22, + 0, + 53, + 0, + "IMAGE" + ], + [ + 80, + 22, + 0, + 54, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/tests/separation_tests.json b/tests/separation_tests.json new file mode 100644 index 0000000..0b385e7 --- /dev/null +++ b/tests/separation_tests.json @@ -0,0 +1,990 @@ +{ + "last_node_id": 23, + "last_link_id": 32, + "nodes": [ + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 413, + 389 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 415, + 186 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "group photo of a soccer team, close-up" + ] + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + 26, + 474 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "deliberate_v11.safetensors" + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 863, + 186 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 156680208700286, + "fixed", + 36, + 8, + "dpmpp_2m", + "karras", + 1 + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 473, + 609 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 2 + ] + }, + { + "id": 10, + "type": "PreviewImage", + "pos": [ + 1755, + 95 + ], + "size": [ + 644.5304686741281, + 458.2075339846583 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 10 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 13, + "type": "PreviewImage", + "pos": [ + 2187, + 583 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 13 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 12, + "type": "PreviewImage", + "pos": [ + 2347, + 907 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 17 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1209, + 188 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 10, + 11, + 20 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 14, + "type": "Mask Morphology", + "pos": [ + 1603, + 904 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 14 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 16 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 10, + "open" + ] + }, + { + "id": 17, + "type": "PreviewImage", + "pos": [ + 3051, + 1124 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 19 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 16, + "type": "Separate Mask Components", + "pos": [ + 2093, + 1314 + ], + "size": { + "0": 216.59999084472656, + "1": 46 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "IMAGE", + "link": 18 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 19, + 24, + 29 + ], + "slot_index": 0 + }, + { + "name": "MASK_MAPPING", + "type": "MASK_MAPPING", + "links": [ + 22 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Separate Mask Components" + } + }, + { + "id": 20, + "type": "Mask To Region", + "pos": [ + 2319.748221405281, + 1840.8289502356658 + ], + "size": { + "0": 315, + "1": 202 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "IMAGE", + "link": 24 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 25, + 30 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask To Region" + }, + "widgets_values": [ + 32, + "keep_ratio", + 2, + 2, + 0, + 0, + "match_ratio" + ] + }, + { + "id": 23, + "type": "Cut By Mask", + "pos": [ + 2550, + 1637 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 29 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 30 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 31 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 18, + "type": "Cut By Mask", + "pos": [ + 2754, + 1442 + ], + "size": { + "0": 342.5999755859375, + "1": 122 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 20 + }, + { + "name": "mask", + "type": "IMAGE", + "link": 25 + }, + { + "name": "mask_mapping_optional", + "type": "MASK_MAPPING", + "link": 22 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 23, + 32 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Cut By Mask" + }, + "widgets_values": [ + 0, + 0 + ] + }, + { + "id": 15, + "type": "Mask Morphology", + "pos": [ + 1952, + 918 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 16 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 17, + 18 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Morphology" + }, + "widgets_values": [ + 0, + "dilate" + ] + }, + { + "id": 19, + "type": "PreviewImage", + "pos": [ + 3402, + 1461 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 23 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 11, + "type": "Mask By Text", + "pos": [ + 1190, + 670 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 11 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 14 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 13 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Mask By Text" + }, + "widgets_values": [ + "face", + "", + 0.2999999999999999, + "no" + ] + }, + { + "id": 22, + "type": "PreviewImage", + "pos": [ + 3696, + 1843 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 28 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 21, + "type": "Combine Masks", + "pos": [ + 3109, + 1793 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 32 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 31 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 28 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Combine Masks" + }, + "widgets_values": [ + "multiply", + "yes", + "no" + ] + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 10, + 8, + 0, + 10, + 0, + "IMAGE" + ], + [ + 11, + 8, + 0, + 11, + 0, + "IMAGE" + ], + [ + 13, + 11, + 1, + 13, + 0, + "IMAGE" + ], + [ + 14, + 11, + 0, + 14, + 0, + "IMAGE" + ], + [ + 16, + 14, + 0, + 15, + 0, + "IMAGE" + ], + [ + 17, + 15, + 0, + 12, + 0, + "IMAGE" + ], + [ + 18, + 15, + 0, + 16, + 0, + "IMAGE" + ], + [ + 19, + 16, + 0, + 17, + 0, + "IMAGE" + ], + [ + 20, + 8, + 0, + 18, + 0, + "IMAGE" + ], + [ + 22, + 16, + 1, + 18, + 2, + "MASK_MAPPING" + ], + [ + 23, + 18, + 0, + 19, + 0, + "IMAGE" + ], + [ + 24, + 16, + 0, + 20, + 0, + "IMAGE" + ], + [ + 25, + 20, + 0, + 18, + 1, + "IMAGE" + ], + [ + 28, + 21, + 0, + 22, + 0, + "IMAGE" + ], + [ + 29, + 16, + 0, + 23, + 0, + "IMAGE" + ], + [ + 30, + 20, + 0, + 23, + 1, + "IMAGE" + ], + [ + 31, + 23, + 0, + 21, + 1, + "IMAGE" + ], + [ + 32, + 18, + 0, + 21, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file