diff --git a/FaceDetailer.py b/FaceDetailer.py index 6697bea..87a3e66 100644 --- a/FaceDetailer.py +++ b/FaceDetailer.py @@ -1,26 +1,33 @@ import torch from mediapipe import solutions import cv2 -from colorama import init, Fore, Back, Style import numpy as np from PIL import Image, ImageFilter from ultralytics import YOLO import os +import comfy +import nodes +from folder_paths import base_path - -base_path = os.path.dirname(os.path.realpath(__file__)) -face_model_path = os.path.join( - base_path, "../../custom_nodes/facedetailer/yolo/face_yolov8n.pt") +face_model_path = os.path.join(base_path, "models/dz_facedetailer/yolo/face_yolov8n.pt") MASK_CONTROL = ["dilate", "erode", "disabled"] MASK_TYPE = ["box", "face"] -init() - class FaceDetailer: @classmethod def INPUT_TYPES(s): return {"required": { + "model": ("MODEL",), + "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, "step": 0.1, "round": 0.01}), + "sampler_name": (comfy.samplers.KSampler.SAMPLERS, ), + "scheduler": (comfy.samplers.KSampler.SCHEDULERS, ), + "positive": ("CONDITIONING", ), + "negative": ("CONDITIONING", ), + "latent_image": ("LATENT", ), + "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}), "latent_image": ("LATENT", ), "vae": ("VAE",), "mask_blur": ("INT", {"default": 0, "min": 0, "max": 100}), @@ -37,68 +44,46 @@ class FaceDetailer: CATEGORY = "face_detailer" - def detailer(self, latent_image, vae, mask_blur, mask_type, mask_control, dilate_mask_value, erode_mask_value): - - print(Fore.GREEN + "+ Face detailer initialized" + Style.RESET_ALL) - + def detailer(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise, vae, mask_blur, mask_type, mask_control, dilate_mask_value, erode_mask_value): # input latent decoded to tensor image for processing input_tensor_img = vae.decode(latent_image["samples"]) - # convert input latent to numpy array for yolo model img = image2nparray(input_tensor_img, False) - # Process the face mesh or make the face box for masking if mask_type == "box": try: final_mask = facebox_mask(img, mask_type) except: - print( - Fore.RED + "- Failed to make box mask! returning the input latent" + Style.RESET_ALL) return (latent_image, ) else: try: final_mask = facemesh_mask(img, mask_type) except: - print( - Fore.RED + "- Failed to make face mask! returning the input latent" + Style.RESET_ALL) return (latent_image, ) - - - # Erode/Dilate mask if mask_control == "dilate": if dilate_mask_value > 0: final_mask = dilate_mask(final_mask, dilate_mask_value) - else: - print(Fore.RED + "- Mask disabled due to value zero!" + - Style.RESET_ALL) elif mask_control == "erode": if erode_mask_value > 0: final_mask = erode_mask(final_mask, erode_mask_value) - else: - print(Fore.RED + "- Mask disabled due to value zero!" + - Style.RESET_ALL) - else: - print(Fore.RED + "- Mask control disabled, initializing masking without erode/dilate option!" + Style.RESET_ALL) - - if mask_blur > 0: + if mask_blur > 0: final_mask_image = Image.fromarray(final_mask) - blurred_mask_image = final_mask_image.filter(ImageFilter.GaussianBlur(radius=mask_blur)) - + blurred_mask_image = final_mask_image.filter( + ImageFilter.GaussianBlur(radius=mask_blur)) final_mask = np.array(blurred_mask_image) - - - final_mask = np.array(Image.fromarray(final_mask).getchannel('A')).astype(np.float32) / 255.0 + final_mask = np.array(Image.fromarray( + final_mask).getchannel('A')).astype(np.float32) / 255.0 # Convert mask to tensor and assign the mask to the input tensor final_mask = 1. - torch.from_numpy(final_mask) latent_mask = set_mask(latent_image, final_mask) - print(Fore.GREEN + - "+ Process finished, returning the new latent" + Style.RESET_ALL) + latent = nodes.common_ksampler( + model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_mask, denoise=denoise) - return (latent_mask, final_mask,) + return (latent[0], final_mask,) def facebox_mask(image, mask_type): @@ -128,13 +113,9 @@ def facebox_mask(image, mask_type): new_x_max = int(center_x + new_width / 2) new_y_max = int(center_y + new_height / 2) - print(Fore.GREEN + "+ Face found, starting masking process..." + Style.RESET_ALL) - print(Fore.GREEN + "+ Mask type:" + Style.RESET_ALL, mask_type) - # Create an empty image with alpha and set the square in the face location mask = np.zeros((image.shape[0], image.shape[1], 4), dtype=np.uint8) - cv2.rectangle(mask, (new_x_min, new_y_min), - (new_x_max, new_y_max), (0, 0, 0, 255), -1) + cv2.rectangle(mask, (new_x_min, new_y_min), (new_x_max, new_y_max), (0, 0, 0, 255), -1) mask[:, :, 3] = ~mask[:, :, 3] # invert the mask return mask @@ -144,8 +125,6 @@ def facemesh_mask(image, mask_type): mp_face_mesh = solutions.face_mesh face_mesh = mp_face_mesh.FaceMesh(static_image_mode=True, max_num_faces=1) results = face_mesh.process(cv2.cvtColor(image, cv2.COLOR_BGR2RGB)) - print(Fore.GREEN + "+ Face found, starting masking process..." + Style.RESET_ALL) - print(Fore.GREEN + "+ Mask type:" + Style.RESET_ALL, mask_type) if results.multi_face_landmarks: for face_landmarks in results.multi_face_landmarks: # List of detected face points @@ -196,8 +175,7 @@ def image2nparray(image, BGR): returns: Numpy array. """ - narray = np.clip(255. * image.cpu().numpy().squeeze(), - 0, 255).astype(np.uint8) + narray = np.clip(255. * image.cpu().numpy().squeeze(), 0, 255).astype(np.uint8) if BGR: return narray @@ -210,12 +188,3 @@ def set_mask(samples, mask): print(s) s["noise_mask"] = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])) return s - - -NODE_CLASS_MAPPINGS = { - "DZ_Face_Detailer": FaceDetailer, -} - -NODE_DISPLAY_NAME_MAPPINGS = { - "DZ_Face_Detailer": "Face Detailer", -} diff --git a/__init__.py b/__init__.py index 7702da2..ca17d2d 100644 --- a/__init__.py +++ b/__init__.py @@ -2,39 +2,68 @@ import requests import os, sys import subprocess - +from colorama import Fore, Back, Style +from tqdm import tqdm +from pip._internal import main as pip_main +from folder_paths import base_path +from pathlib import Path try: - print("!! Trying to start the node") - from .FaceDetailer import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS + print(Fore.GREEN + 'FaceDetailer: ' + f'{Fore.WHITE}Installing requirements' + Fore.RESET) + subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"]) except: - print("!! Requirements need to be installed") - my_path = os.path.dirname(__file__) - requirements_path = os.path.join(my_path, "requirements.txt") - print("!! Installing requirements...") - subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', requirements_path]) - print("!! Installing requirements finished...") - from .FaceDetailer import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS - + print(Fore.RED + 'FaceDetailer: ' + f'{Fore.WHITE}Installing requirements failed' + Fore.RESET) model = "https://huggingface.co/Bingsu/adetailer/resolve/main/face_yolov8n.pt" -save_loc = "./custom_nodes/facedetailer/yolo/face_yolov8n.pt" +save_loc = f"{base_path}\models\dz_facedetailer\yolo\/face_yolov8n.pt" save_dir = os.path.dirname(save_loc) -if not os.path.exists(save_dir): - print("!! Creating face_detailer models dir because it doesn't exist") - os.makedirs(save_dir) - - print("!! face_yolov8n model downloading...") - response = requests.get(model) - - if response.status_code == 200: - with open(save_loc, 'wb') as file: - file.write(response.content) - print("!! Model downloading finished.") +def download_model(): + if Path(save_loc).is_file(): + print(Fore.GREEN + 'FaceDetailer: ' + f'{Fore.WHITE}Model already exists' + Fore.RESET) else: - print("!! Error while download! Report the issue to the repo or download the face_yolov8n.pt model manually from Bingsu hugginface's and put in models/facedetailer/") + print(Fore.RED + 'FaceDetailer: ' + f'{Fore.WHITE}Model doesnt exist' + Fore.RESET) + print(Fore.GREEN + 'FaceDetailer: ' + f'{Fore.WHITE}Downloading model' + Fore.RESET) + response = requests.get(model, stream=True) + + try: + if response.status_code == 200: + total_size = int(response.headers.get('content-length', 0)) + block_size = 1024 # 1 Kibibyte + + # tqdm will display a progress bar + with open(save_loc, 'wb') as file, tqdm( + desc='Downloading', + total=total_size, + unit='iB', + unit_scale=True, + unit_divisor=1024, + ) as bar: + for data in response.iter_content(block_size): + bar.update(len(data)) + file.write(data) + + print(Fore.GREEN + 'FaceDetailer: ' + f'{Fore.WHITE}Model dowload finished' + Fore.RESET) + except requests.exceptions.RequestException as err: + print(Fore.RED + 'FaceDetailer: ' + f'{Fore.WHITE}Model download failed: {err}' + Fore.RESET) + print(Fore.RED + 'FaceDetailer: ' + f'{Fore.WHITE}Download it manually from: {model}' + Fore.RESET) + print(Fore.RED + 'FaceDetailer: ' + f'{Fore.WHITE}And put it in /comfyui/models/dz_facedetailer/yolo/' + Fore.RESET) + except Exception as e: + print(Fore.RED + 'FaceDetailer: ' + f'{Fore.WHITE}An unexpected error occurred: {e}' + Fore.RESET) + +if not os.path.exists(save_dir): + print(Fore.GREEN + 'FaceDetailer: ' + f'{Fore.WHITE}Creating models dir' + Fore.RESET) + os.makedirs(save_dir) +else: + print(Fore.GREEN + 'FaceDetailer: ' + f'{Fore.WHITE}Model dir already exists' + Fore.RESET) + download_model() + +from .FaceDetailer import FaceDetailer + +NODE_CLASS_MAPPINGS = { + "DZ_Face_Detailer": FaceDetailer, +} + -__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS'] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 617aa39..b4b2abb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ ultralytics mediapipe -pillow colorama diff --git a/workflow_example.json b/workflow_example.json new file mode 100644 index 0000000..b71c767 --- /dev/null +++ b/workflow_example.json @@ -0,0 +1,1505 @@ +{ + "last_node_id": 40, + "last_link_id": 91, + "nodes": [ + { + "id": 21, + "type": "Reroute", + "pos": [ + 187.97769512223223, + 848.2900504152276 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 57 + } + ], + "outputs": [ + { + "name": "", + "type": "CLIP", + "links": [ + 41 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 22, + "type": "Reroute", + "pos": [ + 752.977695122232, + 852.2900504152276 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 41 + } + ], + "outputs": [ + { + "name": "", + "type": "CLIP", + "links": [ + 42 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 13, + "type": "VAEDecode", + "pos": [ + 981, + -179 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 15, + "slot_index": 0 + }, + { + "name": "vae", + "type": "VAE", + "link": 72, + "slot_index": 1 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 46 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 27, + "type": "Reroute", + "pos": [ + 1917, + 76 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 83, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "LATENT", + "links": [ + 51 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 25, + "type": "Reroute", + "pos": [ + 1780, + 777 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 53, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "CONDITIONING", + "links": [ + 44 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 30, + "type": "Reroute", + "pos": [ + 93, + 373 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 54, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "CLIP", + "links": [ + 55, + 56, + 57 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + -285, + 186 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 58 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 54 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 61 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "majicmixSombre_v20.safetensors" + ] + }, + { + "id": 33, + "type": "Reroute", + "pos": [ + 1208, + 447 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 73, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "VAE", + "links": [ + 67, + 68 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 34, + "type": "Reroute", + "pos": [ + 936, + 146 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 71, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "VAE", + "links": [ + 72, + 73 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 32, + "type": "Reroute", + "pos": [ + 185, + 147 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 61, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "VAE", + "links": [ + 71 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 31, + "type": "Reroute", + "pos": [ + 199, + 64 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 58, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "MODEL", + "links": [ + 59, + 74 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 35, + "type": "Reroute", + "pos": [ + 1205, + 198 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 74, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "MODEL", + "links": [ + 75, + 84 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 28, + "type": "Reroute", + "pos": [ + 1202, + 777 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 52, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "CONDITIONING", + "links": [ + 53, + 86 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 240, + 461 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 55 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 52, + 91 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "ng_deepnegative_v1_75t, (badhandv4:1.2),(holding:1.3),(worst quality:1.3),(low quality:1.2), (normal quality:1.2),lowres, bad anatomy, bad hands,\n" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 23, + "type": "PreviewImage", + "pos": [ + 2905.4059446271544, + 391.4753301214381 + ], + "size": { + "0": 300.9404296875, + "1": 440.5021057128906 + }, + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 43, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 24, + "type": "Reroute", + "pos": [ + 2645, + -217 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 46, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 47 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 14, + "type": "PreviewImage", + "pos": [ + 3271.3467063344615, + 384.1296736506407 + ], + "size": { + "0": 318.26812744140625, + "1": 461.947265625 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 47 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 17, + "type": "DZ_Face_Detailer", + "pos": [ + 2085, + 327 + ], + "size": { + "0": 315, + "1": 402 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 75, + "slot_index": 0 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 34, + "slot_index": 1 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 44, + "slot_index": 2 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 51, + "slot_index": 3 + }, + { + "name": "vae", + "type": "VAE", + "link": 67, + "slot_index": 4 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 82 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": [ + 32 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "DZ_Face_Detailer" + }, + "widgets_values": [ + 18410413345179, + "randomize", + 20, + 7, + "ddim", + "karras", + 0.5, + 0, + "face", + "disabled", + 3, + 3 + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 19, + "type": "PreviewImage", + "pos": [ + 2468, + 496 + ], + "size": { + "0": 262.99151611328125, + "1": 385.7229309082031 + }, + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 33 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 18, + "type": "MaskToImage", + "pos": [ + 2442, + 423 + ], + "size": { + "0": 203.3360137939453, + "1": 26 + }, + "flags": { + "collapsed": true + }, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 32 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 33 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "MaskToImage" + } + }, + { + "id": 20, + "type": "CLIPTextEncode", + "pos": [ + 1492, + 343 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 42, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 34 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "beautiful detailed face, high details, fine details" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 26, + "type": "Reroute", + "pos": [ + 1024, + 1 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 48, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "", + "type": "LATENT", + "links": [ + 89 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 39, + "type": "LatentUpscaleBy", + "pos": [ + 1176, + 50 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": { + "collapsed": true + }, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 89, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 88 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LatentUpscaleBy" + }, + "widgets_values": [ + "nearest-exact", + 1.2 + ] + }, + { + "id": 38, + "type": "KSampler", + "pos": [ + 1472, + -45 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 84, + "slot_index": 0 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 87, + "slot_index": 1 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 86, + "slot_index": 2 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 88, + "slot_index": 3 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 83 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 815293448417225, + "randomize", + 15, + 7, + "euler_ancestral", + "karras", + 0.5 + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 2534, + 318 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": { + "collapsed": true + }, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 82, + "slot_index": 0 + }, + { + "name": "vae", + "type": "VAE", + "link": 68 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 43 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 132, + -178 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 56 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4, + 87 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "1girl, wearing a dress, standing,(masterpiece, high quality, best quality), volumatic light, ray tracing, extremely detailed CG unity 8k wallpaper,solo, ((flying petal)), outdoors, mountains, paths, (flowers, flower field), sunlight\n" + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 282, + 252 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 610, + -182 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 59 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 91, + "slot_index": 2 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 15, + 48 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 305757805868987, + "fixed", + 15, + 6, + "dpmpp_2m", + "karras", + 1 + ], + "color": "#223", + "bgcolor": "#335" + } + ], + "links": [ + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 15, + 3, + 0, + 13, + 0, + "LATENT" + ], + [ + 32, + 17, + 1, + 18, + 0, + "MASK" + ], + [ + 33, + 18, + 0, + 19, + 0, + "IMAGE" + ], + [ + 34, + 20, + 0, + 17, + 1, + "CONDITIONING" + ], + [ + 41, + 21, + 0, + 22, + 0, + "*" + ], + [ + 42, + 22, + 0, + 20, + 0, + "CLIP" + ], + [ + 43, + 8, + 0, + 23, + 0, + "IMAGE" + ], + [ + 44, + 25, + 0, + 17, + 2, + "CONDITIONING" + ], + [ + 46, + 13, + 0, + 24, + 0, + "*" + ], + [ + 47, + 24, + 0, + 14, + 0, + "IMAGE" + ], + [ + 48, + 3, + 0, + 26, + 0, + "*" + ], + [ + 51, + 27, + 0, + 17, + 3, + "LATENT" + ], + [ + 52, + 7, + 0, + 28, + 0, + "*" + ], + [ + 53, + 28, + 0, + 25, + 0, + "*" + ], + [ + 54, + 4, + 1, + 30, + 0, + "*" + ], + [ + 55, + 30, + 0, + 7, + 0, + "CLIP" + ], + [ + 56, + 30, + 0, + 6, + 0, + "CLIP" + ], + [ + 57, + 30, + 0, + 21, + 0, + "*" + ], + [ + 58, + 4, + 0, + 31, + 0, + "*" + ], + [ + 59, + 31, + 0, + 3, + 0, + "MODEL" + ], + [ + 61, + 4, + 2, + 32, + 0, + "*" + ], + [ + 67, + 33, + 0, + 17, + 4, + "VAE" + ], + [ + 68, + 33, + 0, + 8, + 1, + "VAE" + ], + [ + 71, + 32, + 0, + 34, + 0, + "*" + ], + [ + 72, + 34, + 0, + 13, + 1, + "VAE" + ], + [ + 73, + 34, + 0, + 33, + 0, + "*" + ], + [ + 74, + 31, + 0, + 35, + 0, + "*" + ], + [ + 75, + 35, + 0, + 17, + 0, + "MODEL" + ], + [ + 82, + 17, + 0, + 8, + 0, + "LATENT" + ], + [ + 83, + 38, + 0, + 27, + 0, + "*" + ], + [ + 84, + 35, + 0, + 38, + 0, + "MODEL" + ], + [ + 86, + 28, + 0, + 38, + 2, + "CONDITIONING" + ], + [ + 87, + 6, + 0, + 38, + 1, + "CONDITIONING" + ], + [ + 88, + 39, + 0, + 38, + 3, + "LATENT" + ], + [ + 89, + 26, + 0, + 39, + 0, + "LATENT" + ], + [ + 91, + 7, + 0, + 3, + 2, + "CONDITIONING" + ] + ], + "groups": [ + { + "title": "Detailer", + "bounding": [ + 1351, + 253, + 1415, + 686 + ], + "color": "#3f789e", + "font_size": 24 + }, + { + "title": "Detailer", + "bounding": [ + 2887, + 286, + 337, + 592 + ], + "color": "#8A8", + "font_size": 24 + }, + { + "title": "Sampler", + "bounding": [ + 93, + -279, + 1158, + 1325 + ], + "color": "#3f789e", + "font_size": 24 + }, + { + "title": "Without detailer", + "bounding": [ + 3236, + 284, + 378, + 592 + ], + "color": "#88A", + "font_size": 24 + } + ], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/yolo/face_yolov8n.pt b/yolo/face_yolov8n.pt deleted file mode 100644 index f2cdbe8..0000000 Binary files a/yolo/face_yolov8n.pt and /dev/null differ