From 6a4b0eb614ccd16f49ecc05de599f1314c3ad2de Mon Sep 17 00:00:00 2001 From: ArtBot2023 Date: Tue, 5 Sep 2023 10:56:44 +0800 Subject: [PATCH] init --- .gitignore | 2 + __init__.py | 3 + blend.py | 133 + nodes.py | 448 ++++ tifa_text_gen.json | 3953 ++++++++++++++++++++++++++++++ tmp.png | Bin 0 -> 2700 bytes utils.py | 55 + workflows/CharacterFaceSwap.json | 2205 +++++++++++++++++ 8 files changed, 6799 insertions(+) create mode 100644 .gitignore create mode 100644 __init__.py create mode 100644 blend.py create mode 100644 nodes.py create mode 100644 tifa_text_gen.json create mode 100644 tmp.png create mode 100644 utils.py create mode 100644 workflows/CharacterFaceSwap.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f53d18e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +.vscode diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..9d51591 --- /dev/null +++ b/__init__.py @@ -0,0 +1,3 @@ +from .nodes import NODE_CLASS_MAPPINGS + +__all__ = ['NODE_CLASS_MAPPINGS'] diff --git a/blend.py b/blend.py new file mode 100644 index 0000000..55ad54e --- /dev/null +++ b/blend.py @@ -0,0 +1,133 @@ +"""Implement Photoshop color blend +ref: https://stackoverflow.com/questions/12121393/please-explain-this-color-blending-mode-formula-so-i-can-replicate-it-in-php-ima +""" + +from typing import Literal +import cv2 +import numpy as np + +R = 0.3 +G = 0.59 +B = 0.11 + +def rgb2hsy(image): + """image is normalized to [0,1] + """ + image = np.minimum(np.maximum(image, 0), 1) + r, g, b = image[:,:,0], image[:,:,1], image[:,:,2] + + h = np.zeros_like(r) + s = np.zeros_like(g) + y = R * r + G * g + B * b + + mask_gray = (r == g) & (g == b) + s[mask_gray] = 0 + h[mask_gray] = 0 + + mask_sector_0 = ((r >= g) & (g >= b)) & ~mask_gray # Sector 0: 0° - 60° + s[mask_sector_0] = r[mask_sector_0] - b[mask_sector_0] + h[mask_sector_0] = 60 * (g[mask_sector_0] - b[mask_sector_0]) / s[mask_sector_0] + + mask_sector_1 = (g > r) & (r >= b) + s[mask_sector_1] = g[mask_sector_1] - b[mask_sector_1] + h[mask_sector_1] = 60 * (g[mask_sector_1] - r[mask_sector_1]) / s[mask_sector_1] + 60 + + mask_sector_2 = (g >= b) & (b > r) + s[mask_sector_2] = g[mask_sector_2] - r[mask_sector_2] + h[mask_sector_2] = 60 * (b[mask_sector_2] - r[mask_sector_2]) / s[mask_sector_2] + 120 + + mask_sector_3 = (b > g) & (g > r) + s[mask_sector_3] = b[mask_sector_3] - r[mask_sector_3] + h[mask_sector_3] = 60 * (b[mask_sector_3] - g[mask_sector_3]) / s[mask_sector_3] + 180 + + mask_sector_4 = (b > r) & (r >= g) + s[mask_sector_4] = b[mask_sector_4] - g[mask_sector_4] + h[mask_sector_4] = 60 * (r[mask_sector_4] - g[mask_sector_4]) / s[mask_sector_4] + 240 + + mask_sector_5 = ~(mask_gray | mask_sector_0 | mask_sector_1 | mask_sector_2 | mask_sector_3 | mask_sector_4) + s[mask_sector_5] = r[mask_sector_5] - g[mask_sector_5] + h[mask_sector_5] = 60 * (r[mask_sector_5] - b[mask_sector_5]) / s[mask_sector_5] + 300 + + hsy = np.zeros_like(image) + hsy[:,:,0] = h % 360 + hsy[:,:,1] = np.minimum(np.maximum(s, 0), 1) + hsy[:,:,2] = np.minimum(np.maximum(y, 0), 1) + return hsy + +def hsy2rgb(image): + h, s, y = image[:, :, 0], image[:, :, 1], image[:, :, 2] + + h = h % 360 + s = np.minimum(np.maximum(s, 0), 1) + y = np.minimum(np.maximum(y, 0), 1) + + r = np.zeros_like(h) + g = np.zeros_like(h) + b = np.zeros_like(h) + k = np.zeros_like(h) + + mask_sector_0 = (h >= 0) & (h < 60) + k[mask_sector_0] = s[mask_sector_0] * h[mask_sector_0] / 60 + b[mask_sector_0] = y[mask_sector_0] - R * s[mask_sector_0] - G * k[mask_sector_0] + r[mask_sector_0] = b[mask_sector_0] + s[mask_sector_0] + g[mask_sector_0] = b[mask_sector_0] + k[mask_sector_0] + + mask_sector_1 = (h >= 60) & (h < 120) + k[mask_sector_1] = s[mask_sector_1] * (h[mask_sector_1] - 60) / 60 + g[mask_sector_1] = y[mask_sector_1] + B * s[mask_sector_1] + R * k[mask_sector_1] + b[mask_sector_1] = g[mask_sector_1] - s[mask_sector_1] + r[mask_sector_1] = g[mask_sector_1] - k[mask_sector_1] + + mask_sector_2 = (h >= 120) & (h < 180) + k[mask_sector_2] = s[mask_sector_2] * (h[mask_sector_2] - 120) / 60 + r[mask_sector_2] = y[mask_sector_2] - G * s[mask_sector_2] - B * k[mask_sector_2] + g[mask_sector_2] = r[mask_sector_2] + s[mask_sector_2] + b[mask_sector_2] = r[mask_sector_2] + k[mask_sector_2] + + mask_sector_3 = (h >= 180) & (h < 240) + k[mask_sector_3] = s[mask_sector_3] * (h[mask_sector_3] - 180) / 60 + b[mask_sector_3] = y[mask_sector_3] + R * s[mask_sector_3] + G * k[mask_sector_3] + r[mask_sector_3] = b[mask_sector_3] - s[mask_sector_3] + g[mask_sector_3] = b[mask_sector_3] - k[mask_sector_3] + + mask_sector_4 = (h >= 240) & (h < 300) + k[mask_sector_4] = s[mask_sector_4] * (h[mask_sector_4] - 240) / 60 + g[mask_sector_4] = y[mask_sector_4] - B * s[mask_sector_4] - R * k[mask_sector_4] + b[mask_sector_4] = g[mask_sector_4] + s[mask_sector_4] + r[mask_sector_4] = g[mask_sector_4] + k[mask_sector_4] + + mask_sector_5 = h >= 300 + k[mask_sector_5] = s[mask_sector_5] * (h[mask_sector_5] - 300) / 60 + r[mask_sector_5] = y[mask_sector_5] + G * s[mask_sector_5] + B * k[mask_sector_5] + g[mask_sector_5] = r[mask_sector_5] - s[mask_sector_5] + b[mask_sector_5] = r[mask_sector_5] - k[mask_sector_5] + + return np.minimum(np.maximum(np.stack([r, g, b], axis=-1), 0), 1) + + +def color_blend(base_image, blend_image, mode: Literal["Hue", "Saturation", "Color", "Luminosity"]): + """ + Args: + base_image (cv2) + blend_image (cv2) + Return: + cv2 + """ + base_image = cv2.cvtColor(base_image, cv2.COLOR_BGR2RGB).astype(np.float32)/255 + blend_image = cv2.cvtColor(blend_image, cv2.COLOR_BGR2RGB).astype(np.float32)/255 + + # Convert to HLS color space using OpenCV + hsy_base = rgb2hsy(base_image) + hsy_blend = rgb2hsy(blend_image) + + if mode=="Hue": + hsy_out = np.stack([hsy_blend[:,:,0], hsy_base[:,:,1], hsy_base[:,:,2]], axis=-1) + elif mode=="Saturation": + hsy_out = np.stack([hsy_base[:,:,0], hsy_blend[:,:,1], hsy_base[:,:,2]], axis=-1) + elif mode=="Color": + hsy_out = np.stack([hsy_blend[:,:,0], hsy_blend[:,:,1], hsy_base[:,:,2]], axis=-1) + elif mode=="Luminosity": + hsy_out = np.stack([hsy_base[:,:,0], hsy_base[:,:,1], hsy_blend[:,:,2]], axis=-1) + else: assert False, f"{mode} is not a valid mode" + rgb_out = hsy2rgb(hsy_out) + return cv2.cvtColor((rgb_out*255).astype(np.uint8), cv2.COLOR_RGB2BGR) \ No newline at end of file diff --git a/nodes.py b/nodes.py new file mode 100644 index 0000000..bb256a1 --- /dev/null +++ b/nodes.py @@ -0,0 +1,448 @@ +from typing import Tuple, List, Literal +import os +import comfy.samplers +from facexlib.detection import RetinaFace +from facexlib.parsing import BiSeNet +import torch +import numpy as np +import cv2 +from .utils import models_dir, tensor2pil, pil2tensor, tensor2cv, cv2tensor, hex2bgr, BBox + +# copy from SeargeSDXL +class GenerationParameterInput: + @classmethod + def INPUT_TYPES(cls): + return {"required": { + "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}), + "image_width": ("INT", {"default": 512, "min": 0, "max": 1024, "step": 8}), + "image_height": ("INT", {"default": 512, "min": 0, "max": 1024, "step": 8}), + "steps": ("INT", {"default": 20, "min": 0, "max": 200}), + "cfg": ("FLOAT", {"default": 7.0, "min": 0.0, "max": 30.0, "step": 0.5}), + "sampler_name": (comfy.samplers.KSampler.SAMPLERS, {"default": "dpmpp_2m"}), + "scheduler": (comfy.samplers.KSampler.SCHEDULERS, {"default": "karras"}), + "denoise": ("FLOAT", {"default": 1, "min": 0, "max": 1}) + }, + "optional": { + "parameters": ("PARAMETERS", ), + }, + } + + RETURN_TYPES = ("PARAMETERS", ) + RETURN_NAMES = ("parameters", ) + FUNCTION = "mux" + + CATEGORY = "ArtBot2023" + + def mux(self, seed, image_width, image_height, steps, cfg, sampler_name, scheduler, denoise, parameters={}): + parameters["seed"] = seed + parameters["image_width"] = image_width + parameters["image_height"] = image_height + parameters["steps"] = steps + parameters["cfg"] = cfg + parameters["sampler_name"] = sampler_name + parameters["scheduler"] = scheduler + parameters["denoise"] = denoise + return (parameters, ) + +class GenertaionParameterOutput: + @classmethod + def INPUT_TYPES(cls): + return {"required": { + "parameters": ("PARAMETERS", ), + }, + } + + RETURN_TYPES = ("PARAMETERS", "INT", "INT", "INT", "INT", "FLOAT", comfy.samplers.KSampler.SAMPLERS, comfy.samplers.KSampler.SCHEDULERS, "FLOAT", ) + RETURN_NAMES = ("parameters", "seed", "image_width", "image_height", "steps", "cfg", "sampler_name", "scheduler", "denoise", ) + FUNCTION = "demux" + + CATEGORY = "ArtBot2023" + + def demux(self, parameters): + seed = parameters["seed"] + image_width = parameters["image_width"] + image_height = parameters["image_height"] + steps = parameters["steps"] + cfg = parameters["cfg"] + sampler_name = parameters["sampler_name"] + scheduler = parameters["scheduler"] + denoise = parameters["denoise"] + return (parameters, seed, image_width, image_height, steps, cfg, sampler_name, scheduler, denoise, ) + + +class LoadRetinaFace: + models_dir = os.path.join(models_dir, 'facexlib') + @classmethod + def INPUT_TYPES(cls): + return {"required":{}} + + RETURN_TYPES = ("RETINAFACE", ) + RETURN_NAMES = ("MODEL", ) + FUNCTION = "load" + CATEGORY = "ArtBot2023" + def load(self): + from facexlib.detection import init_detection_model + return (init_detection_model("retinaface_resnet50", model_rootpath=self.models_dir), ) + + +class CropFace: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "model": ("RETINAFACE", ), + "image": ("IMAGE", ), + "confidence": ("FLOAT", {"default": 0.8, "min": 0, "max": 1}), + "margin": ("INT", {"default": 32}), + } + } + + RETURN_TYPES = ( + "IMAGE", "IMAGE", "BBOX" + ) + RETURN_NAMES = ("face_image", "preview", "bbox") + FUNCTION = "crop" + CATEGORY = "ArtBot2023" + + def crop(self, model: RetinaFace, image: torch.Tensor, confidence: float, margin: int): + with torch.no_grad(): + # model receives bgr uint8 format + # bboxes: list of [x0, y0, x1, y1, confidence_score, five points (x, y)] + bboxes = model.detect_faces(tensor2cv(image), confidence) + if (len(bboxes)==0): + print("no face detected") + return np.zeros((4,)), 0, image + detection_preview = self.visualize_detection(tensor2cv(image), bboxes) + bboxes = [self.add_margin_and_make_square((int(min(x0, x1)), int(min(y0,y1)), int(abs(x1-x0)), int(abs(y1-y0))), margin, img_width=image.shape[2], img_height=image.shape[1]) for (x0, y0, x1, y1, *_) in bboxes] + detection_preview = self.visualize_margin(detection_preview, bboxes) + + faces = self.crop_faces(bboxes, image) + # scaled_faces = self.scale_faces(faces, size) + return faces[0].unsqueeze(0), cv2tensor(detection_preview), bboxes[0] + + def crop_faces(self, bboxes: List[BBox], image: torch.Tensor): + """ + Returns: list of Tensor[h,w,c] + """ + return [image[0, y:y+h, x:x+w, :] for (x,y,w,h) in bboxes] + + def scale_faces(self, faces: List[torch.Tensor], size: int, upscaler: Literal["linear"]="linear"): + """ + Args: + faces: list of Tensor[h,w,c] + """ + scaled_faces: List[torch.Tensor] = [] + for face in faces: + # Change the layout to [batch, channel, height, width] + face = face.permute(2, 0, 1).unsqueeze(0) + + # Perform the interpolation + if upscaler == "linear": + scaled_face = torch.nn.functional.interpolate(face, size=(size, size), mode="bilinear", align_corners=True) + elif upscaler == "nearest": + scaled_face = torch.nn.functional.interpolate(face, size=(size, size), mode="nearest") + else: + raise ValueError(f"Invalid upscaler: {upscaler}") + + # Change the layout back to [height, width, channel] and remove batch dimension + scaled_face = scaled_face.squeeze(0).permute(1, 2, 0) + scaled_faces.append(scaled_face) + + return scaled_faces + + def visualize_margin(self, img, bboxes): + img = np.copy(img) + for bbox in bboxes: + x,y,w,h = bbox + cv2.rectangle(img, (x,y), (x+w, y+h), hex2bgr("#710193"), 2) + return img + + def visualize_detection(self, img, bboxes_and_landmarks): + """ + Args: + img (np.ndarray): bgr + Returns: + img: bgr + """ + img = np.copy(img) + + for b in bboxes_and_landmarks: + # confidence + cv2.putText(img, f'{b[4]:.4f}', (int(b[0]), int(b[1] + 12)), cv2.FONT_HERSHEY_DUPLEX, 0.5, (255, 255, 255)) + # bounding boxes + b = list(map(int, b)) + cv2.rectangle(img, (b[0], b[1]), (b[2], b[3]), (0, 0, 255), 2) + # landmarks (for retinaface) + cv2.circle(img, (b[5], b[6]), 1, (0, 0, 255), 4) + cv2.circle(img, (b[7], b[8]), 1, (0, 255, 255), 4) + cv2.circle(img, (b[9], b[10]), 1, (255, 0, 255), 4) + cv2.circle(img, (b[11], b[12]), 1, (0, 255, 0), 4) + cv2.circle(img, (b[13], b[14]), 1, (255, 0, 0), 4) + return img + + def add_margin_and_make_square(self, bbox: BBox, margin: int, img_width: int, img_height: int): + x, y, w, h = map(lambda x: int(x), bbox) # x, y are the coordinates of the top-left corner of the bounding box + + # Calculate margin + margin_w = margin + margin_h = margin + + # Add margin to the bounding box, ensuring it doesn't go out of the image boundaries + x = max(0, x - margin_w) + y = max(0, y - margin_h) + w = min(img_width - x, w + 2 * margin_w) + h= min(img_height - y, h + 2 * margin_h) + + # Make the bounding box square while keeping the center the same + cx, cy = x + w // 2, y + h // 2 # Calculate the center of the original bounding box + max_side = max(w, h) + x = max(0, cx - max_side // 2) + y = max(0, cy - max_side // 2) + w = h = min(max_side, img_width - x, img_height - y) # Ensure the bounding box is within the image boundaries + return int(x), int(y), int(w), int(h) + +class UncropFace: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE", ), + "bbox": ("BBOX", ), + "face": ("IMAGE", ), + "mask": ("MASK", ) + } + } + RETURN_TYPES = ("IMAGE", ) + + CATEGORY = "ArtBot2023" + FUNCTION = "uncrop" + def uncrop(self, image: torch.Tensor, bbox: BBox, face: torch.Tensor, mask: torch.Tensor): + bbox_face, bbox_mask = self.scale_face(face.squeeze(), mask, bbox[2]) + cv2.imwrite("bbox_face.png", tensor2cv(bbox_face)) + cv2.imwrite("bbox_mask.png", tensor2cv(bbox_mask)) + image_apply_face = self.weighted_sum(image.squeeze(), bbox, bbox_face, bbox_mask) + return (image_apply_face.unsqueeze(0), ) + + def scale_face(self, face: torch.Tensor, mask: torch.Tensor, size): + """ + Args: + face (torch.Tensor): [h,w,c] + mask (torch.Tensor): [h,w] + """ + scaled_faces: List[torch.Tensor] = [] + for face in [face, mask.unsqueeze(-1)]: + # Change the layout to [batch, channel, height, width] + face = face.permute(2, 0, 1).unsqueeze(0) + scaled_face = torch.nn.functional.interpolate(face, size=(size, size), mode="bilinear", align_corners=True) + + # Change the layout back to [height, width, channel] and remove batch dimension + scaled_face = scaled_face.squeeze(0).permute(1, 2, 0) + scaled_faces.append(scaled_face) + return scaled_faces[0], scaled_faces[1].squeeze() + + def weighted_sum(self, image: torch.Tensor, bbox: BBox, face: torch.Tensor, mask: torch.Tensor)->torch.Tensor: + """ + Args: + image (torch.Tensor): [h_full,w_full,c] + bbox (BBox): [x,y,w,h] + face (torch.Tensor): [h,w,c] + mask (torch.Tensor): [h,w] + + Returns: + torch.Tensor: same shape as image + """ + image = image.clone() + x,y,w,h = bbox + mask = mask.unsqueeze(-1) + image[y:y+h, x:x+w, :] = mask * face + image[y:y+h, x:x+w, :] * (1-mask) + return image + +class LoadBisenet: + models_dir = os.path.join(models_dir, 'facexlib') + @classmethod + def INPUT_TYPES(cls): + return {"required":{}} + + RETURN_TYPES = ("BISENET", ) + FUNCTION = "load" + CATEGORY = "ArtBot2023" + def load(self): + from facexlib.parsing import init_parsing_model + return (init_parsing_model("bisenet", model_rootpath=self.models_dir), ) + +class SegFace: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "model": ("BISENET", ), + "image": ("IMAGE", ), + "expand": ("INT", {"min": 0}), + "include_hair": (["enable", "disable"], {"default": "disable"}), + "include_neck": (["enable", "disable"], {"default": "disable"}), + } + } + + RETURN_TYPES = ( + "IMAGE", "MASK" + ) + RETURN_NAMES = ("image", "mask") + FUNCTION = "segment" + CATEGORY = "ArtBot2023" + + # labels: 0 'background' + # 1 'skin', 2 'l_brow', 3 'r_brow', 4 'l_eye', 5 'r_eye', + # 6 'eye_g', 7 'l_ear', 8 'r_ear', 9 'ear_r', 10 'nose', + # 11 'mouth', 12 'u_lip', 13 'l_lip', 14 'neck', 15 'neck_l', + # 16 'cloth', 17 'hair', 18 'hat' + annotation_name = ['background', + 'skin', 'l_brow', 'r_brow', 'l_eye', 'r_eye', + 'eye_g', 'l_ear', 'r_ear', 'ear_r', 'nose', + 'mouth', 'u_lip', 'l_lip', 'neck', 'neck_l', + 'cloth', 'hair', 'hat'] + annotation_color = [[255, 0, 0], [255, 85, 0], [255, 170, 0], [255, 0, 85], [255, 0, 170], [0, 255, 0], [85, 255, 0], + [170, 255, 0], [0, 255, 85], [0, 255, 170], [0, 0, 255], [85, 0, 255], [170, 0, 255], [0, 85, 255], + [0, 170, 255], [255, 255, 0], [255, 255, 85], [255, 255, 170], [255, 0, 255], [255, 85, 255], + [255, 170, 255], [0, 255, 255], [85, 255, 255], [170, 255, 255]] + + def segment(self, model: BiSeNet, image: torch.Tensor, expand, include_hair, include_neck): + image = image.squeeze().permute(2,0,1).unsqueeze(0).flip([1]) # shape [1, c, h, w], rgb2bgr + with torch.no_grad(): + from torchvision.transforms.functional import normalize + out = model(normalize(image, [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]).cuda())[0] # shape [1, 19, h, w] + annotation = out.squeeze().cpu().numpy().argmax(0) + mask = self.get_mask(annotation, expand, include_hair, include_neck) + masked_face = mask.unsqueeze(0).unsqueeze(-1) * image.squeeze().permute(1,2,0).unsqueeze(0).flip([3]) # shape [1, h, w, c], bgr2rgb + return masked_face, mask + + def get_mask(self, annotation, expand, include_hair, include_neck): + face_inds = list(range(1,14)) + hair_ind = self.annotation_name.index("hair") + neck_ind = self.annotation_name.index("neck") + target_inds = face_inds + if include_hair == "enable": target_inds.append(hair_ind) + if include_neck == "enable": target_inds.append(neck_ind) + + mask = np.zeros_like(annotation, dtype=np.float32) + for ind in target_inds: + mask[annotation==ind] = 1 + blurred_mask = cv2.dilate(mask, np.ones((expand, expand), np.float32), iterations=1) + return torch.from_numpy(blurred_mask) + +class ImageFullBBox: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("IMAGE", ) + } + } + + RETURN_TYPES = ("BBOX", ) + FUNCTION = "bbox" + CATEGORY = "ArtBot2023" + def bbox(self, image: torch.Tensor): + image = image.squeeze() + return ((0,0,image.shape[1],image.shape[0]), ) + +class ColorBlend: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "blend_image": ("IMAGE", ), + "base_image": ("IMAGE", ), + "mode": (["Hue", "Saturation", "Color", "Luminosity"], ) + } + } + + RETURN_TYPES = ("IMAGE", ) + FUNCTION = "blend" + CATEGORY = "ArtBot2023" + def blend(self, blend_image: torch.Tensor, base_image: torch.Tensor, mode: Literal["Hue", "Saturation", "Color", "Luminosity"]): + from .blend import color_blend + return (cv2tensor(color_blend(base_image=tensor2cv(base_image), blend_image=tensor2cv(blend_image), mode=mode)), ) + +class ExcludeFacialFeature: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "face": ("IMAGE", ), + "model": ("BISENET", ), + "image": ("IMAGE", ), + "expand": ("INT", {"min": 0}) + } + } + + RETURN_TYPES = ("IMAGE", ) + FUNCTION = "exclude" + CATEGORY = "ArtBot2023" + annotation_name = ['background', + 'skin', 'l_brow', 'r_brow', 'l_eye', 'r_eye', + 'eye_g', 'l_ear', 'r_ear', 'ear_r', 'nose', + 'mouth', 'u_lip', 'l_lip', 'neck', 'neck_l', + 'cloth', 'hair', 'hat'] + + def exclude(self, face: torch.Tensor, model: BiSeNet, image: torch.Tensor, expand: int): + face = face.squeeze().permute(2,0,1).unsqueeze(0).flip([1]) # shape [1, c, h, w], rgb2bgr + with torch.no_grad(): + from torchvision.transforms.functional import normalize + out = model(normalize(face, [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]).cuda())[0] # shape [1, 19, h, w] + annotation = out.squeeze().cpu().numpy().argmax(0) + # mask = self.get_mask_facial_feature(annotation, expand) + # image = image * (1-mask).unsqueeze(0).unsqueeze(-1) + mask = self.get_mask_hair(annotation, expand) + image = image * mask.unsqueeze(0).unsqueeze(-1) + return (image, ) + + def get_mask_hair(self, annotation, expand): + hair_ind = self.annotation_name.index('hair') + mask = np.zeros_like(annotation, dtype=np.float32) + mask[annotation==hair_ind] = 1 + blurred_mask = cv2.dilate(mask, np.ones((expand, expand), np.float32), iterations=1) + return torch.from_numpy(blurred_mask) + + def get_mask_facial_feature(self, annotation, expand): + facial_feature_inds = list(range(2,14)) + mask = np.zeros_like(annotation, dtype=np.float32) + for ind in facial_feature_inds: + mask[annotation==ind] = 1 + blurred_mask = cv2.dilate(mask, np.ones((expand, expand), np.float32), iterations=1) + return torch.from_numpy(blurred_mask) + +class MaskContour: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "mask": ("MASK", ), + } + } + + RETURN_TYPES = ("MASK", ) + FUNCTION = "find_contour" + CATEGORY = "ArtBot2023" + + def find_contour(self, mask: torch.Tensor): + mask_np: np.ndarray = mask.squeeze().cpu().numpy().astype('uint8') + contours, _ = cv2.findContours(mask_np, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) + mask_contour = np.zeros((mask_np.shape[0], mask_np.shape[1]), dtype=np.float32) + cv2.drawContours(mask_contour, contours, -1, (1, ), 1) + + return (torch.from_numpy(mask_contour), ) + + +NODE_CLASS_MAPPINGS = { + "Generation Parameter Input": GenerationParameterInput, + "Generation Parameter Output": GenertaionParameterOutput, + "Load RetinaFace": LoadRetinaFace, + "Load BiseNet": LoadBisenet, + "Uncrop Face": UncropFace, + "Crop Face": CropFace, + "Segment Face": SegFace, + "Image Full BBox": ImageFullBBox, + "Color Blend": ColorBlend, + "Exclude Facial Feature": ExcludeFacialFeature, + "Mask Contour": MaskContour +} \ No newline at end of file diff --git a/tifa_text_gen.json b/tifa_text_gen.json new file mode 100644 index 0000000..0eb5e45 --- /dev/null +++ b/tifa_text_gen.json @@ -0,0 +1,3953 @@ +{ + "last_node_id": 89, + "last_link_id": 124, + "nodes": [ + { + "id": 7, + "type": "Reroute", + "pos": [ + 655, + 345 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 43, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 121, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 9, + 10 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 28, + "type": "Reroute", + "pos": [ + 80.61996704101563, + 997.2960712890631 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 69 + } + ], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 14 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 29, + "type": "Reroute", + "pos": [ + 67, + 1024 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 70 + } + ], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 15 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 30, + "type": "Reroute", + "pos": [ + 69, + 1056 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 71 + } + ], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 16 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 26, + "type": "Reroute", + "pos": [ + 600, + 1002 + ], + "size": [ + 90.4, + 26 + ], + "flags": {}, + "order": 46, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 11 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 26 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 35, + "type": "Reroute", + "pos": [ + 839, + 998 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 47, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 66 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 20 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 41, + "type": "ImageUpscaleWithModel", + "pos": [ + 211.86671152114866, + 1456.5330352783205 + ], + "size": { + "0": 241.79998779296875, + "1": 46 + }, + "flags": {}, + "order": 66, + "mode": 0, + "inputs": [ + { + "name": "upscale_model", + "type": "UPSCALE_MODEL", + "link": 60 + }, + { + "name": "image", + "type": "IMAGE", + "link": 42 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 32 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "Upscale Image 4x", + "properties": { + "Node name for S&R": "ImageUpscaleWithModel" + } + }, + { + "id": 42, + "type": "VAEEncode", + "pos": [ + 870.8667115211488, + 1460.5330352783205 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 68, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 33 + }, + { + "name": "vae", + "type": "VAE", + "link": 48 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 34 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncode" + } + }, + { + "id": 45, + "type": "Reroute", + "pos": [ + 839, + 1027 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 44, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 68 + } + ], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 28 + ], + "slot_index": 0 + } + ], + "title": "VAE", + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 38, + "type": "Reroute", + "pos": [ + 837, + 1128 + ], + "size": [ + 90.4, + 26 + ], + "flags": {}, + "order": 51, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 26 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 25 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 53, + "type": "Reroute", + "pos": [ + 847, + 1276 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 87, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": [ + "normal", + "karras", + "exponential", + "sgm_uniform", + "simple", + "ddim_uniform" + ], + "links": [], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 40, + "type": "ImageScaleBy", + "pos": [ + 493.86671152114866, + 1458.5330352783205 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 67, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 32 + }, + { + "name": "scale_by", + "type": "FLOAT", + "link": 47, + "widget": { + "name": "scale_by", + "config": [ + "FLOAT", + { + "default": 1, + "min": 0.01, + "max": 8, + "step": 0.01 + } + ] + } + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 33 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "Downscale to Scale Factor", + "properties": { + "Node name for S&R": "ImageScaleBy" + }, + "widgets_values": [ + "bilinear", + 1 + ] + }, + { + "id": 57, + "type": "CM_FloatBinaryOperation", + "pos": [ + 360.86671152114866, + 1545.5330352783205 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": { + "collapsed": true + }, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "a", + "type": "FLOAT", + "link": 44, + "widget": { + "name": "a", + "config": [ + "FLOAT", + { + "default": 0 + } + ] + } + }, + { + "name": "b", + "type": "FLOAT", + "link": 45, + "widget": { + "name": "b", + "config": [ + "FLOAT", + { + "default": 0 + } + ] + } + } + ], + "outputs": [ + { + "name": "FLOAT", + "type": "FLOAT", + "links": [ + 47 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "Scale/4", + "properties": { + "Node name for S&R": "CM_FloatBinaryOperation" + }, + "widgets_values": [ + "Div", + 0, + 0 + ] + }, + { + "id": 58, + "type": "SeargeFloatConstant", + "pos": [ + 276.86671152114866, + 1546.5330352783205 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": { + "collapsed": true + }, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "value", + "type": "FLOAT", + "links": [ + 45 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "4", + "properties": { + "Node name for S&R": "SeargeFloatConstant" + }, + "widgets_values": [ + 4 + ] + }, + { + "id": 55, + "type": "Reroute", + "pos": [ + 41.36895265579224, + 1465.7139434814471 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 65, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 76 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 42 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 56, + "type": "Reroute", + "pos": [ + 44.36895265579225, + 1499.7139434814471 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 74 + } + ], + "outputs": [ + { + "name": "FLOAT", + "type": "FLOAT", + "links": [ + 44 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 60, + "type": "Reroute", + "pos": [ + 42.86671152114869, + 1566.5330352783205 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 48, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 78 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 49 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 64, + "type": "Reroute", + "pos": [ + 53.86671152114869, + 1703.5330352783205 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 91 + } + ], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 53 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 67, + "type": "Reroute", + "pos": [ + 53.86671152114869, + 1807.5330352783205 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 97, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": [ + "normal", + "karras", + "exponential", + "sgm_uniform", + "simple", + "ddim_uniform" + ], + "links": [], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 68, + "type": "Reroute", + "pos": [ + 55.86671152114869, + 1840.5330352783205 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 106, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "FLOAT", + "links": [ + 57 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 59, + "type": "Reroute", + "pos": [ + 48.217814350128194, + 1533.5729522705096 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 45, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 77 + } + ], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 48, + 58 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 47, + "type": "VAEDecode", + "pos": [ + 1514.8667115211488, + 1455.5330352783205 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 70, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 31 + }, + { + "name": "vae", + "type": "VAE", + "link": 58 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 59 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 72, + "type": "Reroute", + "pos": [ + 48.50224113464357, + 1429.1809082031266 + ], + "size": [ + 149.2, + 26 + ], + "flags": {}, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 75 + } + ], + "outputs": [ + { + "name": "UPSCALE_MODEL", + "type": "UPSCALE_MODEL", + "links": [ + 60 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 62, + "type": "Reroute", + "pos": [ + 53, + 1636 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 58, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 80 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 51 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 61, + "type": "Reroute", + "pos": [ + 48, + 1602 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 61, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 79 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 50 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 12, + "type": "CLIPTextEncode", + "pos": [ + 943, + 328 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 50, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 10 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 114 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(worst quality, low quality:1.4),embedding:ng_deepnegative_v1_75t,(worst quality, low quality, normal quality:1.4),(long shot, bad_prompt:0.8),(blurry:1.3),(Low_resolution:1.3),(Low_picture_quality:1.3),lowres,low resolution,bad anatomy,low quality anatomy,bad hands,bad nails,bad legs,bad fingers,bad toes,tiptoes,extra digit,extar hands,extra fingers,extra arms,extra legs,fewer digit,lowres low quality face,lowres low quality eyes,cropped hands,cropped legs,cropped arms,cropped fingers,fused fingers,too many fingers,missing fingers,ugly,text,bad anatomy,(more than two arm per body:1.5),(more than two leg per body:1.4),(more than five fingers on one hand:1.4),multi arms,multi legs,bad arm anatomy,bad leg anatomy,bad hand anatomy,bad finger anatomy,bad detailed background,unclear architectural outline,non-linear background,hair crosses the screen border,obesity,worst quality,low quality,blurry,mutated hands and fingers,disfigured,fused,cloned,duplicate,missing_body,(missing_face:1.4),(missing_eyes:1.4),missing_chest,missing_nipples,missing_hips,missing_arms,missing_hands,missing_fingers,missing_legs,missing_feet,missing_toe,,embedding:easynegative, embedding:FastNegativeV2, embedding:fcNeg-neg" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 75, + "type": "Reroute", + "pos": [ + 658, + 482 + ], + "size": [ + 149.2, + 26 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 67 + } + ], + "outputs": [ + { + "name": "UPSCALE_MODEL", + "type": "UPSCALE_MODEL", + "links": [ + 75 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 44, + "type": "VAEDecode", + "pos": [ + 1365, + 1036 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 63, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 29 + }, + { + "name": "vae", + "type": "VAE", + "link": 28 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 30, + 76 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 8, + "type": "Reroute", + "pos": [ + 654, + 390 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 122 + } + ], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 68, + 77 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 63, + "type": "Reroute", + "pos": [ + 53, + 1668 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 92 + } + ], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 52 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 66, + "type": "Reroute", + "pos": [ + 53.86671152114869, + 1772.5330352783205 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 98, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": [ + "euler", + "euler_ancestral", + "heun", + "dpm_2", + "dpm_2_ancestral", + "lms", + "dpm_fast", + "dpm_adaptive", + "dpmpp_2s_ancestral", + "dpmpp_sde", + "dpmpp_sde_gpu", + "dpmpp_2m", + "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu", + "ddim", + "uni_pc", + "uni_pc_bh2" + ], + "links": [], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 52, + "type": "Reroute", + "pos": [ + 847, + 1256 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 101, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": [ + "euler", + "euler_ancestral", + "heun", + "dpm_2", + "dpm_2_ancestral", + "lms", + "dpm_fast", + "dpm_adaptive", + "dpmpp_2s_ancestral", + "dpmpp_sde", + "dpmpp_sde_gpu", + "dpmpp_2m", + "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu", + "ddim", + "uni_pc", + "uni_pc_bh2" + ], + "links": [], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 43, + "type": "KSampler", + "pos": [ + 1140, + 1454 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 69, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 49 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 50 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 51 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 34 + }, + { + "name": "seed", + "type": "INT", + "link": 52, + "widget": { + "name": "seed", + "config": [ + "INT", + { + "default": 0, + "min": 0, + "max": 18446744073709552000 + } + ] + } + }, + { + "name": "steps", + "type": "INT", + "link": 53, + "widget": { + "name": "steps", + "config": [ + "INT", + { + "default": 20, + "min": 1, + "max": 10000 + } + ] + } + }, + { + "name": "cfg", + "type": "FLOAT", + "link": 54, + "widget": { + "name": "cfg", + "config": [ + "FLOAT", + { + "default": 8, + "min": 0, + "max": 100 + } + ] + } + }, + { + "name": "sampler_name", + "type": "euler,euler_ancestral,heun,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddim,uni_pc,uni_pc_bh2", + "link": 109, + "widget": { + "name": "sampler_name", + "config": [ + [ + "euler", + "euler_ancestral", + "heun", + "dpm_2", + "dpm_2_ancestral", + "lms", + "dpm_fast", + "dpm_adaptive", + "dpmpp_2s_ancestral", + "dpmpp_sde", + "dpmpp_sde_gpu", + "dpmpp_2m", + "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu", + "ddim", + "uni_pc", + "uni_pc_bh2" + ] + ] + } + }, + { + "name": "scheduler", + "type": "normal,karras,exponential,sgm_uniform,simple,ddim_uniform", + "link": 110, + "widget": { + "name": "scheduler", + "config": [ + [ + "normal", + "karras", + "exponential", + "sgm_uniform", + "simple", + "ddim_uniform" + ] + ] + } + }, + { + "name": "denoise", + "type": "FLOAT", + "link": 57, + "widget": { + "name": "denoise", + "config": [ + "FLOAT", + { + "default": 1, + "min": 0, + "max": 1, + "step": 0.01 + } + ] + } + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 31 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 752014865532080, + "randomize", + 20, + 8, + "euler", + "normal", + 1 + ] + }, + { + "id": 65, + "type": "Reroute", + "pos": [ + 53, + 1737 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 95 + } + ], + "outputs": [ + { + "name": "FLOAT", + "type": "FLOAT", + "links": [ + 54 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 22, + "type": "SeargeFloatConstant", + "pos": [ + 1905, + 183 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "value", + "type": "FLOAT", + "links": [ + 106 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "denoise", + "properties": { + "Node name for S&R": "SeargeFloatConstant" + }, + "widgets_values": [ + 0.3 + ] + }, + { + "id": 3, + "type": "ControlNetLoader", + "pos": [ + 62, + 363 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 124 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ControlNetLoader" + }, + "widgets_values": [ + "control_v11p_sd15_openpose.pth" + ] + }, + { + "id": 74, + "type": "UpscaleModelLoader", + "pos": [ + 67, + 475 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "UPSCALE_MODEL", + "type": "UPSCALE_MODEL", + "links": [ + 67 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "Load 4x Upscale Model", + "properties": { + "Node name for S&R": "UpscaleModelLoader" + }, + "widgets_values": [ + "4x_NMKD-Siax_200k.pth" + ] + }, + { + "id": 23, + "type": "EmptyLatentImage", + "pos": [ + 207, + 1037 + ], + "size": { + "0": 210, + "1": 74.01861572265625 + }, + "flags": {}, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "batch_size", + "type": "INT", + "link": 14, + "widget": { + "name": "batch_size", + "config": [ + "INT", + { + "default": 1, + "min": 1, + "max": 64 + } + ] + } + }, + { + "name": "width", + "type": "INT", + "link": 15, + "widget": { + "name": "width", + "config": [ + "INT", + { + "default": 512, + "min": 64, + "max": 8192, + "step": 8 + } + ] + } + }, + { + "name": "height", + "type": "INT", + "link": 16, + "widget": { + "name": "height", + "config": [ + "INT", + { + "default": 512, + "min": 64, + "max": 8192, + "step": 8 + } + ] + } + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 11 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 33, + "type": "Reroute", + "pos": [ + 56, + 1227 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 82 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 19 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 32, + "type": "Reroute", + "pos": [ + 42, + 1182 + ], + "size": [ + 132.39999999999998, + 26 + ], + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 81 + } + ], + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 18 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 25, + "type": "ControlNetApply", + "pos": [ + 198, + 1209 + ], + "size": { + "0": 211.60000610351562, + "1": 98 + }, + "flags": {}, + "order": 54, + "mode": 0, + "inputs": [ + { + "name": "conditioning", + "type": "CONDITIONING", + "link": 17 + }, + { + "name": "control_net", + "type": "CONTROL_NET", + "link": 18 + }, + { + "name": "image", + "type": "IMAGE", + "link": 19 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 111 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ControlNetApply" + }, + "widgets_values": [ + 1 + ] + }, + { + "id": 82, + "type": "Reroute", + "pos": [ + 59, + 1268 + ], + "size": [ + 90.4, + 26 + ], + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 117 + } + ], + "outputs": [ + { + "name": "NUMBER", + "type": "NUMBER", + "links": [ + 116 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 54, + "type": "Reroute", + "pos": [ + 845, + 1308 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 88 + } + ], + "outputs": [ + { + "name": "FLOAT", + "type": "FLOAT", + "links": [ + 40 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 83, + "type": "Logic Boolean", + "pos": [ + 1239, + 587 + ], + "size": { + "0": 210, + "1": 78 + }, + "flags": {}, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "NUMBER", + "type": "NUMBER", + "links": [ + 117 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "INT", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "title": "Enable ControlNet", + "properties": { + "Node name for S&R": "Logic Boolean" + }, + "widgets_values": [ + 0 + ] + }, + { + "id": 37, + "type": "Reroute", + "pos": [ + 807, + 1096 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 57, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 61 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 23 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 36, + "type": "Reroute", + "pos": [ + 809, + 1061 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 60, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 24 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 21 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 51, + "type": "Reroute", + "pos": [ + 844, + 1218 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 85, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "FLOAT", + "type": "FLOAT", + "links": [ + 37 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 24, + "type": "CR SD1.5 Aspect Ratio", + "pos": [ + 1531.3667508544925, + 65.35200011825563 + ], + "size": { + "0": 210, + "1": 238 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "width", + "type": "INT", + "links": [ + 70 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "height", + "type": "INT", + "links": [ + 71 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "upscale_factor", + "type": "FLOAT", + "links": [ + 74 + ], + "shape": 3, + "slot_index": 2 + }, + { + "name": "batch_size", + "type": "INT", + "links": [ + 69 + ], + "shape": 3, + "slot_index": 3 + } + ], + "properties": { + "Node name for S&R": "CR SD1.5 Aspect Ratio" + }, + "widgets_values": [ + 512, + 512, + "2:3 portrait 512x768", + "Off", + 2, + 4 + ] + }, + { + "id": 34, + "type": "KSampler", + "pos": [ + 1047, + 1035 + ], + "size": { + "0": 210, + "1": 214 + }, + "flags": {}, + "order": 62, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 20 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 21 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 23 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 25 + }, + { + "name": "seed", + "type": "INT", + "link": 35, + "widget": { + "name": "seed", + "config": [ + "INT", + { + "default": 0, + "min": 0, + "max": 18446744073709552000 + } + ] + } + }, + { + "name": "steps", + "type": "INT", + "link": 36, + "widget": { + "name": "steps", + "config": [ + "INT", + { + "default": 20, + "min": 1, + "max": 10000 + } + ] + } + }, + { + "name": "cfg", + "type": "FLOAT", + "link": 37, + "widget": { + "name": "cfg", + "config": [ + "FLOAT", + { + "default": 8, + "min": 0, + "max": 100 + } + ] + } + }, + { + "name": "sampler_name", + "type": "euler,euler_ancestral,heun,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddim,uni_pc,uni_pc_bh2", + "link": 107, + "widget": { + "name": "sampler_name", + "config": [ + [ + "euler", + "euler_ancestral", + "heun", + "dpm_2", + "dpm_2_ancestral", + "lms", + "dpm_fast", + "dpm_adaptive", + "dpmpp_2s_ancestral", + "dpmpp_sde", + "dpmpp_sde_gpu", + "dpmpp_2m", + "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu", + "ddim", + "uni_pc", + "uni_pc_bh2" + ] + ] + } + }, + { + "name": "scheduler", + "type": "normal,karras,exponential,sgm_uniform,simple,ddim_uniform", + "link": 108, + "widget": { + "name": "scheduler", + "config": [ + [ + "normal", + "karras", + "exponential", + "sgm_uniform", + "simple", + "ddim_uniform" + ] + ] + } + }, + { + "name": "denoise", + "type": "FLOAT", + "link": 40, + "widget": { + "name": "denoise", + "config": [ + "FLOAT", + { + "default": 1, + "min": 0, + "max": 1, + "step": 0.01 + } + ] + } + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 29 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 993122994200947, + "randomize", + 20, + 8, + "euler", + "normal", + 1 + ] + }, + { + "id": 49, + "type": "Reroute", + "pos": [ + 842, + 1159 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 83, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 35 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 50, + "type": "Reroute", + "pos": [ + 843, + 1189 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 84, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 36 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 18, + "type": "SeargeFloatConstant", + "pos": [ + 1530, + 674 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 6, + "mode": 0, + "outputs": [ + { + "name": "value", + "type": "FLOAT", + "links": [ + 88 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "denoise", + "properties": { + "Node name for S&R": "SeargeFloatConstant" + }, + "widgets_values": [ + 1 + ] + }, + { + "id": 81, + "type": "Reroute", + "pos": [ + 25, + 1134 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 53, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 114 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 115 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 31, + "type": "Reroute", + "pos": [ + 24, + 1090 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 52, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 65 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 17, + 113 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 80, + "type": "Conditioning Input Switch", + "pos": [ + 432, + 1212 + ], + "size": { + "0": 228.39999389648438, + "1": 66 + }, + "flags": { + "collapsed": true + }, + "order": 56, + "mode": 0, + "inputs": [ + { + "name": "conditioning_a", + "type": "CONDITIONING", + "link": 111 + }, + { + "name": "conditioning_b", + "type": "CONDITIONING", + "link": 113 + }, + { + "name": "boolean_number", + "type": "NUMBER", + "link": 116 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 112 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "ControlNet Switch", + "properties": { + "Node name for S&R": "Conditioning Input Switch" + } + }, + { + "id": 73, + "type": "Reroute", + "pos": [ + 599, + 1106 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 55, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 115 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 61, + 80 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 27, + "type": "Reroute", + "pos": [ + 596, + 1059 + ], + "size": [ + 140.8, + 26 + ], + "flags": {}, + "order": 59, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 112 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 24, + 79 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 6, + "type": "Reroute", + "pos": [ + 653, + 295 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 120 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 66, + 78 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 1, + "type": "CheckpointLoaderSimple", + "pos": [ + 57, + 95 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 7, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 3 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 2 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [], + "shape": 3, + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "Basil_mix_fixed.safetensors" + ] + }, + { + "id": 2, + "type": "VAELoader", + "pos": [ + 57, + 246 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 8, + "mode": 0, + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 122 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAELoader" + }, + "widgets_values": [ + "vae-ft-mse-840000-ema-pruned.safetensors" + ] + }, + { + "id": 15, + "type": "SeargeIntegerConstant", + "pos": [ + 1530.3667508544925, + 346.35200011825555 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 9, + "mode": 0, + "outputs": [ + { + "name": "value", + "type": "INT", + "links": [ + 84 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "steps", + "properties": { + "Node name for S&R": "SeargeIntegerConstant" + }, + "widgets_values": [ + 25 + ] + }, + { + "id": 17, + "type": "SeargeFloatConstant", + "pos": [ + 1530.3667508544925, + 439.35200011825555 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 10, + "mode": 0, + "outputs": [ + { + "name": "value", + "type": "FLOAT", + "links": [ + 85, + 95 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "cfg", + "properties": { + "Node name for S&R": "SeargeFloatConstant" + }, + "widgets_values": [ + 7 + ] + }, + { + "id": 19, + "type": "Sampler Parameter", + "pos": [ + 1533.3667508544925, + 536.3520001182555 + ], + "size": { + "0": 210, + "1": 102 + }, + "flags": {}, + "order": 11, + "mode": 0, + "outputs": [ + { + "name": "sampler_name", + "type": [ + "euler", + "euler_ancestral", + "heun", + "dpm_2", + "dpm_2_ancestral", + "lms", + "dpm_fast", + "dpm_adaptive", + "dpmpp_2s_ancestral", + "dpmpp_sde", + "dpmpp_sde_gpu", + "dpmpp_2m", + "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu", + "ddim", + "uni_pc", + "uni_pc_bh2" + ], + "links": [ + 98, + 101, + 107, + 109 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "scheduler", + "type": [ + "normal", + "karras", + "exponential", + "sgm_uniform", + "simple", + "ddim_uniform" + ], + "links": [ + 87, + 97, + 108, + 110 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Sampler Parameter" + }, + "widgets_values": [ + "dpmpp_2m", + "karras" + ] + }, + { + "id": 11, + "type": "CLIPTextEncode", + "pos": [ + 949, + 85 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 49, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 9 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 65 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(8k:1.2), (best quality:1.2), (masterpiece:1.2),(ultra-detailed),(high quality:1.3),(high resolution),detailed hair,hard rim lighting,((dramatic lighting)),sharp focus,Tifa Lockhart looking at viewer, 1950s-inspired dress," + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 71, + "type": "SaveImage", + "pos": [ + 1781, + 1427 + ], + "size": { + "0": 573.6175537109375, + "1": 567.8753662109375 + }, + "flags": {}, + "order": 71, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 59 + } + ], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 85, + "type": "VAEEncodeForInpaint", + "pos": [ + -622, + 692 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": null + }, + { + "name": "vae", + "type": "VAE", + "link": null + }, + { + "name": "mask", + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "VAEEncodeForInpaint" + }, + "widgets_values": [ + 6 + ] + }, + { + "id": 9, + "type": "Reroute", + "pos": [ + 655, + 442 + ], + "size": [ + 132.39999999999998, + 26 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 124 + } + ], + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 81 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 10, + "type": "LoadImage", + "pos": [ + 949, + 581 + ], + "size": { + "0": 277.1925354003906, + "1": 314 + }, + "flags": {}, + "order": 13, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 82 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "title": "Pose", + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "ComfyUI_00108_-gigapixel-standard-scale-3_00x (1).png", + "image" + ] + }, + { + "id": 20, + "type": "SeargeIntegerConstant", + "pos": [ + 1905, + 80 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 14, + "mode": 0, + "outputs": [ + { + "name": "value", + "type": "INT", + "links": [ + 91 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "steps", + "properties": { + "Node name for S&R": "SeargeIntegerConstant" + }, + "widgets_values": [ + 1 + ] + }, + { + "id": 14, + "type": "CR Seed", + "pos": [ + 1529.3667508544925, + 769.3520001182555 + ], + "size": { + "0": 210, + "1": 82 + }, + "flags": {}, + "order": 15, + "mode": 0, + "outputs": [ + { + "name": "seed", + "type": "INT", + "links": [ + 83, + 92 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CR Seed" + }, + "widgets_values": [ + 879920621880078, + "randomize" + ] + }, + { + "id": 4, + "type": "LoraLoader", + "pos": [ + 504, + 77 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 3 + }, + { + "name": "clip", + "type": "CLIP", + "link": 2 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 120 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 121 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LoraLoader" + }, + "widgets_values": [ + "tifaV16noise.safetensors", + 0.7, + 0 + ] + }, + { + "id": 46, + "type": "PreviewImage", + "pos": [ + 1777, + 977 + ], + "size": { + "0": 310.28546142578125, + "1": 318.94134521484375 + }, + "flags": {}, + "order": 64, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 30 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + } + ], + "links": [ + [ + 2, + 1, + 1, + 4, + 1, + "CLIP" + ], + [ + 3, + 1, + 0, + 4, + 0, + "MODEL" + ], + [ + 9, + 7, + 0, + 11, + 0, + "CLIP" + ], + [ + 10, + 7, + 0, + 12, + 0, + "CLIP" + ], + [ + 11, + 23, + 0, + 26, + 0, + "*" + ], + [ + 14, + 28, + 0, + 23, + 0, + "INT" + ], + [ + 15, + 29, + 0, + 23, + 1, + "INT" + ], + [ + 16, + 30, + 0, + 23, + 2, + "INT" + ], + [ + 17, + 31, + 0, + 25, + 0, + "CONDITIONING" + ], + [ + 18, + 32, + 0, + 25, + 1, + "CONTROL_NET" + ], + [ + 19, + 33, + 0, + 25, + 2, + "IMAGE" + ], + [ + 20, + 35, + 0, + 34, + 0, + "MODEL" + ], + [ + 21, + 36, + 0, + 34, + 1, + "CONDITIONING" + ], + [ + 23, + 37, + 0, + 34, + 2, + "CONDITIONING" + ], + [ + 24, + 27, + 0, + 36, + 0, + "*" + ], + [ + 25, + 38, + 0, + 34, + 3, + "LATENT" + ], + [ + 26, + 26, + 0, + 38, + 0, + "*" + ], + [ + 28, + 45, + 0, + 44, + 1, + "VAE" + ], + [ + 29, + 34, + 0, + 44, + 0, + "LATENT" + ], + [ + 30, + 44, + 0, + 46, + 0, + "IMAGE" + ], + [ + 31, + 43, + 0, + 47, + 0, + "LATENT" + ], + [ + 32, + 41, + 0, + 40, + 0, + "IMAGE" + ], + [ + 33, + 40, + 0, + 42, + 0, + "IMAGE" + ], + [ + 34, + 42, + 0, + 43, + 3, + "LATENT" + ], + [ + 35, + 49, + 0, + 34, + 4, + "INT" + ], + [ + 36, + 50, + 0, + 34, + 5, + "INT" + ], + [ + 37, + 51, + 0, + 34, + 6, + "FLOAT" + ], + [ + 40, + 54, + 0, + 34, + 9, + "FLOAT" + ], + [ + 42, + 55, + 0, + 41, + 1, + "IMAGE" + ], + [ + 44, + 56, + 0, + 57, + 0, + "FLOAT" + ], + [ + 45, + 58, + 0, + 57, + 1, + "FLOAT" + ], + [ + 47, + 57, + 0, + 40, + 1, + "FLOAT" + ], + [ + 48, + 59, + 0, + 42, + 1, + "VAE" + ], + [ + 49, + 60, + 0, + 43, + 0, + "MODEL" + ], + [ + 50, + 61, + 0, + 43, + 1, + "CONDITIONING" + ], + [ + 51, + 62, + 0, + 43, + 2, + "CONDITIONING" + ], + [ + 52, + 63, + 0, + 43, + 4, + "INT" + ], + [ + 53, + 64, + 0, + 43, + 5, + "INT" + ], + [ + 54, + 65, + 0, + 43, + 6, + "FLOAT" + ], + [ + 57, + 68, + 0, + 43, + 9, + "FLOAT" + ], + [ + 58, + 59, + 0, + 47, + 1, + "VAE" + ], + [ + 59, + 47, + 0, + 71, + 0, + "IMAGE" + ], + [ + 60, + 72, + 0, + 41, + 0, + "UPSCALE_MODEL" + ], + [ + 61, + 73, + 0, + 37, + 0, + "*" + ], + [ + 65, + 11, + 0, + 31, + 0, + "*" + ], + [ + 66, + 6, + 0, + 35, + 0, + "*" + ], + [ + 67, + 74, + 0, + 75, + 0, + "*" + ], + [ + 68, + 8, + 0, + 45, + 0, + "*" + ], + [ + 69, + 24, + 3, + 28, + 0, + "*" + ], + [ + 70, + 24, + 0, + 29, + 0, + "*" + ], + [ + 71, + 24, + 1, + 30, + 0, + "*" + ], + [ + 74, + 24, + 2, + 56, + 0, + "*" + ], + [ + 75, + 75, + 0, + 72, + 0, + "*" + ], + [ + 76, + 44, + 0, + 55, + 0, + "*" + ], + [ + 77, + 8, + 0, + 59, + 0, + "*" + ], + [ + 78, + 6, + 0, + 60, + 0, + "*" + ], + [ + 79, + 27, + 0, + 61, + 0, + "*" + ], + [ + 80, + 73, + 0, + 62, + 0, + "*" + ], + [ + 81, + 9, + 0, + 32, + 0, + "*" + ], + [ + 82, + 10, + 0, + 33, + 0, + "*" + ], + [ + 83, + 14, + 0, + 49, + 0, + "*" + ], + [ + 84, + 15, + 0, + 50, + 0, + "*" + ], + [ + 85, + 17, + 0, + 51, + 0, + "*" + ], + [ + 87, + 19, + 1, + 53, + 0, + "*" + ], + [ + 88, + 18, + 0, + 54, + 0, + "*" + ], + [ + 91, + 20, + 0, + 64, + 0, + "*" + ], + [ + 92, + 14, + 0, + 63, + 0, + "*" + ], + [ + 95, + 17, + 0, + 65, + 0, + "*" + ], + [ + 97, + 19, + 1, + 67, + 0, + "*" + ], + [ + 98, + 19, + 0, + 66, + 0, + "*" + ], + [ + 101, + 19, + 0, + 52, + 0, + "*" + ], + [ + 106, + 22, + 0, + 68, + 0, + "*" + ], + [ + 107, + 19, + 0, + 34, + 7, + "euler,euler_ancestral,heun,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddim,uni_pc,uni_pc_bh2" + ], + [ + 108, + 19, + 1, + 34, + 8, + "normal,karras,exponential,sgm_uniform,simple,ddim_uniform" + ], + [ + 109, + 19, + 0, + 43, + 7, + "euler,euler_ancestral,heun,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddim,uni_pc,uni_pc_bh2" + ], + [ + 110, + 19, + 1, + 43, + 8, + "normal,karras,exponential,sgm_uniform,simple,ddim_uniform" + ], + [ + 111, + 25, + 0, + 80, + 0, + "CONDITIONING" + ], + [ + 112, + 80, + 0, + 27, + 0, + "*" + ], + [ + 113, + 31, + 0, + 80, + 1, + "CONDITIONING" + ], + [ + 114, + 12, + 0, + 81, + 0, + "*" + ], + [ + 115, + 81, + 0, + 73, + 0, + "*" + ], + [ + 116, + 82, + 0, + 80, + 2, + "NUMBER" + ], + [ + 117, + 83, + 0, + 82, + 0, + "*" + ], + [ + 120, + 4, + 0, + 6, + 0, + "*" + ], + [ + 121, + 4, + 1, + 7, + 0, + "*" + ], + [ + 122, + 2, + 0, + 8, + 0, + "*" + ], + [ + 124, + 3, + 0, + 9, + 0, + "*" + ] + ], + "groups": [ + { + "title": "Hires Fix", + "bounding": [ + 1, + 1379, + 1739, + 547 + ], + "color": "#3f789e" + }, + { + "title": "Load Models", + "bounding": [ + 0, + -2, + 849, + 720 + ], + "color": "#3f789e" + }, + { + "title": "Input", + "bounding": [ + 900, + 2, + 572, + 883 + ], + "color": "#3f789e" + }, + { + "title": "Generation Parameter", + "bounding": [ + 1516, + -6, + 297, + 883 + ], + "color": "#3f789e" + }, + { + "title": "Hires Fix Parameter", + "bounding": [ + 1873, + -4, + 277, + 276 + ], + "color": "#3f789e" + }, + { + "title": "Preprocess", + "bounding": [ + -1, + 903, + 768, + 464 + ], + "color": "#3f789e" + }, + { + "title": "Group", + "bounding": [ + 798, + 904, + 860, + 453 + ], + "color": "#3f789e" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/tmp.png b/tmp.png new file mode 100644 index 0000000000000000000000000000000000000000..8bff6bad7a6e363750b6d8eded913687e9862368 GIT binary patch literal 2700 zcmWlbYitu&7RUV@4p3{cMymbO5&S#8!sc3W*f)JWTPr6}xW zqarptICU!FPY<)KK*2W#e?z#fCMgG{7uEIXyVz&tt$LTG%EW{`1NPvVo216 z)SjK`Cc$UIMUQ9_W{emi!Lxi?%kQgz8u!J)LKs;%(NLAz3psSh3u`QcZ>*En5D zLY}$6)Ov6men7^@bg5o+64}vrvFLPXpU7*^J!aJg^4&6}9DDbaU;TV>-&v+qV!S3Z zUU-cGYriC1viBZ4Ic1dOw;@Xq%CX6rBsEg9_GMLSZ@VA*PimDX>xm*@>jq|>Tj#=8 zmCglW#+@l2>Etj;V(o|K*{@VDZYnR-4`C9^&hJ$7?j0AMF;2d0RHnuPU8<=|$>6sc zTD0om+r^Mp348ipu}EQ}jK_To5r8fgfVjLWX_aN9xez8l^$0T@hGF(QbwVsipJrB1 z7^AkkH?*Fwp8b-D%W-@*KgAmrEuLSLUGU8b+nx*PSUA`KL7p+=F1dCg)M<$(FB|Rm z+&gw;K4{Kxs>y!0yrp-4mcycHOF+6>e$Q7C&ksDdc}_EOB!Y_zqUUojRc?P5D&ILoEFf+!jkEj50j@}~r0(WN4 zd5h8Gp{G>kA*>*<;sQsC^nADKv3@qrs7PJIZZoX${<`~~EG$_GF%t9>SV3oi^>;YI zfL(p?IjVGdna_j5;Oq)#XZ>L#X1`0ZE8iV0LRmhjXu>ihAKfYo42{F{o0SYGLFLkCDfqs~1C!ygeouF5__APvL~G;rYn$A_)v zbQ3hDgx<-Nx1wVKxT+sT#yNF}_D(HbkES{0M&p2qC;R;V^&W+c*wCNTOa0O+B@vh( zhPkSufhe~EkDY7qc{XZtwtV+z*BM+Vzvy4VBl&&V6Sjn=-C* zBA@)OyiAAcRtq|~dwcF}7w(EgfGi`h#9MK5WG4-7|)QrH`glWF&MwFs#x-fGEmY}X2M z%GK@D>LM3KM(&a36Rjvx+6;qz=5(LAJ@Ql_YvRWw7dTN&JLrwRG48WeTUz7;LmE(?w8U;qA$UP25EU|F_&<~foO$p z8&Vl9q!5fr9BSf%D}wv7?oH~}fLb(h!icFoVKN}{#))gw87<7{Wbl%={hjyRbX+`B zS1q--@5J#yRy@O$9_V%WD(**G8xJ;9e(BLqH;gdsBrtU}cSu3i4|fFVu|x19r`U&e z)Mpncsg}2#tbcXC2_|iNCb|Zz5V-BiF-NLnoEeNp5Y1Zg6AoMU_SkDGED^1~0--@~ zMh#4A#}v*l_TW}&i}qkN?XxckG2`f&^i-fqA_|f>w#52a7@p>hqs2pg;hYE1;`eI+ zCx%Ko;-Tq2W#HV5F}h4)slDs{{+$sSh!e3~;__N1-;FhoFHBL2RiWTtA5WGO z4fkbGdYYm2hfOkg*fc10?Q{usYb1hRm=6*$iyb5EF@7wQ0lGWGZB0|n#fp0q3y?2M z=|Z(t#eF8d#(jhDs;W(Aa1sY{N0xN5E6`2L$LmuD^X1;HvS|J31Xl$y`-C<+CsRKR z(LjwL1*T=(42{05Xq^$qXN=jNXrL?1YYS8?SsoiA5Y!esy9ei4)dX2PcCwkBOv&<` zvzgjPD4P{dOlt;SU|a{=*WDQ{L=aoV+{B!dh~=h8)Xjbz?PJ%$MqC~XGtg}wYZIn& z%Z9>uc$qAS!}E8M!M!-B{$`ZmIxNWGPpPkoyVTtq(-tD8{g#-m$xW?ZDM6TNg9&E= z68Mjmx9YsJtsPH! zu(RQ1x4AmN{*sUrpm2|j3o#3(xUKfK;n(pLK#cNU!138~o2R1y9G&$2D|?G!9bhAa zCU_j+A zD%$9b}GfWW@-j0eB9rW>Iq)QSD?KW>G5-9Zethsj{Uv+nhQN#9Y2 z8OK$y%W)~+&B|2l=JaYMlwN*0V$;NY)G|x8(2!q3qn+7&WO62mddC-B;>WG+>gVIU zHbm=XBseu=`eJEuDwha}mTiPxQhSIN9Zpy 2: + mask = mask.squeeze(0) + mask_np = mask.cpu().numpy().astype('uint8') + mask_pil = Image.fromarray(mask_np, mode="L") + return mask_pil + +# Tensor to cv2 +def tensor2cv(image): + image_np = np.clip(255. * image.cpu().numpy().squeeze(), 0, 255).astype(np.uint8) + return cv2.cvtColor(image_np, cv2.COLOR_RGB2BGR) + +# cv2 to Tensor +def cv2tensor(image): + image_np = cv2.cvtColor(image, cv2.COLOR_BGR2RGB).astype(np.float32) / 255.0 + return torch.from_numpy(image_np).unsqueeze(0) + +def hex2rgb(hex_color: str): + hex_color = hex_color.lstrip('#') + return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) + +def hex2bgr(hex_color): + return hex2rgb(hex_color)[::-1] diff --git a/workflows/CharacterFaceSwap.json b/workflows/CharacterFaceSwap.json new file mode 100644 index 0000000..ec85bc5 --- /dev/null +++ b/workflows/CharacterFaceSwap.json @@ -0,0 +1,2205 @@ +{ + "last_node_id": 146, + "last_link_id": 281, + "nodes": [ + { + "id": 17, + "type": "ControlNetLoader", + "pos": [ + 572.8117089386652, + 356.3931525657243 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 64 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ControlNetLoader" + }, + "widgets_values": [ + "control_v11e_sd15_ip2p.pth" + ] + }, + { + "id": 6, + "type": "Load BiseNet", + "pos": [ + 916.8117089386649, + 213.39315256572414 + ], + "size": { + "0": 140, + "1": 26 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "BISENET", + "type": "BISENET", + "links": [ + 101 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Load BiseNet" + } + }, + { + "id": 3, + "type": "Load RetinaFace", + "pos": [ + 922.8117089386647, + 286.3931525657243 + ], + "size": { + "0": 140, + "1": 26 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "RETINAFACE", + "links": [ + 8 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Load RetinaFace" + } + }, + { + "id": 38, + "type": "UpscaleModelLoader", + "pos": [ + 918.8117089386648, + 363.3931525657243 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "UPSCALE_MODEL", + "type": "UPSCALE_MODEL", + "links": [ + 77 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "UpscaleModelLoader" + }, + "widgets_values": [ + "4x_NMKD-Siax_200k.pth" + ] + }, + { + "id": 85, + "type": "LoadImage", + "pos": [ + 1199.384685412501, + 406.99999999999994 + ], + "size": { + "0": 315, + "1": 314 + }, + "flags": {}, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 176 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "tifa_face_512.png", + "image" + ] + }, + { + "id": 34, + "type": "ImageUpscaleWithModel", + "pos": [ + 594.6153946961425, + 1550.7188663515597 + ], + "size": { + "0": 241.79998779296875, + "1": 46 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "upscale_model", + "type": "UPSCALE_MODEL", + "link": 77 + }, + { + "name": "image", + "type": "IMAGE", + "link": 76 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 75 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageUpscaleWithModel" + } + }, + { + "id": 24, + "type": "LoraLoader", + "pos": [ + 581.8117089386652, + 565.3931525657242 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 33 + }, + { + "name": "clip", + "type": "CLIP", + "link": 32 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 34 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 35, + 36 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LoraLoader" + }, + "widgets_values": [ + "tifaV16noise.safetensors", + 0.7, + 0 + ] + }, + { + "id": 95, + "type": "PreviewImage", + "pos": [ + 1503, + 928 + ], + "size": { + "0": 210, + "1": 246 + }, + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 198 + } + ], + "title": "Face Mask", + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 22, + "type": "CheckpointLoaderSimple", + "pos": [ + 568.8117089386652, + 217.39315256572414 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 33 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 32 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "Basil_mix_fixed.safetensors" + ] + }, + { + "id": 10, + "type": "Crop Face", + "pos": [ + 572, + 1322 + ], + "size": { + "0": 315, + "1": 146 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "RETINAFACE", + "link": 8 + }, + { + "name": "image", + "type": "IMAGE", + "link": 109 + } + ], + "outputs": [ + { + "name": "face_image", + "type": "IMAGE", + "links": [ + 76 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "preview", + "type": "IMAGE", + "links": [ + 217 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "bbox", + "type": "BBOX", + "links": [ + 12 + ], + "shape": 3, + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "Crop Face" + }, + "widgets_values": [ + 0.9, + 32 + ] + }, + { + "id": 31, + "type": "ControlNetApplyAdvanced", + "pos": [ + 1996, + 362 + ], + "size": { + "0": 315, + "1": 166 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "link": 62 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 63 + }, + { + "name": "control_net", + "type": "CONTROL_NET", + "link": 64 + }, + { + "name": "image", + "type": "IMAGE", + "link": 176 + } + ], + "outputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "links": [ + 181 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "negative", + "type": "CONDITIONING", + "links": [ + 200 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "ControlNetApplyAdvanced" + }, + "widgets_values": [ + 0.8, + 0, + 1 + ] + }, + { + "id": 21, + "type": "VAEEncode", + "pos": [ + 1111, + 1340 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 193 + }, + { + "name": "vae", + "type": "VAE", + "link": 31 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 73 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncode" + } + }, + { + "id": 19, + "type": "KSampler", + "pos": [ + 1120, + 1435 + ], + "size": { + "0": 210, + "1": 214 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 34 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 181 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 200 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 73 + }, + { + "name": "seed", + "type": "INT", + "link": 208, + "widget": { + "name": "seed", + "config": [ + "INT", + { + "default": 0, + "min": 0, + "max": 18446744073709552000 + } + ] + } + }, + { + "name": "steps", + "type": "INT", + "link": 211, + "widget": { + "name": "steps", + "config": [ + "INT", + { + "default": 20, + "min": 1, + "max": 10000 + } + ] + } + }, + { + "name": "cfg", + "type": "FLOAT", + "link": 212, + "widget": { + "name": "cfg", + "config": [ + "FLOAT", + { + "default": 8, + "min": 0, + "max": 100 + } + ] + } + }, + { + "name": "sampler_name", + "type": "euler,euler_ancestral,heun,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddim,uni_pc,uni_pc_bh2", + "link": 213, + "widget": { + "name": "sampler_name", + "config": [ + [ + "euler", + "euler_ancestral", + "heun", + "dpm_2", + "dpm_2_ancestral", + "lms", + "dpm_fast", + "dpm_adaptive", + "dpmpp_2s_ancestral", + "dpmpp_sde", + "dpmpp_sde_gpu", + "dpmpp_2m", + "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu", + "ddim", + "uni_pc", + "uni_pc_bh2" + ] + ] + } + }, + { + "name": "scheduler", + "type": "normal,karras,exponential,sgm_uniform,simple,ddim_uniform", + "link": 214, + "widget": { + "name": "scheduler", + "config": [ + [ + "normal", + "karras", + "exponential", + "sgm_uniform", + "simple", + "ddim_uniform" + ] + ] + } + }, + { + "name": "denoise", + "type": "FLOAT", + "link": 215, + "widget": { + "name": "denoise", + "config": [ + "FLOAT", + { + "default": 1, + "min": 0, + "max": 1, + "step": 0.01 + } + ] + } + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 97 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 683859177883589, + "randomize", + 25, + 7, + "dpmpp_2m", + "karras", + 0.4 + ] + }, + { + "id": 25, + "type": "VAEDecode", + "pos": [ + 1109, + 1697 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 97 + }, + { + "name": "vae", + "type": "VAE", + "link": 39 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 100, + 197 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 94, + "type": "PreviewImage", + "pos": [ + 1096, + 915 + ], + "size": { + "0": 210, + "1": 246 + }, + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 197 + } + ], + "title": "New Face", + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 48, + "type": "Segment Face", + "pos": [ + 1509.615394696142, + 1353.7188663515597 + ], + "size": { + "0": 315, + "1": 126 + }, + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "BISENET", + "link": 101 + }, + { + "name": "image", + "type": "IMAGE", + "link": 100 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 198, + 203 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "mask", + "type": "MASK", + "links": [ + 202, + 226 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "Segment Face" + }, + "widgets_values": [ + 0, + "disable", + "disable" + ] + }, + { + "id": 107, + "type": "Generation Parameter Input", + "pos": [ + 1995, + 54 + ], + "size": { + "0": 315, + "1": 250 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "parameters", + "type": "PARAMETERS", + "link": null + } + ], + "outputs": [ + { + "name": "parameters", + "type": "PARAMETERS", + "links": [ + 216 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Generation Parameter Input" + }, + "widgets_values": [ + 476047519987827, + "fixed", + 512, + 512, + 25, + 7, + "dpmpp_2m", + "karras", + 0.4 + ] + }, + { + "id": 18, + "type": "CLIPTextEncode", + "pos": [ + 1530, + 60 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 35 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 62 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(8k:1.2), (best quality:1.2), (masterpiece:1.2),(ultra-detailed),(high quality:1.3),(high resolution), tifa lockhart, girl looking at camera, face only" + ] + }, + { + "id": 20, + "type": "CLIPTextEncode", + "pos": [ + 1540, + 320 + ], + "size": { + "0": 397.4999694824219, + "1": 183.81710815429688 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 36 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 63 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(worst quality, low quality:1.4),(worst quality, low quality, normal quality:1.4),(long shot, bad_prompt:0.8),(blurry:1.3),(Low_resolution:1.3),(Low_picture_quality:1.3),lowres,low resolution,bad anatomy,low quality anatomy,bad hands,bad nails,bad legs,bad fingers,bad toes,tiptoes,extra digit,extar hands,extra fingers,extra arms,extra legs,fewer digit,lowres low quality face,lowres low quality eyes,cropped hands,cropped legs,cropped arms,cropped fingers,fused fingers,too many fingers,missing fingers,ugly,text,bad anatomy,(more than two arm per body:1.5),(more than two leg per body:1.4),(more than five fingers on one hand:1.4),multi arms,multi legs,bad arm anatomy,bad leg anatomy,bad hand anatomy,bad finger anatomy,bad detailed background,unclear architectural outline,non-linear background,hair crosses the screen border,obesity,worst quality,low quality,blurry,mutated hands and fingers,disfigured,fused,cloned,duplicate,missing_body,(missing_face:1.4),(missing_eyes:1.4),missing_chest,missing_nipples,missing_hips,missing_arms,missing_hands,missing_fingers,missing_legs,missing_feet,missing_toe,embedding:easynegative, embedding:FastNegativeV2, embedding:fcNeg-neg, embedding:ng_deepnegative_v1_75t" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 23, + "type": "VAELoader", + "pos": [ + 584, + 465 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 7, + "mode": 0, + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 31, + 39 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAELoader" + }, + "widgets_values": [ + "vae-ft-mse-840000-ema-pruned.safetensors" + ] + }, + { + "id": 104, + "type": "Uncrop Face", + "pos": [ + 1951, + 1365 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 220 + }, + { + "name": "bbox", + "type": "BBOX", + "link": 206 + }, + { + "name": "face", + "type": "IMAGE", + "link": 203 + }, + { + "name": "mask", + "type": "MASK", + "link": 202 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 207 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Uncrop Face" + } + }, + { + "id": 105, + "type": "Image Full BBox", + "pos": [ + 1593, + 1539 + ], + "size": { + "0": 210, + "1": 26 + }, + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 219 + } + ], + "outputs": [ + { + "name": "BBOX", + "type": "BBOX", + "links": [ + 206, + 227 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Image Full BBox" + } + }, + { + "id": 116, + "type": "Mask Contour", + "pos": [ + 1954, + 1541 + ], + "size": { + "0": 210, + "1": 66 + }, + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 226 + }, + { + "name": "image", + "type": "IMAGE", + "link": 228 + }, + { + "name": "bbox", + "type": "BBOX", + "link": 227 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 257 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Mask Contour" + } + }, + { + "id": 143, + "type": "MaskToImage", + "pos": [ + 1956, + 1780 + ], + "size": { + "0": 210, + "1": 26 + }, + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 278 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 277 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "MaskToImage" + } + }, + { + "id": 130, + "type": "GrowMask", + "pos": [ + 1953, + 1654 + ], + "size": [ + 210, + 82 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 257 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 278 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "GrowMask" + }, + "widgets_values": [ + 10, + true + ] + }, + { + "id": 11, + "type": "Uncrop Face", + "pos": [ + 3010, + 1363 + ], + "size": { + "0": 140, + "1": 86 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 158 + }, + { + "name": "bbox", + "type": "BBOX", + "link": 12 + }, + { + "name": "face", + "type": "IMAGE", + "link": 279 + }, + { + "name": "mask", + "type": "MASK", + "link": 254 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 199 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Uncrop Face" + } + }, + { + "id": 96, + "type": "PreviewImage", + "pos": [ + 2989, + 911 + ], + "size": { + "0": 210, + "1": 246 + }, + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 199 + } + ], + "title": "Face Swapped", + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 145, + "type": "Note", + "pos": [ + 2490.7638039631393, + 1395.6206211489516 + ], + "size": [ + 261.0976143975736, + 202.41350755188182 + ], + "flags": {}, + "order": 8, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "ComfyUI currently have issue about inpainting models, check https://github.com/comfyanonymous/ComfyUI/issues/1186. Seamless inpainting is performed at webui. Use \"face with seam\" and \"seam mask\" to inpaint in webui. Then upload seamless face above." + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 37, + "type": "ImageScale", + "pos": [ + 593, + 1663 + ], + "size": { + "0": 315, + "1": 130 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 75 + }, + { + "name": "width", + "type": "INT", + "link": 209, + "widget": { + "name": "width", + "config": [ + "INT", + { + "default": 512, + "min": 1, + "max": 8192, + "step": 1 + } + ] + } + }, + { + "name": "height", + "type": "INT", + "link": 210, + "widget": { + "name": "height", + "config": [ + "INT", + { + "default": 512, + "min": 1, + "max": 8192, + "step": 1 + } + ] + } + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 193, + 219, + 220, + 228 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageScale" + }, + "widgets_values": [ + "bilinear", + 512, + 512, + "disabled" + ] + }, + { + "id": 108, + "type": "Generation Parameter Output", + "pos": [ + 95, + 1360 + ], + "size": { + "0": 226.8000030517578, + "1": 186 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "parameters", + "type": "PARAMETERS", + "link": 216 + } + ], + "outputs": [ + { + "name": "parameters", + "type": "PARAMETERS", + "links": null, + "shape": 3 + }, + { + "name": "seed", + "type": "INT", + "links": [ + 208 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "image_width", + "type": "INT", + "links": [ + 209, + 280 + ], + "shape": 3, + "slot_index": 2 + }, + { + "name": "image_height", + "type": "INT", + "links": [ + 210, + 281 + ], + "shape": 3, + "slot_index": 3 + }, + { + "name": "steps", + "type": "INT", + "links": [ + 211 + ], + "shape": 3, + "slot_index": 4 + }, + { + "name": "cfg", + "type": "FLOAT", + "links": [ + 212 + ], + "shape": 3, + "slot_index": 5 + }, + { + "name": "sampler_name", + "type": [ + "euler", + "euler_ancestral", + "heun", + "dpm_2", + "dpm_2_ancestral", + "lms", + "dpm_fast", + "dpm_adaptive", + "dpmpp_2s_ancestral", + "dpmpp_sde", + "dpmpp_sde_gpu", + "dpmpp_2m", + "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu", + "ddim", + "uni_pc", + "uni_pc_bh2" + ], + "links": [ + 213 + ], + "shape": 3, + "slot_index": 6 + }, + { + "name": "scheduler", + "type": [ + "normal", + "karras", + "exponential", + "sgm_uniform", + "simple", + "ddim_uniform" + ], + "links": [ + 214 + ], + "shape": 3, + "slot_index": 7 + }, + { + "name": "denoise", + "type": "FLOAT", + "links": [ + 215 + ], + "shape": 3, + "slot_index": 8 + } + ], + "properties": { + "Node name for S&R": "Generation Parameter Output" + } + }, + { + "id": 128, + "type": "SolidMask", + "pos": [ + 2520, + 1682 + ], + "size": [ + 232.63686787419192, + 106 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "width", + "type": "INT", + "link": 280, + "widget": { + "name": "width", + "config": [ + "INT", + { + "default": 512, + "min": 1, + "max": 8192, + "step": 1 + } + ] + } + }, + { + "name": "height", + "type": "INT", + "link": 281, + "widget": { + "name": "height", + "config": [ + "INT", + { + "default": 512, + "min": 1, + "max": 8192, + "step": 1 + } + ] + } + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 254 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SolidMask" + }, + "widgets_values": [ + 1, + 512, + 512 + ] + }, + { + "id": 146, + "type": "LoadImage", + "pos": [ + 2489, + 914 + ], + "size": [ + 251.39469564384217, + 314 + ], + "flags": {}, + "order": 9, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 279 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "title": "Seamless Face", + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "00022-3145992520.png", + "image" + ] + }, + { + "id": 106, + "type": "PreviewImage", + "pos": [ + 1924, + 934 + ], + "size": { + "0": 210, + "1": 246 + }, + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 207 + } + ], + "title": "Face with Seam", + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 144, + "type": "PreviewImage", + "pos": [ + 2170, + 930 + ], + "size": [ + 210, + 246 + ], + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 277 + } + ], + "title": "Seam Mask", + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 4, + "type": "LoadImage", + "pos": [ + 1190, + 49 + ], + "size": { + "0": 315, + "1": 314 + }, + "flags": {}, + "order": 10, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 109, + 158 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "ComfyUI_00455_.png", + "image" + ] + }, + { + "id": 109, + "type": "PreviewImage", + "pos": [ + 649, + 916 + ], + "size": { + "0": 210, + "1": 246 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 217 + } + ], + "title": "Face Detection", + "properties": { + "Node name for S&R": "PreviewImage" + } + } + ], + "links": [ + [ + 8, + 3, + 0, + 10, + 0, + "RETINAFACE" + ], + [ + 12, + 10, + 2, + 11, + 1, + "BBOX" + ], + [ + 31, + 23, + 0, + 21, + 1, + "VAE" + ], + [ + 32, + 22, + 1, + 24, + 1, + "CLIP" + ], + [ + 33, + 22, + 0, + 24, + 0, + "MODEL" + ], + [ + 34, + 24, + 0, + 19, + 0, + "MODEL" + ], + [ + 35, + 24, + 1, + 18, + 0, + "CLIP" + ], + [ + 36, + 24, + 1, + 20, + 0, + "CLIP" + ], + [ + 39, + 23, + 0, + 25, + 1, + "VAE" + ], + [ + 62, + 18, + 0, + 31, + 0, + "CONDITIONING" + ], + [ + 63, + 20, + 0, + 31, + 1, + "CONDITIONING" + ], + [ + 64, + 17, + 0, + 31, + 2, + "CONTROL_NET" + ], + [ + 73, + 21, + 0, + 19, + 3, + "LATENT" + ], + [ + 75, + 34, + 0, + 37, + 0, + "IMAGE" + ], + [ + 76, + 10, + 0, + 34, + 1, + "IMAGE" + ], + [ + 77, + 38, + 0, + 34, + 0, + "UPSCALE_MODEL" + ], + [ + 97, + 19, + 0, + 25, + 0, + "LATENT" + ], + [ + 100, + 25, + 0, + 48, + 1, + "IMAGE" + ], + [ + 101, + 6, + 0, + 48, + 0, + "BISENET" + ], + [ + 109, + 4, + 0, + 10, + 1, + "IMAGE" + ], + [ + 158, + 4, + 0, + 11, + 0, + "IMAGE" + ], + [ + 176, + 85, + 0, + 31, + 3, + "IMAGE" + ], + [ + 181, + 31, + 0, + 19, + 1, + "CONDITIONING" + ], + [ + 193, + 37, + 0, + 21, + 0, + "IMAGE" + ], + [ + 197, + 25, + 0, + 94, + 0, + "IMAGE" + ], + [ + 198, + 48, + 0, + 95, + 0, + "IMAGE" + ], + [ + 199, + 11, + 0, + 96, + 0, + "IMAGE" + ], + [ + 200, + 31, + 1, + 19, + 2, + "CONDITIONING" + ], + [ + 202, + 48, + 1, + 104, + 3, + "MASK" + ], + [ + 203, + 48, + 0, + 104, + 2, + "IMAGE" + ], + [ + 206, + 105, + 0, + 104, + 1, + "BBOX" + ], + [ + 207, + 104, + 0, + 106, + 0, + "IMAGE" + ], + [ + 208, + 108, + 1, + 19, + 4, + "INT" + ], + [ + 209, + 108, + 2, + 37, + 1, + "INT" + ], + [ + 210, + 108, + 3, + 37, + 2, + "INT" + ], + [ + 211, + 108, + 4, + 19, + 5, + "INT" + ], + [ + 212, + 108, + 5, + 19, + 6, + "FLOAT" + ], + [ + 213, + 108, + 6, + 19, + 7, + "euler,euler_ancestral,heun,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddim,uni_pc,uni_pc_bh2" + ], + [ + 214, + 108, + 7, + 19, + 8, + "normal,karras,exponential,sgm_uniform,simple,ddim_uniform" + ], + [ + 215, + 108, + 8, + 19, + 9, + "FLOAT" + ], + [ + 216, + 107, + 0, + 108, + 0, + "PARAMETERS" + ], + [ + 217, + 10, + 1, + 109, + 0, + "IMAGE" + ], + [ + 219, + 37, + 0, + 105, + 0, + "IMAGE" + ], + [ + 220, + 37, + 0, + 104, + 0, + "IMAGE" + ], + [ + 226, + 48, + 1, + 116, + 0, + "MASK" + ], + [ + 227, + 105, + 0, + 116, + 2, + "BBOX" + ], + [ + 228, + 37, + 0, + 116, + 1, + "IMAGE" + ], + [ + 254, + 128, + 0, + 11, + 3, + "MASK" + ], + [ + 257, + 116, + 0, + 130, + 0, + "MASK" + ], + [ + 277, + 143, + 0, + 144, + 0, + "IMAGE" + ], + [ + 278, + 130, + 0, + 143, + 0, + "MASK" + ], + [ + 279, + 146, + 0, + 11, + 2, + "IMAGE" + ], + [ + 280, + 108, + 2, + 128, + 0, + "INT" + ], + [ + 281, + 108, + 3, + 128, + 1, + "INT" + ] + ], + "groups": [ + { + "title": "Process", + "bounding": [ + 45, + 1274, + 3217, + 600 + ], + "color": "#3f789e" + }, + { + "title": "Preview", + "bounding": [ + 557, + 836, + 2701, + 398 + ], + "color": "#3f789e" + }, + { + "title": "Model", + "bounding": [ + 554, + 117, + 598, + 600 + ], + "color": "#3f789e" + }, + { + "title": "Input", + "bounding": [ + 1179, + -33, + 1143, + 775 + ], + "color": "#3f789e" + }, + { + "title": "Group", + "bounding": [ + 2479, + 1318, + 301, + 530 + ], + "color": "#b58b2a" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file