diff --git a/__init__.py b/__init__.py index 3564876..41a1cda 100644 --- a/__init__.py +++ b/__init__.py @@ -31,6 +31,7 @@ NODE_CLASS_MAPPINGS = { "abyz22_Frompipe":abyz22_Frompipe, "abyz22_Editpipe":abyz22_Editpipe, "abyz22_Convertpipe":abyz22_Convertpipe, + "abyz22_RemoveControlnet":abyz22_RemoveControlnet, } # A dictionary that contains the friendly/humanly readable titles for the nodes @@ -57,4 +58,5 @@ NODE_DISPLAY_NAME_MAPPINGS = { "abyz22_Frompipe":"abyz22_Frompipe", "abyz22_Editpipe":"abyz22_Editpipe", "abyz22_Convertpipe":"abyz22_Convertpipe", + "abyz22_RemoveControlnet":"abyz22_RemoveControlnet", } diff --git a/outpainting_lama.py b/outpainting_lama.py index 1983aa3..9f87b46 100644 --- a/outpainting_lama.py +++ b/outpainting_lama.py @@ -16,6 +16,27 @@ from scipy import ndimage from torch import device import nodes +# class name: +# def __init__(self): +# pass + +# @classmethod +# def INPUT_TYPES(s): +# return { +# "required": {}, +# "optional": {}, +# } +# RETURN_TYPES = () +# RETURN_NAMES = () + +# FUNCTION = "run" + +# CATEGORY = "abyz22" + +# def run(self,*args,**kwargs): +# return None + + # Get the absolute path of various directories my_dir = os.path.dirname(os.path.abspath(__file__)) custom_nodes_dir = os.path.abspath(os.path.join(my_dir, "..")) @@ -365,7 +386,7 @@ class abyz22_lamaPreprocessor: encoded_image_dict = {"samples": encoded_image.cpu()} mask_with_1 = torch.ones_like(pixels[:, :, :, 0]) encoded_image_dict = SetLatentNoiseMask().set_mask(encoded_image_dict, mask_with_1)[0] - return (pixels.to("cuda" if torch.cuda.is_available() else "cpu"), encoded_image_dict) + return (pixels.to("cuda" if torch.cuda.is_available() else "cpu"), encoded_image_dict,pixels.to("cuda" if torch.cuda.is_available() else "cpu")) np.random.seed(seed) random.seed(seed) @@ -468,16 +489,18 @@ class abyz22_lamaPreprocessor: .permute(0, 2, 3, 1) .to("cuda" if torch.cuda.is_available() else "cpu") ) - return (img, encoded_image_dict) # image= 1,h,w,c 0.0~1.0 + return (img, encoded_image_dict,image[:,:,:,0:3].to("cuda" if torch.cuda.is_available() else "cpu")) # image= 1,h,w,c 0.0~1.0 # masks.to("cuda" if torch.cuda.is_available() else "cpu") RETURN_TYPES = ( "IMAGE", "LATENT", + "IMAGE", ) RETURN_NAMES = ( "LaMa Preprocessed Image", "LaMa Preprocessed Latent", + "LaMa Image" ) FUNCTION = "preprocess" CATEGORY = "abyz22" @@ -566,3 +589,31 @@ class abyz22_lamaInpaint: print(final_img.shape, final_img.min(), final_img.max()) return (final_img.to("cuda" if torch.cuda.is_available() else "cpu"), latent,lama_image) + +class abyz22_RemoveControlnet: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "Conditioning": ("CONDITIONING",), + "ControlNet": ("CONDITIONING",), + }, + } + + RETURN_TYPES = ("CONDITIONING",) + RETURN_NAMES = ('Conditioning',) + + FUNCTION = "run" + + CATEGORY = "abyz22" + + def run(self,*args,**kwargs): + print(kwargs['Conditioning'][0][1]) + print(len(kwargs['Conditioning'][0][1])) + print('☆★ '*20) + print(kwargs['ControlNet'][0][1]) + print(len(kwargs['ControlNet'][0][1])) + return None \ No newline at end of file diff --git a/outpainting_node.py b/outpainting_node.py index 759d58e..4b1260e 100644 --- a/outpainting_node.py +++ b/outpainting_node.py @@ -2,8 +2,27 @@ import math, cv2, random, torch, torchvision import numpy as np import nodes, folder_paths # 기본노드, 파일로드 -# padding1 conditioning -# padding2 conditioning's' (와카 여러개 된것 (프롬프트 여러개)) + +# class name: +# def __init__(self): +# pass + +# @classmethod +# def INPUT_TYPES(s): +# return { +# "required": {}, +# "optional": {}, +# } +# RETURN_TYPES = () +# RETURN_NAMES = () + +# FUNCTION = "run" + +# CATEGORY = "abyz22" + +# def run(self,*args,**kwargs): +# return None + def normalize_size_base_64(w, h): @@ -168,6 +187,17 @@ class abyz22_Pad_Image: latent = nodes.VAEEncode().encode(vae, final_image)[0] ctrl_net_load = nodes.ControlNetLoader().load_controlnet(control_net_name)[0] conditioning1 = nodes.ControlNetApply().apply_controlnet(conditioning, ctrl_net_load, final_pose_image, pose_strength)[0] + # print(len(conditioning)) + # print(len(conditioning[0])) + # print(len(conditioning[0][0])) + # print(len(conditioning[0][1])) + # print(conditioning[0][1]) + # print(' ☆★'*20) + # print(len(conditioning1)) + # print(len(conditioning1[0])) + # print(len(conditioning1[0][0])) + # print(len(conditioning1[0][1])) + # print(conditioning1[0][1]) return ( final_image, final_pose_image, diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a717bf1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +openpyxl \ No newline at end of file diff --git a/set_queue.py b/set_queue.py index e3949e3..f4fc495 100644 --- a/set_queue.py +++ b/set_queue.py @@ -121,7 +121,7 @@ class abyz22_SetQueue: "Num_of_Prompts": ("INT", {"default": 1, "min": 0, "max": 30, "step": 1}), "image_per_Prompt": ("INT", {"default": 24, "min": 1, "max": 30, "step": 1}), "batch_size": ("INT", {"default": 1, "min": 1, "max": 30, "step": 1}), - "temp": ("INT", {"default": 1, "min": 1, "max": 0xFFFFFFFFFFFFFFFF}), + "seed": ("INT", {"default": 1, "min": 1, "max": 0xFFFFFFFFFFFFFFFF}), "prompt": ("STRING", {"multiline": True}), }, } @@ -155,7 +155,7 @@ class abyz22_SetQueue: if (kwargs["Num_of_Prompts"] == 1) and (kwargs["prompt"] != ""): # 폴더1개만이고 프롬프트 있으면, self.prompt = kwargs["prompt"] else: - self.prompt = prompts_maker.make_prompt(mode=kwargs["mode_type"], etc=self.highest_num+1+self.cur_prompts) + self.prompt = prompts_maker.make_prompt(mode=kwargs["mode_type"], etc=self.highest_num+1+self.cur_prompts, seed=kwargs["seed"]) epath = "E:/stable-diffusion-webui/outputs/history.xlsx" T_workbook = load_workbook(epath, data_only=True) diff --git a/small_head.py b/small_head.py index 3b74bd3..4c3e4e5 100644 --- a/small_head.py +++ b/small_head.py @@ -19,7 +19,7 @@ import nodes, folder_paths # 기본노드, 파일로드 # CATEGORY = "abyz22" -# def run(sefl,*args,**kwargs): +# def run(self,*args,**kwargs): # return None