diff --git a/README.md b/README.md index 40e19ab..9c49083 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ * Unlike in face detection, for non-rigid objects, the center point may not always be the segmentation area, so be careful not to assume that the center point is always the segmentation area. +# Others Tutorials +* [ONNX Tutorial](tutorial/ONNX.md) + # Credits diff --git a/comfyui-impact-pack.py b/comfyui-impact-pack.py index 6771bd2..46b79c3 100644 --- a/comfyui-impact-pack.py +++ b/comfyui-impact-pack.py @@ -399,13 +399,12 @@ def scale_tensor_and_to_pil(w,h, image): return image.resize((w,h), resample=LANCZOS) -def enhance_detail(image, model, vae, guide_size, bbox, seed, steps, cfg, sampler_name, scheduler, +def enhance_detail(image, model, vae, guide_size, guide_size_for, bbox, seed, steps, cfg, sampler_name, scheduler, positive, negative, denoise, noise_mask): h = image.shape[1] w = image.shape[2] - bbox_h = bbox[3]-bbox[1] bbox_w = bbox[2]-bbox[0] @@ -414,15 +413,19 @@ def enhance_detail(image, model, vae, guide_size, bbox, seed, steps, cfg, sample print(f"Detailer: segment skip") None - # Scale up based on the smaller dimension between width and height. - upscale = guide_size/min(bbox_w,bbox_h) + if guide_size_for == "bbox": + # Scale up based on the smaller dimension between width and height. + upscale = guide_size/min(bbox_w,bbox_h) + else: + # for cropped_size + upscale = guide_size/min(w,h) new_w = int(((w * upscale)//64) * 64) new_h = int(((h * upscale)//64) * 64) - if upscale < 1.0: + if upscale <= 1.0: print(f"Detailer: segment skip") - None + return None print(f"Detailer: segment upscale for ({bbox_w,bbox_h}) | crop region {w,h} x {upscale} -> {new_w,new_h}") @@ -472,6 +475,34 @@ def composite_to(dest_latent, crop_region, src_latent): return orig_image[0] +def onnx_inference(image, onnx_model): + # prepare image + pil = tensor2pil(image) + image = np.ascontiguousarray(pil) + image = image[:, :, ::-1] # to BGR image + image = image.astype(np.float32) + image -= [103.939, 116.779, 123.68] # 'caffe' mode image preprocessing + + # do detection + onnx_model = onnxruntime.InferenceSession(onnx_model) + outputs = onnx_model.run( + [s_i.name for s_i in onnx_model.get_outputs()], + {onnx_model.get_inputs()[0].name: np.expand_dims(image, axis=0)}, + ) + + labels = [op for op in outputs if op.dtype == "int32"][0] + scores = [op for op in outputs if isinstance(op[0][0], np.float32)][0] + boxes = [op for op in outputs if isinstance(op[0][0], np.ndarray)][0] + + # filter-out useless item + idx = np.where(labels[0] == -1)[0][0] + + labels = labels[0][:idx] + scores = scores[0][:idx] + boxes = boxes[0][:idx].astype(np.uint32) + + return labels, scores, boxes + class MMDetLoader: @classmethod @@ -539,6 +570,7 @@ class ONNXDetectorForEach: "onnx_model": ("ONNX_MODEL",), "image": ("IMAGE",), "threshold": ("FLOAT", {"default": 0.8, "min": 0.0, "max": 1.0, "step": 0.01}), + "crop_factor": ("FLOAT", {"default": 1.0, "min": 0.5, "max": 10, "step": 0.1}), } } @@ -549,41 +581,30 @@ class ONNXDetectorForEach: OUTPUT_NODE = True - def doit(self, onnx_model, image, threshold): - # prepare image - pil = tensor2pil(image) - image = np.ascontiguousarray(pil) - image = image[:, :, ::-1] # to BGR image - image = image.astype(np.float32) - image -= [103.939, 116.779, 123.68] # 'caffe' mode image preprocessing + def doit(self, onnx_model, image, threshold, crop_factor): + h = image.shape[1] + w = image.shape[2] - # do detection - onnx_model = onnxruntime.InferenceSession(onnx_model) - outputs = onnx_model.run( - [s_i.name for s_i in onnx_model.get_outputs()], - {onnx_model.get_inputs()[0].name: np.expand_dims(image, axis=0)}, - ) - - labels = [op for op in outputs if op.dtype == "int32"][0] - scores = [op for op in outputs if isinstance(op[0][0], np.float32)][0] - boxes = [op for op in outputs if isinstance(op[0][0], np.ndarray)][0] - - # filter-out useless item - idx = np.where(labels[0] == -1)[0][0] - - labels = labels[0][:idx] - scores = scores[0][:idx] - boxes = boxes[0][:idx].astype(np.uint32) + labels, scores, boxes = onnx_inference(image, onnx_model) # collect feasible item result = [] for i in range(len(labels)): if scores[i] > threshold: - x1, y1, x2, y2 = boxes[i] + item_bbox = boxes[i] + x1, y1, x2, y2 = item_bbox - mask = np.ones((y2-y1,x2-x1)) - item = (None, mask, scores[i], boxes[i], boxes[i]) + crop_region = make_crop_region(w, h, item_bbox, crop_factor) + crop_x1, crop_y1, crop_x2, crop_y2, = crop_region + + # prepare cropped mask + cropped_mask = np.zeros((crop_y2-crop_y1,crop_x2-crop_x1)) + inner_mask = np.ones((y2-y1,x2-x1)) + cropped_mask[y1-crop_y1:y2-crop_y1, x1-crop_x1:x2-crop_x1] = inner_mask + + # make items + item = (None, cropped_mask, scores[i], crop_region, item_bbox) result.append(item) return (result,) @@ -598,6 +619,7 @@ class DetailerForEach: "model": ("MODEL",), "vae": ("VAE",), "guide_size": ("FLOAT", {"default": 256, "min": 128, "max": nodes.MAX_RESOLUTION, "step": 64}), + "guide_size_for": (["bbox", "crop_region"],), "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}), "steps": ("INT", {"default": 20, "min": 1, "max": 10000}), "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}), @@ -607,7 +629,7 @@ class DetailerForEach: "negative": ("CONDITIONING",), "denoise": ("FLOAT", {"default": 0.5, "min": 0.0001, "max": 1.0, "step": 0.01}), "feather": ("INT", {"default": 5, "min": 0, "max": 100, "step": 1}), - "noise_mask": (["enabled", "disabled"], ) + "noise_mask": (["enabled", "disabled"], ), }, "optional": { "external_seed": ("SEED", ), } } @@ -617,7 +639,7 @@ class DetailerForEach: CATEGORY = "ImpactPack" - def do_detail(self, image, segs, model, vae, guide_size, seed, steps, cfg, sampler_name, scheduler, + def do_detail(self, image, segs, model, vae, guide_size, guide_size_for, seed, steps, cfg, sampler_name, scheduler, positive, negative, denoise, feather, noise_mask, external_seed=None): if external_seed is not None: @@ -638,7 +660,7 @@ class DetailerForEach: else: cropped_mask = None - enhanced_pil = enhance_detail(cropped_image, model, vae, guide_size, bbox, + enhanced_pil = enhance_detail(cropped_image, model, vae, guide_size, guide_size_for, bbox, seed, steps, cfg, sampler_name, scheduler, positive, negative, denoise, cropped_mask) @@ -650,15 +672,16 @@ class DetailerForEach: image_tensor = pil2tensor(image_pil.convert('RGB')) if len(segs) > 0: - return image_tensor, torch.from_numpy(cropped_image), pil2tensor(enhanced_pil), + enhanced_tensor = pil2tensor(enhanced_pil) if not (enhanced_pil is None) else None + return image_tensor, torch.from_numpy(cropped_image), enhanced_tensor, else: return image_tensor, None, None, - def doit(self, image, segs, model, vae, guide_size, seed, steps, cfg, sampler_name, scheduler, + def doit(self, image, segs, model, vae, guide_size, guide_size_for, seed, steps, cfg, sampler_name, scheduler, positive, negative, denoise, feather, noise_mask, external_seed=None): enhanced_img, cropped, cropped_enhanced = \ - self.do_detail(image, segs, model, vae, guide_size, seed, steps, cfg, sampler_name, scheduler, + self.do_detail(image, segs, model, vae, guide_size, guide_size_for, seed, steps, cfg, sampler_name, scheduler, positive, negative, denoise, feather, noise_mask, external_seed) return (enhanced_img, ) @@ -670,11 +693,11 @@ class DetailerForEachTest(DetailerForEach): CATEGORY = "ImpactPack" - def doit(self, image, segs, model, vae, guide_size, seed, steps, cfg, sampler_name, scheduler, + def doit(self, image, segs, model, vae, guide_size, guide_size_for, seed, steps, cfg, sampler_name, scheduler, positive, negative, denoise, feather, noise_mask, external_seed=None): enhanced_img, cropped, cropped_enhanced = \ - self.do_detail(image, segs, model, vae, guide_size, seed, steps, cfg, sampler_name, scheduler, + self.do_detail(image, segs, model, vae, guide_size, guide_size_for, seed, steps, cfg, sampler_name, scheduler, positive, negative, denoise, feather, noise_mask, external_seed) if cropped is None: @@ -823,7 +846,7 @@ class BboxDetectorForEach: "image": ("IMAGE", ), "threshold": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01}), "dilation": ("INT", {"default": 10, "min": 0, "max": 255, "step": 1}), - "crop_factor": ("FLOAT", {"default": 3.0, "min": 1.5, "max": 10, "step": 1}), + "crop_factor": ("FLOAT", {"default": 3.0, "min": 1.5, "max": 10, "step": 0.1}), } } @@ -866,7 +889,7 @@ class SegmDetectorForEach: "image": ("IMAGE", ), "threshold": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01}), "dilation": ("INT", {"default": 10, "min": 0, "max": 255, "step": 1}), - "crop_factor": ("FLOAT", {"default": 3.0, "min": 1.5, "max": 10, "step": 1}), + "crop_factor": ("FLOAT", {"default": 3.0, "min": 1.5, "max": 10, "step": 0.1}), } } @@ -1055,7 +1078,7 @@ class MaskToSEGS: return {"required": { "mask": ("MASK",), "combined": (["False", "True"], ), - "crop_factor": ("FLOAT", {"default": 3.0, "min": 1.5, "max": 10, "step": 1}), + "crop_factor": ("FLOAT", {"default": 3.0, "min": 1.5, "max": 10, "step": 0.1}), } } diff --git a/misc/2pass-1pass.png b/misc/2pass-1pass.png index bb51a1c..6cac101 100644 Binary files a/misc/2pass-1pass.png and b/misc/2pass-1pass.png differ diff --git a/misc/2pass-2pass.png b/misc/2pass-2pass.png index 3c08ef7..e690999 100644 Binary files a/misc/2pass-2pass.png and b/misc/2pass-2pass.png differ diff --git a/misc/2pass-original.png b/misc/2pass-original.png index c258af3..fa4db39 100644 Binary files a/misc/2pass-original.png and b/misc/2pass-original.png differ diff --git a/misc/2pass-refine.json b/misc/2pass-refine.json index 2b2ba99..7ce3cfb 100644 --- a/misc/2pass-refine.json +++ b/misc/2pass-refine.json @@ -2,92 +2,17 @@ "last_node_id": 77, "last_link_id": 177, "nodes": [ - { - "id": 70, - "type": "DetailerForEach", - "pos": [ - 1285.1426500976556, - 454.8209843139653 - ], - "size": [ - 297.777920809659, - 350 - ], - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 155 - }, - { - "name": "segs", - "type": "SEGS", - "link": 152 - }, - { - "name": "model", - "type": "MODEL", - "link": 153 - }, - { - "name": "vae", - "type": "VAE", - "link": 156 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 158 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 160 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 161, - 172, - 173 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "DetailerForEach" - }, - "widgets_values": [ - 256, - 809263269440823, - false, - 20, - 8, - "euler", - "karras", - 0.6, - 5 - ], - "color": "#232", - "bgcolor": "#353" - }, { "id": 67, "type": "BboxDetectorForEach", "pos": [ - 1290.1426500976556, - 273.82098431396537 - ], - "size": [ - 290.32338506525207, - 126.13687549937845 + 738.6226098144523, + 108.70101345825232 ], + "size": { + "0": 290.3233947753906, + "1": 126.13687896728516 + }, "flags": {}, "order": 9, "mode": 0, @@ -124,114 +49,19 @@ "color": "#232", "bgcolor": "#353" }, - { - "id": 71, - "type": "SaveImage", - "pos": [ - 1286.1426500976556, - 851.8209843139646 - ], - "size": [ - 302.5051713423295, - 388.04591508345175 - ], - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 161 - } - ], - "title": "Refined Image", - "properties": {}, - "widgets_values": [ - "refined" - ], - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 41, - "type": "PreviewImage", - "pos": [ - 955.1426500976561, - 852.8209843139646 - ], - "size": [ - 300.6870242032137, - 383.227705522017 - ], - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 110 - } - ], - "title": "Prompt Image", - "properties": { - "Node name for S&R": "PreviewImage" - }, - "color": "#322", - "bgcolor": "#533" - }, - { - "id": 45, - "type": "MMDetLoader", - "pos": [ - 1376.1426500976554, - 35.82098431396473 - ], - "size": { - "0": 348.3031005859375, - "1": 99.29615783691406 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "BBOX_MODEL", - "type": "BBOX_MODEL", - "links": [ - 174 - ], - "slot_index": 0 - }, - { - "name": "SEGM_MODEL", - "type": "SEGM_MODEL", - "links": null - } - ], - "properties": { - "Node name for S&R": "MMDetLoader" - }, - "widgets_values": [ - "bbox/mmdet_anime-face_yolov3.pth" - ], - "color": "#222", - "bgcolor": "#000" - }, { "id": 76, "type": "Reroute", "pos": [ - 1513.1426500976554, - 166.8209843139648 + 961.6226098144517, + 1.701013458251873 ], "size": [ 124, 26 ], "flags": {}, - "order": 3, + "order": 5, "mode": 0, "inputs": [ { @@ -260,17 +90,407 @@ "horizontal": true } }, + { + "id": 44, + "type": "EmptyLatentImage", + "pos": [ + 401.62260981445274, + 110.70101345825232 + ], + "size": { + "0": 297.0506896972656, + "1": 124.40960693359375 + }, + "flags": { + "collapsed": false + }, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 73 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 256, + 320, + 1 + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 40, + "type": "VAEDecode", + "pos": [ + 608.6226098144529, + 30.701013458251865 + ], + "size": { + "0": 311, + "1": 46 + }, + "flags": { + "collapsed": true + }, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 74 + }, + { + "name": "vae", + "type": "VAE", + "link": 137 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 110, + 140, + 155 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 30, + "type": "CheckpointLoader", + "pos": [ + 50.62260981445271, + 109.70101345825233 + ], + "size": { + "0": 289.5052795410156, + "1": 122 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 72, + 153, + 168 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 49, + 62 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 137, + 156, + 167 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoader" + }, + "widgets_values": [ + "anything_v3.yaml", + "V07_v07.safetensors" + ], + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 71, + "type": "SaveImage", + "pos": [ + 735.4799597167967, + 759.880029144287 + ], + "size": { + "0": 302.5051574707031, + "1": 388.0459289550781 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 161 + } + ], + "title": "Refined Image", + "properties": {}, + "widgets_values": [ + "refined" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 70, + "type": "DetailerForEach", + "pos": [ + 733.6226098144523, + 289.70101345825253 + ], + "size": { + "0": 297.7779235839844, + "1": 418 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 155 + }, + { + "name": "segs", + "type": "SEGS", + "link": 152 + }, + { + "name": "model", + "type": "MODEL", + "link": 153 + }, + { + "name": "vae", + "type": "VAE", + "link": 156 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 158 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 160 + }, + { + "name": "external_seed", + "type": "SEED", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 161, + 172, + 173 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DetailerForEach" + }, + "widgets_values": [ + 256, + "bbox", + 650434405941391, + "randomize", + 20, + 8, + "euler", + "karras", + 0.6, + 5, + "enabled" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 75, + "type": "SaveImage", + "pos": [ + 1069.4799597167953, + 759.880029144287 + ], + "size": { + "0": 287.59619140625, + "1": 388.227783203125 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 171 + } + ], + "title": "2nd Refined Image", + "properties": {}, + "widgets_values": [ + "refined" + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 41, + "type": "PreviewImage", + "pos": [ + 404.47995971679666, + 766.880029144287 + ], + "size": { + "0": 300.68701171875, + "1": 383.2276916503906 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 110 + } + ], + "title": "Prompt Image", + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 37, + "type": "CLIPTextEncode", + "pos": [ + 45.47995971679696, + 528.880029144287 + ], + "size": { + "0": 296.4716796875, + "1": 176.8111572265625 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 62 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 71, + 158, + 160, + 165 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "low quality, worst quality, bad anatomy" + ], + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 31, + "type": "CLIPTextEncode", + "pos": [ + 48.47995971679696, + 294.8800291442872 + ], + "size": { + "0": 290.4716796875, + "1": 180.8111572265625 + }, + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 49 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 70, + 166 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "1girl, photorealistic:1.4, masterpiece, jump, full shot, jacket, jean shorts, perfect anatomy, street city background, detailed eyes, smile" + ], + "color": "#233", + "bgcolor": "#355" + }, { "id": 42, "type": "KSampler", "pos": [ - 955.1426500976561, - 458.8209843139653 - ], - "size": [ - 298.6870672052555, - 336.8641496138139 + 402.47995971679666, + 291.8800291442872 ], + "size": { + "0": 300.4716796875, + "1": 416.8111572265625 + }, "flags": {}, "order": 6, "mode": 0, @@ -321,239 +541,17 @@ "color": "#322", "bgcolor": "#533" }, - { - "id": 44, - "type": "EmptyLatentImage", - "pos": [ - 953.1426500976561, - 275.82098431396537 - ], - "size": [ - 297.050703568892, - 124.40960415926838 - ], - "flags": { - "collapsed": false - }, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 73 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 256, - 320, - 1 - ], - "color": "#322", - "bgcolor": "#533" - }, - { - "id": 40, - "type": "VAEDecode", - "pos": [ - 1160.142650097656, - 195.82098431396486 - ], - "size": { - "0": 311, - "1": 46 - }, - "flags": { - "collapsed": true - }, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 74 - }, - { - "name": "vae", - "type": "VAE", - "link": 137 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 110, - 140, - 155 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - }, - "color": "#322", - "bgcolor": "#533" - }, - { - "id": 37, - "type": "CLIPTextEncode", - "pos": [ - 596.1426500976559, - 651.8209843139646 - ], - "size": [ - 296.778076171875, - 141.13685954700816 - ], - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 62 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 71, - 158, - 160, - 165 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "low quality, worst quality, bad anatomy" - ], - "color": "#233", - "bgcolor": "#355" - }, - { - "id": 31, - "type": "CLIPTextEncode", - "pos": [ - 600.1426500976557, - 459.8209843139653 - ], - "size": [ - 290.05080344460225, - 136.4095868197354 - ], - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 49 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 70, - 166 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "1girl, photorealistic:1.4, masterpiece, jump, full shot, jacket, jean shorts, perfect anatomy, street city background, detailed eyes" - ], - "color": "#233", - "bgcolor": "#355" - }, - { - "id": 30, - "type": "CheckpointLoader", - "pos": [ - 602.1426500976557, - 274.82098431396537 - ], - "size": [ - 289.505273992365, - 122 - ], - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 72, - 153, - 168 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 49, - 62 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 137, - 156, - 167 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoader" - }, - "widgets_values": [ - "anything_v3.yaml", - "V07_v07.safetensors" - ], - "color": "#233", - "bgcolor": "#355" - }, { "id": 73, "type": "BboxDetectorForEach", "pos": [ - 1617.1426500976554, - 273.82098431396537 - ], - "size": [ - 284.86892422762776, - 126 + 1067.4799597167953, + 107.88002914428695 ], + "size": { + "0": 284.8689270019531, + "1": 126 + }, "flags": {}, "order": 12, "mode": 0, @@ -590,16 +588,54 @@ "color": "#223", "bgcolor": "#335" }, + { + "id": 45, + "type": "MMDetLoader", + "pos": [ + 1412.1400225830075, + 115.2000213623046 + ], + "size": { + "0": 348.3031005859375, + "1": 99.29615783691406 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "BBOX_MODEL", + "type": "BBOX_MODEL", + "links": [ + 174 + ], + "slot_index": 0 + }, + { + "name": "SEGM_MODEL", + "type": "SEGM_MODEL", + "links": null + } + ], + "properties": { + "Node name for S&R": "MMDetLoader" + }, + "widgets_values": [ + "bbox/mmdet_anime-face_yolov3.pth" + ], + "color": "#222", + "bgcolor": "#000" + }, { "id": 74, "type": "DetailerForEach", "pos": [ - 1616.1426500976554, - 453.8209843139653 + 1068, + 288 ], "size": [ - 284.95983331853677, - 350 + 285.10000305175777, + 420.4000015258789 ], "flags": {}, "order": 13, @@ -634,6 +670,11 @@ "name": "negative", "type": "CONDITIONING", "link": 165 + }, + { + "name": "external_seed", + "type": "SEED", + "link": null } ], "outputs": [ @@ -651,43 +692,16 @@ }, "widgets_values": [ 256, - 529990107233972, - true, + "bbox", + 621928064748632, + "randomize", 20, 8, "euler", "karras", - 0.4, - 5 - ], - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 75, - "type": "SaveImage", - "pos": [ - 1617.1426500976554, - 853.8209843139646 - ], - "size": [ - 287.5961969549005, - 388.22778597745037 - ], - "flags": {}, - "order": 14, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 171 - } - ], - "title": "2nd Refined Image", - "properties": {}, - "widgets_values": [ - "refined" + 0.6, + 5, + "enabled" ], "color": "#223", "bgcolor": "#335" diff --git a/misc/combination-2pass-middle.png b/misc/combination-2pass-middle.png index 75de61b..5782004 100644 Binary files a/misc/combination-2pass-middle.png and b/misc/combination-2pass-middle.png differ diff --git a/misc/combination-2pass-result.png b/misc/combination-2pass-result.png index 58239bd..a76d860 100644 Binary files a/misc/combination-2pass-result.png and b/misc/combination-2pass-result.png differ diff --git a/misc/combination-2pass.json b/misc/combination-2pass.json index 6494dca..5f50674 100644 --- a/misc/combination-2pass.json +++ b/misc/combination-2pass.json @@ -1,49 +1,7 @@ { - "last_node_id": 138, - "last_link_id": 376, + "last_node_id": 143, + "last_link_id": 384, "nodes": [ - { - "id": 104, - "type": "Segs & Mask", - "pos": [ - 1529.9366837890627, - 285.3044807531738 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 22, - "mode": 0, - "inputs": [ - { - "name": "segs", - "type": "SEGS", - "link": 246 - }, - { - "name": "mask", - "type": "MASK", - "link": 337 - } - ], - "outputs": [ - { - "name": "SEGS", - "type": "SEGS", - "links": [ - 347 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Segs & Mask" - }, - "color": "#323", - "bgcolor": "#535" - }, { "id": 109, "type": "CLIPTextEncode", @@ -119,45 +77,6 @@ "horizontal": false } }, - { - "id": 124, - "type": "CLIPTextEncode", - "pos": [ - 2234, - 617 - ], - "size": { - "0": 313.7494201660156, - "1": 156.86895751953125 - }, - "flags": {}, - "order": 15, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 357 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 374 - ], - "slot_index": 0 - } - ], - "title": "Face Prompt", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "adorable face, widening eyes, disgust, closeup portrait, looking away, detailed eyes" - ] - }, { "id": 118, "type": "PreviewImage", @@ -170,7 +89,7 @@ "1": 252.140380859375 }, "flags": {}, - "order": 27, + "order": 28, "mode": 0, "inputs": [ { @@ -196,7 +115,7 @@ "1": 250 }, "flags": {}, - "order": 26, + "order": 27, "mode": 0, "inputs": [ { @@ -210,43 +129,6 @@ "Node name for S&R": "PreviewImage" } }, - { - "id": 94, - "type": "Reroute", - "pos": [ - 559, - 445 - ], - "size": [ - 82, - 26 - ], - "flags": {}, - "order": 18, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 274 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 218, - 335 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": true, - "horizontal": false - } - }, { "id": 120, "type": "Reroute", @@ -322,54 +204,6 @@ "horizontal": false } }, - { - "id": 105, - "type": "CheckpointLoaderSimple", - "pos": [ - 5, - -10 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 327 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 333 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 252, - 267 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "V07_v07.safetensors" - ] - }, { "id": 82, "type": "MMDetLoader", @@ -382,7 +216,7 @@ "1": 93.55003356933594 }, "flags": {}, - "order": 2, + "order": 0, "mode": 0, "outputs": [ { @@ -422,7 +256,7 @@ "1": 96.49998474121094 }, "flags": {}, - "order": 3, + "order": 1, "mode": 0, "outputs": [ { @@ -444,155 +278,6 @@ "color": "#232", "bgcolor": "#353" }, - { - "id": 116, - "type": "DetailerForEachDebug", - "pos": [ - 2234, - 819 - ], - "size": { - "0": 315, - "1": 394 - }, - "flags": {}, - "order": 23, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 346 - }, - { - "name": "segs", - "type": "SEGS", - "link": 347 - }, - { - "name": "model", - "type": "MODEL", - "link": 348 - }, - { - "name": "vae", - "type": "VAE", - "link": 349 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 374 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 351 - }, - { - "name": "external_seed", - "type": "SEED", - "link": null - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 352, - 359 - ], - "slot_index": 0 - }, - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 292 - ], - "slot_index": 1 - }, - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 293 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "DetailerForEachDebug" - }, - "widgets_values": [ - 320, - 525638383782973, - false, - 20, - 7, - "euler", - "karras", - 0.6, - 5, - "enabled" - ] - }, - { - "id": 126, - "type": "LoraLoader", - "pos": [ - 899, - -102 - ], - "size": { - "0": 410.2594299316406, - "1": 126 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 330 - }, - { - "name": "clip", - "type": "CLIP", - "link": 328 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 329, - 355 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 331, - 356 - ], - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LoraLoader" - }, - "widgets_values": [ - "emotionPuppeteerLora_v2Lora.safetensors", - 1, - 1 - ] - }, { "id": 119, "type": "LoraLoader", @@ -654,7 +339,7 @@ 26 ], "flags": {}, - "order": 25, + "order": 26, "mode": 0, "inputs": [ { @@ -696,7 +381,7 @@ "1": 46 }, "flags": {}, - "order": 30, + "order": 34, "mode": 0, "inputs": [ { @@ -800,417 +485,6 @@ "horizontal": false } }, - { - "id": 106, - "type": "Reroute", - "pos": [ - 2110, - -129 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 252 - } - ], - "outputs": [ - { - "name": "VAE", - "type": "VAE", - "links": [ - 349, - 370 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": true, - "horizontal": false - } - }, - { - "id": 136, - "type": "SaveImage", - "pos": [ - 756, - 1341 - ], - "size": { - "0": 704.0276489257812, - "1": 678.6297607421875 - }, - "flags": {}, - "order": 32, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 372 - } - ], - "title": "Refine - 2pass", - "properties": {}, - "widgets_values": [ - "refined-2pass" - ] - }, - { - "id": 135, - "type": "DetailerForEach", - "pos": [ - 1499, - 1343 - ], - "size": { - "0": 315, - "1": 394 - }, - "flags": {}, - "order": 31, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 368 - }, - { - "name": "segs", - "type": "SEGS", - "link": 367 - }, - { - "name": "model", - "type": "MODEL", - "link": 369 - }, - { - "name": "vae", - "type": "VAE", - "link": 370 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 375, - "slot_index": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 371, - "slot_index": 5 - }, - { - "name": "external_seed", - "type": "SEED", - "link": null - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 372 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "DetailerForEach" - }, - "widgets_values": [ - 320, - 557701735627255, - false, - 20, - 8, - "euler", - "karras", - 0.5, - 5, - "enabled" - ] - }, - { - "id": 132, - "type": "BboxDetectorForEach", - "pos": [ - 2195, - 1554 - ], - "size": { - "0": 260.3999938964844, - "1": 126 - }, - "flags": {}, - "order": 28, - "mode": 0, - "inputs": [ - { - "name": "bbox_model", - "type": "BBOX_MODEL", - "link": 362 - }, - { - "name": "image", - "type": "IMAGE", - "link": 361 - } - ], - "outputs": [ - { - "name": "SEGS", - "type": "SEGS", - "links": [ - 363, - 366 - ], - "slot_index": 0 - } - ], - "title": "BboxDetectorFE !! DON'T MUTE !!", - "properties": { - "Node name for S&R": "BboxDetectorForEach" - }, - "widgets_values": [ - 0.5, - 10, - 4 - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 138, - "type": "CLIPTextEncode", - "pos": [ - 1498, - 1775 - ], - "size": [ - 954.989501953125, - 243.09625799005676 - ], - "flags": {}, - "order": 16, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 376 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 375 - ], - "slot_index": 0 - } - ], - "title": "Face Prompt", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "adorable face, widening eyes, disgust, closeup portrait, looking away, detailed eyes" - ] - }, - { - "id": 90, - "type": "BboxDetectorForEach", - "pos": [ - 716, - 313 - ], - "size": { - "0": 260.3999938964844, - "1": 126 - }, - "flags": {}, - "order": 19, - "mode": 0, - "inputs": [ - { - "name": "bbox_model", - "type": "BBOX_MODEL", - "link": 204 - }, - { - "name": "image", - "type": "IMAGE", - "link": 218 - } - ], - "outputs": [ - { - "name": "SEGS", - "type": "SEGS", - "links": [ - 239, - 334 - ], - "slot_index": 0 - } - ], - "title": "BboxDetectorFE !! DON'T MUTE !!", - "properties": { - "Node name for S&R": "BboxDetectorForEach" - }, - "widgets_values": [ - 0.5, - 10, - 4 - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 127, - "type": "SAMDetectorCombined", - "pos": [ - 1112, - 306 - ], - "size": { - "0": 243.7554168701172, - "1": 146 - }, - "flags": {}, - "order": 21, - "mode": 2, - "inputs": [ - { - "name": "sam_model", - "type": "SAM_MODEL", - "link": 336 - }, - { - "name": "segs", - "type": "SEGS", - "link": 334 - }, - { - "name": "image", - "type": "IMAGE", - "link": 335 - } - ], - "outputs": [ - { - "name": "MASK", - "type": "MASK", - "links": [ - 337 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "SAMDetectorCombined" - }, - "widgets_values": [ - "center-1", - 1, - 0.93 - ], - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 131, - "type": "SAMDetectorCombined", - "pos": [ - 2192, - 1353 - ], - "size": { - "0": 259.5433349609375, - "1": 148.83053588867188 - }, - "flags": {}, - "order": 29, - "mode": 2, - "inputs": [ - { - "name": "sam_model", - "type": "SAM_MODEL", - "link": 364 - }, - { - "name": "segs", - "type": "SEGS", - "link": 363 - }, - { - "name": "image", - "type": "IMAGE", - "link": 360 - } - ], - "outputs": [ - { - "name": "MASK", - "type": "MASK", - "links": [ - 365 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "SAMDetectorCombined" - }, - "widgets_values": [ - "center-1", - 0.93, - 0.93 - ], - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 115, - "type": "SaveImage", - "pos": [ - 1498, - 618 - ], - "size": [ - 714.0886352539064, - 594.8502563476563 - ], - "flags": {}, - "order": 24, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 352 - } - ], - "title": "Refined", - "properties": {}, - "widgets_values": [ - "refined" - ] - }, { "id": 107, "type": "SaveImage", @@ -1218,10 +492,10 @@ 753, 620 ], - "size": [ - 700.0886352539064, - 588.4502563476562 - ], + "size": { + "0": 700.088623046875, + "1": 588.4502563476562 + }, "flags": {}, "order": 17, "mode": 0, @@ -1333,7 +607,7 @@ "1": 106 }, "flags": {}, - "order": 0, + "order": 2, "mode": 0, "outputs": [ { @@ -1412,6 +686,897 @@ "karras", 1 ] + }, + { + "id": 136, + "type": "SaveImage", + "pos": [ + 756, + 1341 + ], + "size": { + "0": 702.1994018554688, + "1": 706.2926025390625 + }, + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 372 + } + ], + "title": "Refine - 2pass", + "properties": {}, + "widgets_values": [ + "refined-2pass" + ] + }, + { + "id": 124, + "type": "CLIPTextEncode", + "pos": [ + 2232, + 592 + ], + "size": { + "0": 313.7494201660156, + "1": 156.86895751953125 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 357 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 374 + ], + "slot_index": 0 + } + ], + "title": "Face Prompt", + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "adorable face, widening eyes, disgust, closeup portrait, looking away, detailed eyes" + ] + }, + { + "id": 115, + "type": "SaveImage", + "pos": [ + 1498, + 594 + ], + "size": { + "0": 710.8572998046875, + "1": 629.0338134765625 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 352 + } + ], + "title": "Refined", + "properties": {}, + "widgets_values": [ + "refined" + ] + }, + { + "id": 126, + "type": "LoraLoader", + "pos": [ + 898, + -129 + ], + "size": { + "0": 410.2594299316406, + "1": 126 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 330 + }, + { + "name": "clip", + "type": "CLIP", + "link": 328 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 329, + 355 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 331, + 356 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LoraLoader" + }, + "widgets_values": [ + "emotionPuppeteerLora_v2Lora.safetensors", + 1, + 1 + ] + }, + { + "id": 105, + "type": "CheckpointLoaderSimple", + "pos": [ + 7, + 38 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 327 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 333 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 252, + 267 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "V07_v07.safetensors" + ] + }, + { + "id": 138, + "type": "CLIPTextEncode", + "pos": [ + 1502, + 1806 + ], + "size": { + "0": 954.989501953125, + "1": 243.09625244140625 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 376 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 375 + ], + "slot_index": 0 + } + ], + "title": "Face Prompt", + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "adorable face, widening eyes, disgust, closeup portrait, looking away, detailed eyes" + ] + }, + { + "id": 131, + "type": "SAMDetectorCombined", + "pos": [ + 2192, + 1353 + ], + "size": { + "0": 259.5433349609375, + "1": 148.83053588867188 + }, + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "name": "sam_model", + "type": "SAM_MODEL", + "link": 364 + }, + { + "name": "segs", + "type": "SEGS", + "link": 363 + }, + { + "name": "image", + "type": "IMAGE", + "link": 360 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 365 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SAMDetectorCombined" + }, + "widgets_values": [ + "horizontal-2", + 0.93, + 0.93 + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 104, + "type": "Segs & Mask", + "pos": [ + 1529.9366837890627, + 285.3044807531738 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "segs", + "type": "SEGS", + "link": 246 + }, + { + "name": "mask", + "type": "MASK", + "link": 337 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 347, + 377 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Segs & Mask" + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 94, + "type": "Reroute", + "pos": [ + 559, + 445 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 274 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 218, + 335, + 378, + 381 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 106, + "type": "Reroute", + "pos": [ + 2110, + -129 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 252 + } + ], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 349, + 370, + 380, + 383 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 127, + "type": "SAMDetectorCombined", + "pos": [ + 1112, + 306 + ], + "size": { + "0": 243.7554168701172, + "1": 146 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "sam_model", + "type": "SAM_MODEL", + "link": 336 + }, + { + "name": "segs", + "type": "SEGS", + "link": 334 + }, + { + "name": "image", + "type": "IMAGE", + "link": 335 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 337 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SAMDetectorCombined" + }, + "widgets_values": [ + "horizontal-2", + 1, + 0.93 + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 90, + "type": "BboxDetectorForEach", + "pos": [ + 716, + 313 + ], + "size": { + "0": 260.3999938964844, + "1": 126 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "bbox_model", + "type": "BBOX_MODEL", + "link": 204 + }, + { + "name": "image", + "type": "IMAGE", + "link": 218 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 239, + 334 + ], + "slot_index": 0 + } + ], + "title": "BboxDetectorFE !! DON'T MUTE !!", + "properties": { + "Node name for S&R": "BboxDetectorForEach" + }, + "widgets_values": [ + 0.5, + 10, + 3.9999999999999996 + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 143, + "type": "PreviewImage", + "pos": [ + 2820, + -943 + ], + "size": [ + 562, + 699 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 384 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 142, + "type": "VAEDecode", + "pos": [ + 2447, + -941 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 382 + }, + { + "name": "vae", + "type": "VAE", + "link": 383 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 384 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 141, + "type": "VAEEncodeForInpaint", + "pos": [ + 2142, + -939 + ], + "size": { + "0": 210, + "1": 66 + }, + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 381 + }, + { + "name": "vae", + "type": "VAE", + "link": 380 + }, + { + "name": "mask", + "type": "MASK", + "link": 379 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 382 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncodeForInpaint" + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 140, + "type": "SegsMaskCombine", + "pos": [ + 1761, + -898 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "segs", + "type": "SEGS", + "link": 377 + }, + { + "name": "image", + "type": "IMAGE", + "link": 378 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 379 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SegsMaskCombine" + }, + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 135, + "type": "DetailerForEach", + "pos": [ + 1499, + 1343 + ], + "size": { + "0": 315, + "1": 418 + }, + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 368 + }, + { + "name": "segs", + "type": "SEGS", + "link": 367 + }, + { + "name": "model", + "type": "MODEL", + "link": 369 + }, + { + "name": "vae", + "type": "VAE", + "link": 370 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 375, + "slot_index": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 371, + "slot_index": 5 + }, + { + "name": "external_seed", + "type": "SEED", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 372 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DetailerForEach" + }, + "widgets_values": [ + 320, + "bbox", + 557701735627255, + "fixed", + 20, + 10, + "euler", + "karras", + 0.5, + 5, + "disabled" + ] + }, + { + "id": 116, + "type": "DetailerForEachDebug", + "pos": [ + 2235, + 800 + ], + "size": { + "0": 315, + "1": 418 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 346 + }, + { + "name": "segs", + "type": "SEGS", + "link": 347 + }, + { + "name": "model", + "type": "MODEL", + "link": 348 + }, + { + "name": "vae", + "type": "VAE", + "link": 349 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 374 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 351 + }, + { + "name": "external_seed", + "type": "SEED", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 352, + 359 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 292 + ], + "slot_index": 1 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 293 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "DetailerForEachDebug" + }, + "widgets_values": [ + 256, + "bbox", + 525638383782973, + "fixed", + 10, + 7, + "euler", + "karras", + 0.6, + 5, + "disabled" + ] + }, + { + "id": 132, + "type": "BboxDetectorForEach", + "pos": [ + 2195, + 1554 + ], + "size": { + "0": 260.3999938964844, + "1": 126 + }, + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "name": "bbox_model", + "type": "BBOX_MODEL", + "link": 362 + }, + { + "name": "image", + "type": "IMAGE", + "link": 361 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 363, + 366 + ], + "slot_index": 0 + } + ], + "title": "BboxDetectorFE !! DON'T MUTE !!", + "properties": { + "Node name for S&R": "BboxDetectorForEach" + }, + "widgets_values": [ + 0.5, + 20, + 3.9999999999999996 + ], + "color": "#432", + "bgcolor": "#653" } ], "links": [ @@ -1838,6 +2003,70 @@ 138, 0, "CLIP" + ], + [ + 377, + 104, + 0, + 140, + 0, + "SEGS" + ], + [ + 378, + 94, + 0, + 140, + 1, + "IMAGE" + ], + [ + 379, + 140, + 0, + 141, + 2, + "MASK" + ], + [ + 380, + 106, + 0, + 141, + 1, + "VAE" + ], + [ + 381, + 94, + 0, + 141, + 0, + "IMAGE" + ], + [ + 382, + 141, + 0, + 142, + 0, + "LATENT" + ], + [ + 383, + 106, + 0, + 142, + 1, + "VAE" + ], + [ + 384, + 142, + 0, + 143, + 0, + "IMAGE" ] ], "groups": [ @@ -1862,7 +2091,7 @@ "color": "#3f789e" }, { - "title": "Refine and Render", + "title": "Refine and Render (Fast Repair)", "bounding": [ 1479, 495, @@ -1879,20 +2108,30 @@ 659, 462 ], - "color": "#3f789e" + "color": "#a1309b" }, { - "title": "2nd refine", + "title": "2nd Refine (Detailer)", "bounding": [ 732, 1265, 1832, - 779 + 803 ], "color": "#3f789e" + }, + { + "title": "Mask Preview", + "bounding": [ + 1698, + -1104, + 1745, + 909 + ], + "color": "#a1309b" } ], "config": {}, "extra": {}, "version": 0.4 -} +} \ No newline at end of file diff --git a/misc/combination-refined.png b/misc/combination-refined.png index 9958109..e70ec3a 100644 Binary files a/misc/combination-refined.png and b/misc/combination-refined.png differ diff --git a/misc/combination.json b/misc/combination.json index 82feba3..67db456 100644 --- a/misc/combination.json +++ b/misc/combination.json @@ -275,65 +275,6 @@ "V07_v07.safetensors" ] }, - { - "id": 111, - "type": "KSampler", - "pos": [ - 20, - 762 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 268 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 264 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 265 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 266 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 272 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 832707305495685, - false, - 20, - 7, - "euler", - "karras", - 1 - ] - }, { "id": 112, "type": "EmptyLatentImage", @@ -484,7 +425,7 @@ "Node name for S&R": "CLIPTextEncode" }, "widgets_values": [ - "masterpiece, photorealistic:1.4, short break hair, (yellow check short jacket), white shirts, light pink necktie, (pink school check skirt), cute girl, sneakers, detailed eyes, realistic, 2girls, ultra detailed, beautiful girl, beautiful-detailed eyes, slender, small breast, smile, from top, luminous skin, stocking" + "masterpiece, photorealistic:1.4, short break hair, (yellow check short jacket), white shirts, light pink necktie, (pink school check skirt), cute girl, sneakers, detailed eyes, realistic, 2girls, ultra detailed, beautiful girl, beautiful-detailed eyes, slender, small breast, smile, from top, luminous skin, stocking," ] }, { @@ -541,6 +482,113 @@ "refined" ] }, + { + "id": 111, + "type": "KSampler", + "pos": [ + 20, + 762 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 268 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 264 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 265 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 266 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 272 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 832707305495685, + "fixed", + 20, + 7, + "euler", + "karras", + 1 + ] + }, + { + "id": 90, + "type": "BboxDetectorForEach", + "pos": [ + 712.9366837890625, + 293.3044807531738 + ], + "size": { + "0": 251.412109375, + "1": 126 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "bbox_model", + "type": "BBOX_MODEL", + "link": 204 + }, + { + "name": "image", + "type": "IMAGE", + "link": 218 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 208, + 239 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "BboxDetectorForEach" + }, + "widgets_values": [ + 0.5, + 20, + 3 + ], + "color": "#432", + "bgcolor": "#653" + }, { "id": 114, "type": "DetailerForEach", @@ -550,7 +598,7 @@ ], "size": { "0": 315, - "1": 394 + "1": 418 }, "flags": {}, "order": 15, @@ -607,65 +655,18 @@ }, "widgets_values": [ 256, - 1063220709408570, - false, + "bbox", + 1041366330963730, + "randomize", 20, 7, "euler", "karras", - 0.5, + 0.6, 5, - "enabled" + "disabled" ] }, - { - "id": 90, - "type": "BboxDetectorForEach", - "pos": [ - 712.9366837890625, - 293.3044807531738 - ], - "size": { - "0": 251.412109375, - "1": 126 - }, - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "bbox_model", - "type": "BBOX_MODEL", - "link": 204 - }, - { - "name": "image", - "type": "IMAGE", - "link": 218 - } - ], - "outputs": [ - { - "name": "SEGS", - "type": "SEGS", - "links": [ - 208, - 239 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "BboxDetectorForEach" - }, - "widgets_values": [ - 0.5, - 10, - 3 - ], - "color": "#432", - "bgcolor": "#653" - }, { "id": 91, "type": "SAMDetectorCombined", @@ -711,9 +712,9 @@ "Node name for S&R": "SAMDetectorCombined" }, "widgets_values": [ - "center-1", - 0.93, - 0.93 + "rect-4", + 10, + 0.9 ], "color": "#232", "bgcolor": "#353" @@ -964,4 +965,4 @@ "config": {}, "extra": {}, "version": 0.4 -} +} \ No newline at end of file diff --git a/misc/combination.png b/misc/combination.png index 63645d7..2eb5ace 100644 Binary files a/misc/combination.png and b/misc/combination.png differ diff --git a/misc/face-off-original.png b/misc/face-off-original.png new file mode 100644 index 0000000..c8fc297 Binary files /dev/null and b/misc/face-off-original.png differ diff --git a/misc/face-off-result.png b/misc/face-off-result.png new file mode 100644 index 0000000..02eefbb Binary files /dev/null and b/misc/face-off-result.png differ diff --git a/misc/face-off.json b/misc/face-off.json new file mode 100644 index 0000000..dc68a12 --- /dev/null +++ b/misc/face-off.json @@ -0,0 +1,1424 @@ +{ + "last_node_id": 130, + "last_link_id": 355, + "nodes": [ + { + "id": 104, + "type": "Segs & Mask", + "pos": [ + 1529.9366837890627, + 285.3044807531738 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "segs", + "type": "SEGS", + "link": 246 + }, + { + "name": "mask", + "type": "MASK", + "link": 337 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 347 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Segs & Mask" + }, + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 107, + "type": "SaveImage", + "pos": [ + 752, + 620 + ], + "size": { + "0": 703.5068359375, + "1": 549.9654541015625 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 273 + } + ], + "title": "Prompt", + "properties": {}, + "widgets_values": [ + "original" + ] + }, + { + "id": 108, + "type": "VAEDecode", + "pos": [ + 360, + 1123 + ], + "size": { + "0": 381.7952880859375, + "1": 46.58692932128906 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 272 + }, + { + "name": "vae", + "type": "VAE", + "link": 267 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 273, + 274, + 346 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 110, + "type": "CLIPTextEncode", + "pos": [ + 362, + 866 + ], + "size": { + "0": 381.7952880859375, + "1": 213.58692932128906 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 304 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 265, + 351 + ], + "slot_index": 0 + } + ], + "title": "Negative Prompt", + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "easynegative, ng_deepnegative_v1_75t, (low quality:1.5), (worst quality:1.5), strabismus, pen, pencil, text, watermark, artist name, signature, letterboxed, bag, shoulder bag, briefcase, outerwears, jacket, coat, cardigan, suit, tire, 3d, perfect hand, perfect fingers, straw hat, wings, animal ears, crowd, badhandv4, animal tail, car, " + ] + }, + { + "id": 109, + "type": "CLIPTextEncode", + "pos": [ + 359, + 620 + ], + "size": { + "0": 382, + "1": 204 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 303 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 264 + ], + "slot_index": 0 + } + ], + "title": "Positive Prompt", + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(Masterpiece, high quality), (best quality), (intricate details), (blurry background), 1girl, gunman, short red hair, freckles, western sheriff hat, scarf, duster coat over long sleeves shirt under brown vest, duster, jeans, bullet belt, western holster, (colt single action army revolver), full body, old west, wild west, american western town, outdoors, cowboy_western, unpaved road, Tumbleweed on road, 21 korean age girl, korean idol style, ulzzang, " + ] + }, + { + "id": 124, + "type": "CLIPTextEncode", + "pos": [ + 2234, + 617 + ], + "size": { + "0": 313.7494201660156, + "1": 156.86895751953125 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 355 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 350 + ], + "slot_index": 0 + } + ], + "title": "Face Prompt", + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "adorable face, wink, joyful, closeup portrait, looking away, " + ] + }, + { + "id": 118, + "type": "PreviewImage", + "pos": [ + 2256.7401171875, + 127.03999950408932 + ], + "size": { + "0": 227.76901245117188, + "1": 252.140380859375 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 293 + } + ], + "title": "Enhanced", + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 117, + "type": "PreviewImage", + "pos": [ + 1963.7401171875, + 133.03999950408937 + ], + "size": { + "0": 210, + "1": 250 + }, + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 292 + } + ], + "title": "Cropped", + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 94, + "type": "Reroute", + "pos": [ + 559, + 445 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 274 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 218, + 335 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 120, + "type": "Reroute", + "pos": [ + 416, + -140 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 327 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 315, + 330 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 121, + "type": "Reroute", + "pos": [ + 419, + -75 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 333 + } + ], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 303, + 304, + 328 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 105, + "type": "CheckpointLoaderSimple", + "pos": [ + 5, + -10 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 327 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 333 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 252, + 267 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "V07_v07.safetensors" + ] + }, + { + "id": 125, + "type": "Reroute", + "pos": [ + 2122, + -93 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 353 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 348 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 106, + "type": "Reroute", + "pos": [ + 2124, + -152 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 252 + } + ], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 349 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 130, + "type": "Reroute", + "pos": [ + 2120.9272289433748, + -45.036994320749955 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 354 + } + ], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 355 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 87, + "type": "SAMLoader", + "pos": [ + 1105, + 103 + ], + "size": { + "0": 327.3000183105469, + "1": 96.49998474121094 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "SAM_MODEL", + "type": "SAM_MODEL", + "links": [ + 336 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SAMLoader" + }, + "widgets_values": [ + "sam_vit_b_01ec64.pth" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 82, + "type": "MMDetLoader", + "pos": [ + 713, + 105 + ], + "size": { + "0": 374.412109375, + "1": 93.55003356933594 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "BBOX_MODEL", + "type": "BBOX_MODEL", + "links": [ + 204 + ], + "slot_index": 0 + }, + { + "name": "SEGM_MODEL", + "type": "SEGM_MODEL", + "links": [], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "MMDetLoader" + }, + "widgets_values": [ + "bbox/mmdet_anime-face_yolov3.pth" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 103, + "type": "Reroute", + "pos": [ + 1201, + 224 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 239 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 246 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 126, + "type": "LoraLoader", + "pos": [ + 996, + -131 + ], + "size": { + "0": 410.2594299316406, + "1": 126 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 330 + }, + { + "name": "clip", + "type": "CLIP", + "link": 328 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 329, + 353 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 331, + 354 + ], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LoraLoader" + }, + "widgets_values": [ + "emotionPuppeteerLora_v2Lora.safetensors", + 1, + 1 + ] + }, + { + "id": 119, + "type": "LoraLoader", + "pos": [ + 1444, + -130 + ], + "size": { + "0": 408.50341796875, + "1": 126 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 329 + }, + { + "name": "clip", + "type": "CLIP", + "link": 331 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [], + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LoraLoader" + }, + "widgets_values": [ + "koreanDollLikeness_v10.safetensors", + 1, + 1 + ] + }, + { + "id": 90, + "type": "BboxDetectorForEach", + "pos": [ + 716, + 311 + ], + "size": { + "0": 260.3999938964844, + "1": 126 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "bbox_model", + "type": "BBOX_MODEL", + "link": 204 + }, + { + "name": "image", + "type": "IMAGE", + "link": 218 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 239, + 334 + ], + "slot_index": 0 + } + ], + "title": "BboxDetectorFE !! DON'T MUTE !!", + "properties": { + "Node name for S&R": "BboxDetectorForEach" + }, + "widgets_values": [ + 0.5, + 10, + 4.3 + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 116, + "type": "DetailerForEachDebug", + "pos": [ + 2234, + 819 + ], + "size": { + "0": 315, + "1": 418 + }, + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 346 + }, + { + "name": "segs", + "type": "SEGS", + "link": 347 + }, + { + "name": "model", + "type": "MODEL", + "link": 348 + }, + { + "name": "vae", + "type": "VAE", + "link": 349 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 350 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 351 + }, + { + "name": "external_seed", + "type": "SEED", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 352 + ], + "slot_index": 0 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 292 + ], + "slot_index": 1 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 293 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "DetailerForEachDebug" + }, + "widgets_values": [ + 320, + "bbox", + 281767597455979, + "randomize", + 20, + 10, + "euler", + "karras", + 0.5, + 5, + "disabled" + ] + }, + { + "id": 112, + "type": "EmptyLatentImage", + "pos": [ + 21, + 1065 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 266 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 768, + 1152, + 1 + ] + }, + { + "id": 115, + "type": "SaveImage", + "pos": [ + 1499, + 619 + ], + "size": { + "0": 708.5068359375, + "1": 555.9654541015625 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 352 + } + ], + "title": "Refined", + "properties": {}, + "widgets_values": [ + "refined" + ] + }, + { + "id": 111, + "type": "KSampler", + "pos": [ + 20, + 762 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 315 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 264 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 265 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 266 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 272 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 98323244225723, + "fixed", + 30, + 10, + "euler", + "karras", + 1 + ] + }, + { + "id": 127, + "type": "SAMDetectorCombined", + "pos": [ + 1110, + 295 + ], + "size": { + "0": 243.7554168701172, + "1": 146 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "sam_model", + "type": "SAM_MODEL", + "link": 336 + }, + { + "name": "segs", + "type": "SEGS", + "link": 334 + }, + { + "name": "image", + "type": "IMAGE", + "link": 335 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 337 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SAMDetectorCombined" + }, + "widgets_values": [ + "center-1", + 0.93, + 0.93 + ], + "color": "#232", + "bgcolor": "#353" + } + ], + "links": [ + [ + 204, + 82, + 0, + 90, + 0, + "BBOX_MODEL" + ], + [ + 218, + 94, + 0, + 90, + 1, + "IMAGE" + ], + [ + 239, + 90, + 0, + 103, + 0, + "*" + ], + [ + 246, + 103, + 0, + 104, + 0, + "SEGS" + ], + [ + 252, + 105, + 2, + 106, + 0, + "*" + ], + [ + 264, + 109, + 0, + 111, + 1, + "CONDITIONING" + ], + [ + 265, + 110, + 0, + 111, + 2, + "CONDITIONING" + ], + [ + 266, + 112, + 0, + 111, + 3, + "LATENT" + ], + [ + 267, + 105, + 2, + 108, + 1, + "VAE" + ], + [ + 272, + 111, + 0, + 108, + 0, + "LATENT" + ], + [ + 273, + 108, + 0, + 107, + 0, + "IMAGE" + ], + [ + 274, + 108, + 0, + 94, + 0, + "*" + ], + [ + 292, + 116, + 1, + 117, + 0, + "IMAGE" + ], + [ + 293, + 116, + 2, + 118, + 0, + "IMAGE" + ], + [ + 303, + 121, + 0, + 109, + 0, + "CLIP" + ], + [ + 304, + 121, + 0, + 110, + 0, + "CLIP" + ], + [ + 315, + 120, + 0, + 111, + 0, + "MODEL" + ], + [ + 327, + 105, + 0, + 120, + 0, + "*" + ], + [ + 328, + 121, + 0, + 126, + 1, + "CLIP" + ], + [ + 329, + 126, + 0, + 119, + 0, + "MODEL" + ], + [ + 330, + 120, + 0, + 126, + 0, + "MODEL" + ], + [ + 331, + 126, + 1, + 119, + 1, + "CLIP" + ], + [ + 333, + 105, + 1, + 121, + 0, + "*" + ], + [ + 334, + 90, + 0, + 127, + 1, + "SEGS" + ], + [ + 335, + 94, + 0, + 127, + 2, + "IMAGE" + ], + [ + 336, + 87, + 0, + 127, + 0, + "SAM_MODEL" + ], + [ + 337, + 127, + 0, + 104, + 1, + "MASK" + ], + [ + 346, + 108, + 0, + 116, + 0, + "IMAGE" + ], + [ + 347, + 104, + 0, + 116, + 1, + "SEGS" + ], + [ + 348, + 125, + 0, + 116, + 2, + "MODEL" + ], + [ + 349, + 106, + 0, + 116, + 3, + "VAE" + ], + [ + 350, + 124, + 0, + 116, + 4, + "CONDITIONING" + ], + [ + 351, + 110, + 0, + 116, + 5, + "CONDITIONING" + ], + [ + 352, + 116, + 0, + 115, + 0, + "IMAGE" + ], + [ + 353, + 126, + 0, + 125, + 0, + "*" + ], + [ + 354, + 126, + 1, + 130, + 0, + "*" + ], + [ + 355, + 130, + 0, + 124, + 0, + "CLIP" + ] + ], + "groups": [ + { + "title": "Detection & Mask Generation", + "bounding": [ + 664, + 13, + 1190, + 447 + ], + "color": "#3f789e" + }, + { + "title": "Prompt", + "bounding": [ + 11, + 496, + 1462, + 753 + ], + "color": "#3f789e" + }, + { + "title": "Face-off", + "bounding": [ + 1479, + 495, + 1088, + 753 + ], + "color": "#3f789e" + }, + { + "title": "Detailer Preview", + "bounding": [ + 1902, + 10, + 664, + 448 + ], + "color": "#3f789e" + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/misc/onnx.json b/misc/onnx.json index a5799fc..ef681e5 100644 --- a/misc/onnx.json +++ b/misc/onnx.json @@ -3,58 +3,101 @@ "last_link_id": 15, "nodes": [ { - "id": 5, - "type": "SegsMaskCombine", + "id": 8, + "type": "VAEDecode", "pos": [ - 327, - 530 + 1191, + 203 ], "size": { "0": 210, "1": 46 }, "flags": {}, - "order": 5, + "order": 6, "mode": 0, "inputs": [ { - "name": "segs", - "type": "SEGS", - "link": 15 + "name": "samples", + "type": "LATENT", + "link": 9 }, { - "name": "image", - "type": "IMAGE", - "link": 4 + "name": "vae", + "type": "VAE", + "link": 10 } ], "outputs": [ { - "name": "MASK", - "type": "MASK", + "name": "IMAGE", + "type": "IMAGE", "links": [ - 6 + 11 ], "slot_index": 0 } ], "properties": { - "Node name for S&R": "SegsMaskCombine" - } + "Node name for S&R": "VAE Decode" + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 2, + "type": "LoadImage", + "pos": [ + 57, + 322 + ], + "size": { + "0": 314, + "1": 102 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 4, + 7, + 14 + ], + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null + } + ], + "properties": { + "Node name for S&R": "Load Image" + }, + "widgets_values": [ + "rga6845.jpeg", + "image" + ], + "color": "#222", + "bgcolor": "#000" }, { "id": 6, "type": "VAEEncodeForInpaint", "pos": [ - 609, - 493 + 942, + 201 ], "size": { "0": 226.8000030517578, "1": 66 }, "flags": {}, - "order": 6, + "order": 5, "mode": 0, "inputs": [ { @@ -85,87 +128,23 @@ ], "properties": { "Node name for S&R": "VAE Encode (for Inpainting)" - } - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 858, - 495 - ], - "size": { - "0": 210, - "1": 46 }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 9 - }, - { - "name": "vae", - "type": "VAE", - "link": 10 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 11 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAE Decode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1107, - 494 - ], - "size": { - "0": 315, - "1": 250 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 11 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] + "color": "#223", + "bgcolor": "#335" }, { "id": 7, "type": "VAELoader", "pos": [ - 327, - 684 + 56, + 96 ], "size": { "0": 315, "1": 58 }, "flags": {}, - "order": 0, + "order": 1, "mode": 0, "outputs": [ { @@ -183,119 +162,93 @@ }, "widgets_values": [ "vae-ft-mse-840000-ema-pruned.safetensors" - ] + ], + "color": "#222", + "bgcolor": "#000" }, { - "id": 11, - "type": "ONNXLoader", + "id": 5, + "type": "SegsMaskCombine", "pos": [ - 672.1527099609375, - 363.65423583984375 + 681, + 369 ], "size": { - "0": 315, - "1": 58 + "0": 210, + "1": 46 }, "flags": {}, - "order": 1, + "order": 4, "mode": 0, - "outputs": [ + "inputs": [ { - "name": "ONNX_MODEL", - "type": "ONNX_MODEL", - "links": null - } - ], - "properties": { - "Node name for S&R": "ONNXLoader" - }, - "widgets_values": [ - "detector_v2_base_checkpoint.onnx" - ] - }, - { - "id": 1, - "type": "ONNXLoader", - "pos": [ - -25, - 389 - ], - "size": { - "0": 315, - "1": 58 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "ONNX_MODEL", - "type": "ONNX_MODEL", - "links": [ - 13 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ONNXLoader" - }, - "widgets_values": [ - "detector_v2_base_checkpoint.onnx" - ] - }, - { - "id": 2, - "type": "LoadImage", - "pos": [ - -23, - 504 - ], - "size": { - "0": 312.3335266113281, - "1": 241.66659545898438 - }, - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 4, - 7, - 14 - ], - "slot_index": 0 + "name": "segs", + "type": "SEGS", + "link": 15 }, + { + "name": "image", + "type": "IMAGE", + "link": 4 + } + ], + "outputs": [ { "name": "MASK", "type": "MASK", - "links": null + "links": [ + 6 + ], + "slot_index": 0 } ], "properties": { - "Node name for S&R": "Load Image" + "Node name for S&R": "SegsMaskCombine" }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 9, + "type": "SaveImage", + "pos": [ + 1476, + 205 + ], + "size": { + "0": 475, + "1": 543 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 11 + } + ], + "properties": {}, "widgets_values": [ - "rga6845.jpeg", - "image" - ] + "ComfyUI" + ], + "color": "#223", + "bgcolor": "#335" }, { "id": 13, "type": "ONNXDetectorForEach", "pos": [ - 325, - 391 - ], - "size": [ - 210, - 78 + 405, + 209 ], + "size": { + "0": 210, + "1": 102 + }, "flags": {}, - "order": 4, + "order": 3, "mode": 0, "inputs": [ { @@ -323,8 +276,44 @@ "Node name for S&R": "ONNXDetectorForEach" }, "widgets_values": [ - 0.5 - ] + 0.5, + 2 + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 1, + "type": "ONNXLoader", + "pos": [ + 55, + 207 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "ONNX_MODEL", + "type": "ONNX_MODEL", + "links": [ + 13 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ONNXLoader" + }, + "widgets_values": [ + "detector_v2_base_checkpoint.onnx" + ], + "color": "#222", + "bgcolor": "#000" } ], "links": [ diff --git a/misc/sam-result.png b/misc/sam-result.png index 393ff33..a748755 100644 Binary files a/misc/sam-result.png and b/misc/sam-result.png differ diff --git a/misc/sam.json b/misc/sam.json index 6aa67cb..3f1eb7d 100644 --- a/misc/sam.json +++ b/misc/sam.json @@ -370,171 +370,6 @@ "color": "#2a363b", "bgcolor": "#3f5159" }, - { - "id": 19, - "type": "CLIPTextEncode", - "pos": [ - 138, - 957 - ], - "size": { - "0": 239, - "1": 173 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 25 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 26 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "jeans, ((black))" - ], - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 20, - "type": "CLIPTextEncode", - "pos": [ - 134, - 736 - ], - "size": { - "0": 240, - "1": 177 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 24 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 27 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "1girl, pink short pants" - ], - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 22, - "type": "PreviewImage", - "pos": [ - 730, - 950 - ], - "size": { - "0": 165, - "1": 182 - }, - "flags": {}, - "order": 17, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 30 - } - ], - "title": "Refined Crop", - "properties": { - "Node name for S&R": "PreviewImage" - }, - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 21, - "type": "PreviewImage", - "pos": [ - 729, - 741 - ], - "size": { - "0": 166, - "1": 167 - }, - "flags": {}, - "order": 16, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 29 - } - ], - "title": "Cropped", - "properties": { - "Node name for S&R": "PreviewImage" - }, - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 23, - "type": "SaveImage", - "pos": [ - 911, - 740 - ], - "size": { - "0": 273, - "1": 392 - }, - "flags": {}, - "order": 15, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 28 - } - ], - "title": "Result", - "properties": {}, - "widgets_values": [ - "ComfyUI" - ], - "color": "#223", - "bgcolor": "#335" - }, { "id": 3, "type": "PreviewImage", @@ -563,6 +398,388 @@ "color": "#222", "bgcolor": "#000" }, + { + "id": 30, + "type": "VAEDecode", + "pos": [ + 1333, + 615 + ], + "size": { + "0": 227.90530395507812, + "1": 46 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 42 + }, + { + "name": "vae", + "type": "VAE", + "link": 46 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 44 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 28, + "type": "SegsMaskCombine", + "pos": [ + 1333, + 435 + ], + "size": { + "0": 225.70559692382812, + "1": 46 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "segs", + "type": "SEGS", + "link": 39 + }, + { + "name": "image", + "type": "IMAGE", + "link": 38 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 56 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SegsMaskCombine" + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 16, + "type": "Segs & Mask", + "pos": [ + 1331, + 356 + ], + "size": { + "0": 226.6055908203125, + "1": 46 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "segs", + "type": "SEGS", + "link": 18 + }, + { + "name": "mask", + "type": "MASK", + "link": 19 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 20, + 39 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Segs & Mask" + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 9, + "type": "SAMDetectorCombined", + "pos": [ + 1332, + 165 + ], + "size": { + "0": 225.6055908203125, + "1": 150.59918212890625 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "sam_model", + "type": "SAM_MODEL", + "link": 10 + }, + { + "name": "segs", + "type": "SEGS", + "link": 12 + }, + { + "name": "image", + "type": "IMAGE", + "link": 51 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 19 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "SAMDetectorCombined" + }, + "widgets_values": [ + "none", + 0.93, + 0.93 + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 8, + "type": "ToBinaryMask", + "pos": [ + 1093, + 171 + ], + "size": { + "0": 214.5975799560547, + "1": 26 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 8 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 9, + 57 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ToBinaryMask" + }, + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 20, + "type": "CLIPTextEncode", + "pos": [ + 134, + 736 + ], + "size": { + "0": 239.99998474121094, + "1": 192.00001525878906 + }, + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 24 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 27 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "1girl, (silver:1.4) short pants" + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 21, + "type": "PreviewImage", + "pos": [ + 729, + 741 + ], + "size": { + "0": 166.99998474121094, + "1": 174.00001525878906 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 29 + } + ], + "title": "Cropped", + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 22, + "type": "PreviewImage", + "pos": [ + 729, + 959 + ], + "size": { + "0": 164.99998474121094, + "1": 197.00001525878906 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 30 + } + ], + "title": "Refined Crop", + "properties": { + "Node name for S&R": "PreviewImage" + }, + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 23, + "type": "SaveImage", + "pos": [ + 911, + 740 + ], + "size": { + "0": 289, + "1": 415 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 28 + } + ], + "title": "Result", + "properties": {}, + "widgets_values": [ + "ComfyUI" + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 19, + "type": "CLIPTextEncode", + "pos": [ + 135, + 971 + ], + "size": { + "0": 234.99998474121094, + "1": 185.00001525878906 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 25 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 26 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "jeans, ((black)), ((blue))" + ], + "color": "#223", + "bgcolor": "#335" + }, { "id": 17, "type": "DetailerForEachDebug", @@ -572,7 +789,7 @@ ], "size": { "0": 315, - "1": 394 + "1": 418 }, "flags": {}, "order": 13, @@ -644,236 +861,20 @@ "Node name for S&R": "DetailerForEachDebug" }, "widgets_values": [ - 128, - 1048032768687491, - true, + 192, + "bbox", + 991944171351598, + "randomize", 20, - 8, + 10, "euler", "karras", - 0.7, - 2, + 0.6, + 3, "enabled" ], "color": "#223", "bgcolor": "#335" - }, - { - "id": 30, - "type": "VAEDecode", - "pos": [ - 1333, - 615 - ], - "size": [ - 227.90531005859384, - 46 - ], - "flags": {}, - "order": 19, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 42 - }, - { - "name": "vae", - "type": "VAE", - "link": 46 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 44 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - }, - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 28, - "type": "SegsMaskCombine", - "pos": [ - 1333, - 435 - ], - "size": [ - 225.7055908203124, - 46 - ], - "flags": {}, - "order": 14, - "mode": 0, - "inputs": [ - { - "name": "segs", - "type": "SEGS", - "link": 39 - }, - { - "name": "image", - "type": "IMAGE", - "link": 38 - } - ], - "outputs": [ - { - "name": "MASK", - "type": "MASK", - "links": [ - 56 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "SegsMaskCombine" - }, - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 16, - "type": "Segs & Mask", - "pos": [ - 1331, - 356 - ], - "size": [ - 226.6055908203125, - 46 - ], - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [ - { - "name": "segs", - "type": "SEGS", - "link": 18 - }, - { - "name": "mask", - "type": "MASK", - "link": 19 - } - ], - "outputs": [ - { - "name": "SEGS", - "type": "SEGS", - "links": [ - 20, - 39 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Segs & Mask" - }, - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 9, - "type": "SAMDetectorCombined", - "pos": [ - 1332, - 165 - ], - "size": [ - 225.6055908203125, - 150.59918670654298 - ], - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "sam_model", - "type": "SAM_MODEL", - "link": 10 - }, - { - "name": "segs", - "type": "SEGS", - "link": 12 - }, - { - "name": "image", - "type": "IMAGE", - "link": 51 - } - ], - "outputs": [ - { - "name": "MASK", - "type": "MASK", - "links": [ - 19 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "SAMDetectorCombined" - }, - "widgets_values": [ - "none", - 0.93, - 0.93 - ], - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 8, - "type": "ToBinaryMask", - "pos": [ - 1093, - 171 - ], - "size": [ - 214.59758398437498, - 26 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "mask", - "type": "MASK", - "link": 8 - } - ], - "outputs": [ - { - "name": "MASK", - "type": "MASK", - "links": [ - 9, - 57 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ToBinaryMask" - }, - "color": "#232", - "bgcolor": "#353" } ], "links": [ diff --git a/misc/simple.json b/misc/simple.json index 5fd86f9..d42d0c5 100644 --- a/misc/simple.json +++ b/misc/simple.json @@ -1,54 +1,150 @@ { - "last_node_id": 77, - "last_link_id": 179, + "last_node_id": 79, + "last_link_id": 192, "nodes": [ { - "id": 44, - "type": "EmptyLatentImage", + "id": 30, + "type": "CheckpointLoader", "pos": [ - 953.1426500976561, - 275.82098431396537 + 25.496625228690483, + 252.56698776698155 ], "size": { - "0": 297.0506896972656, - "1": 124.40960693359375 - }, - "flags": { - "collapsed": false + "0": 289.5052795410156, + "1": 122 }, + "flags": {}, "order": 0, "mode": 0, "outputs": [ { - "name": "LATENT", - "type": "LATENT", + "name": "MODEL", + "type": "MODEL", "links": [ - 73 + 72, + 190 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 49, + 62 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 137, + 182 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoader" + }, + "widgets_values": [ + "anything_v3.yaml", + "V07_v07.safetensors" + ], + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 45, + "type": "MMDetLoader", + "pos": [ + 1007.353975131035, + 83.74600345301624 + ], + "size": { + "0": 361.56317138671875, + "1": 93.23355865478516 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "BBOX_MODEL", + "type": "BBOX_MODEL", + "links": [ + 179 + ], + "slot_index": 0 + }, + { + "name": "SEGM_MODEL", + "type": "SEGM_MODEL", + "links": null + } + ], + "properties": { + "Node name for S&R": "MMDetLoader" + }, + "widgets_values": [ + "bbox/mmdet_anime-face_yolov3.pth" + ], + "color": "#222", + "bgcolor": "#000" + }, + { + "id": 37, + "type": "CLIPTextEncode", + "pos": [ + 18.353975131034748, + 645.7460034530161 + ], + "size": { + "0": 297, + "1": 160 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 62 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 71, + 180, + 181 ], "slot_index": 0 } ], "properties": { - "Node name for S&R": "EmptyLatentImage" + "Node name for S&R": "CLIPTextEncode" }, "widgets_values": [ - 256, - 320, - 1 + "low quality, worst quality, bad anatomy" ], - "color": "#322", - "bgcolor": "#533" + "color": "#233", + "bgcolor": "#355" }, { "id": 31, "type": "CLIPTextEncode", "pos": [ - 600.1426500976557, - 459.8209843139653 + 23.353975131034733, + 437.7460034530161 ], "size": { - "0": 290.0508117675781, - "1": 136.4095916748047 + "0": 291, + "1": 163 }, "flags": {}, "order": 3, @@ -80,101 +176,58 @@ "bgcolor": "#355" }, { - "id": 30, - "type": "CheckpointLoader", + "id": 41, + "type": "PreviewImage", "pos": [ - 602.1426500976557, - 274.82098431396537 + 724.3539751310344, + 386.7460034530161 ], "size": { - "0": 289.5052795410156, - "1": 122 + "0": 294, + "1": 419 }, "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 72, - 153 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 49, - 62 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 137, - 156 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoader" - }, - "widgets_values": [ - "anything_v3.yaml", - "V07_v07.safetensors" - ], - "color": "#233", - "bgcolor": "#355" - }, - { - "id": 67, - "type": "BboxDetectorForEach", - "pos": [ - 1991, - 225 - ], - "size": { - "0": 290.3233947753906, - "1": 126.13687896728516 - }, - "flags": {}, - "order": 8, + "order": 7, "mode": 0, "inputs": [ { - "name": "bbox_model", - "type": "BBOX_MODEL", - "link": 179 - }, - { - "name": "image", + "name": "images", "type": "IMAGE", - "link": 140 - } - ], - "outputs": [ - { - "name": "SEGS", - "type": "SEGS", - "links": [ - 152 - ], - "slot_index": 0 + "link": 110 } ], + "title": "Prompt Image", "properties": { - "Node name for S&R": "BboxDetectorForEach" + "Node name for S&R": "PreviewImage" }, + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 71, + "type": "SaveImage", + "pos": [ + 1062.353975131036, + 384.7460034530161 + ], + "size": { + "0": 306, + "1": 420 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 187 + } + ], + "title": "Refined Image", + "properties": {}, "widgets_values": [ - 0.5, - 10, - 4 + "refined" ], "color": "#232", "bgcolor": "#353" @@ -183,8 +236,8 @@ "id": 40, "type": "VAEDecode", "pos": [ - 1124, - 222 + 547.3539751310344, + 201.74600345301639 ], "size": { "0": 311, @@ -214,7 +267,7 @@ "links": [ 110, 140, - 155 + 191 ], "slot_index": 0 } @@ -226,111 +279,180 @@ "bgcolor": "#533" }, { - "id": 45, - "type": "MMDetLoader", + "id": 44, + "type": "EmptyLatentImage", "pos": [ - 1584, - 106 + 376.4966252286909, + 253.56698776698155 ], "size": { - "0": 361.56317138671875, - "1": 93.23355865478516 + "0": 297.0506896972656, + "1": 124.40960693359375 + }, + "flags": { + "collapsed": false }, - "flags": {}, "order": 2, "mode": 0, "outputs": [ { - "name": "BBOX_MODEL", - "type": "BBOX_MODEL", + "name": "LATENT", + "type": "LATENT", "links": [ - 179 + 73 ], "slot_index": 0 - }, - { - "name": "SEGM_MODEL", - "type": "SEGM_MODEL", - "links": null } ], "properties": { - "Node name for S&R": "MMDetLoader" + "Node name for S&R": "EmptyLatentImage" }, "widgets_values": [ - "bbox/mmdet_anime-face_yolov3.pth" + 256, + 320, + 1 ], - "color": "#222", - "bgcolor": "#000" + "color": "#322", + "bgcolor": "#533" }, { - "id": 71, - "type": "SaveImage", + "id": 78, + "type": "DetailerForEach", "pos": [ - 1639, - 407 - ], - "size": [ - 302.85585160688856, - 394.98975060202815 + 1415.353975131036, + 382.7460034530161 ], + "size": { + "0": 293, + "1": 421 + }, "flags": {}, - "order": 10, + "order": 9, "mode": 0, "inputs": [ { - "name": "images", + "name": "image", "type": "IMAGE", - "link": 161 + "link": 191 + }, + { + "name": "segs", + "type": "SEGS", + "link": 192 + }, + { + "name": "model", + "type": "MODEL", + "link": 190 + }, + { + "name": "vae", + "type": "VAE", + "link": 182 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 181 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 180 + }, + { + "name": "external_seed", + "type": "SEED", + "link": null } ], - "title": "Refined Image", - "properties": {}, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 187 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DetailerForEach" + }, "widgets_values": [ - "refined" + 192, + "bbox", + 933619616356624, + "randomize", + 20, + 7, + "euler", + "karras", + 0.6, + 5, + "disabled" ], "color": "#232", "bgcolor": "#353" }, { - "id": 41, - "type": "PreviewImage", + "id": 67, + "type": "BboxDetectorForEach", "pos": [ - 1307, - 409 - ], - "size": [ - 297.5831243341613, - 395.7170233293009 + 1414.353975131036, + 202.74600345301639 ], + "size": { + "0": 290.3233947753906, + "1": 126.13687896728516 + }, "flags": {}, - "order": 7, + "order": 8, "mode": 0, "inputs": [ { - "name": "images", + "name": "bbox_model", + "type": "BBOX_MODEL", + "link": 179 + }, + { + "name": "image", "type": "IMAGE", - "link": 110 + "link": 140 + } + ], + "outputs": [ + { + "name": "SEGS", + "type": "SEGS", + "links": [ + 192 + ], + "slot_index": 0 } ], - "title": "Prompt Image", "properties": { - "Node name for S&R": "PreviewImage" + "Node name for S&R": "BboxDetectorForEach" }, - "color": "#322", - "bgcolor": "#533" + "widgets_values": [ + 0.5, + 10, + 4 + ], + "color": "#232", + "bgcolor": "#353" }, { "id": 42, "type": "KSampler", "pos": [ - 955, - 459 - ], - "size": [ - 295.9467606977978, - 347.53520514748277 + 377.3539751310348, + 435.7460034530161 ], + "size": { + "0": 295, + "1": 369 + }, "flags": {}, "order": 5, "mode": 0, @@ -371,7 +493,7 @@ }, "widgets_values": [ 805157917915455, - false, + "fixed", 20, 8, "euler", @@ -380,127 +502,6 @@ ], "color": "#322", "bgcolor": "#533" - }, - { - "id": 37, - "type": "CLIPTextEncode", - "pos": [ - 595, - 662 - ], - "size": { - "0": 296.778076171875, - "1": 141.13685607910156 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 62 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 71, - 158, - 160 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "low quality, worst quality, bad anatomy" - ], - "color": "#233", - "bgcolor": "#355" - }, - { - "id": 70, - "type": "DetailerForEach", - "pos": [ - 1991, - 407 - ], - "size": { - "0": 293.2631530761719, - "1": 394 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 155 - }, - { - "name": "segs", - "type": "SEGS", - "link": 152 - }, - { - "name": "model", - "type": "MODEL", - "link": 153 - }, - { - "name": "vae", - "type": "VAE", - "link": 156 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 158 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 160 - }, - { - "name": "external_seed", - "type": "SEED", - "link": null - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 161 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "DetailerForEach" - }, - "widgets_values": [ - 192, - 771642664002280, - true, - 20, - 8, - "euler", - "karras", - 0.6, - 5, - "disabled" - ], - "color": "#232", - "bgcolor": "#353" } ], "links": [ @@ -584,62 +585,6 @@ 1, "IMAGE" ], - [ - 152, - 67, - 0, - 70, - 1, - "SEGS" - ], - [ - 153, - 30, - 0, - 70, - 2, - "MODEL" - ], - [ - 155, - 40, - 0, - 70, - 0, - "IMAGE" - ], - [ - 156, - 30, - 2, - 70, - 3, - "VAE" - ], - [ - 158, - 37, - 0, - 70, - 4, - "CONDITIONING" - ], - [ - 160, - 37, - 0, - 70, - 5, - "CONDITIONING" - ], - [ - 161, - 70, - 0, - 71, - 0, - "IMAGE" - ], [ 179, 45, @@ -647,10 +592,66 @@ 67, 0, "BBOX_MODEL" + ], + [ + 180, + 37, + 0, + 78, + 5, + "CONDITIONING" + ], + [ + 181, + 37, + 0, + 78, + 4, + "CONDITIONING" + ], + [ + 182, + 30, + 2, + 78, + 3, + "VAE" + ], + [ + 187, + 78, + 0, + 71, + 0, + "IMAGE" + ], + [ + 190, + 30, + 0, + 78, + 2, + "MODEL" + ], + [ + 191, + 40, + 0, + 78, + 0, + "IMAGE" + ], + [ + 192, + 67, + 0, + 78, + 1, + "SEGS" ] ], "groups": [], "config": {}, "extra": {}, "version": 0.4 -} +} \ No newline at end of file diff --git a/tutorial/ONNX.md b/tutorial/ONNX.md new file mode 100644 index 0000000..45c168c --- /dev/null +++ b/tutorial/ONNX.md @@ -0,0 +1,13 @@ + +# NudeNet +Nudenet uses an ONNX model to detect NSFW content. This example is an application of [NudeNet](https://github.com/notAI-tech/NudeNet)'s capabilities, which detects NSFW elements in images and applies a mask as a post-processing step. This technique demonstrates the use of nudenet to detect potentially inappropriate content in order to ensure the safety of minors on certain websites + +* [detector_v2_base_checkpoint.onnx](https://github.com/notAI-tech/NudeNet/releases/download/v0/detector_v2_base_checkpoint.onnx) is a model for nudenet. Download and placed into **ComfyUI/models/onnx** + +* [onnx.json](../misc/onnx.json) is a workflow of this example. + +![nudenet](nudenet.png) + + +# ONNX Models +* You can download various ONNX models from [here](https://github.com/PINTO0309/PINTO_model_zoo). \ No newline at end of file diff --git a/tutorial/nudenet.png b/tutorial/nudenet.png new file mode 100644 index 0000000..d2db26d Binary files /dev/null and b/tutorial/nudenet.png differ