requiresments

This commit is contained in:
abyz22
2024-02-19 08:34:53 +09:00
parent c4df555070
commit 7559db4ea2
6 changed files with 91 additions and 7 deletions
+2
View File
@@ -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",
}
+53 -2
View File
@@ -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
+32 -2
View File
@@ -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,
+1
View File
@@ -0,0 +1 @@
openpyxl
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -19,7 +19,7 @@ import nodes, folder_paths # 기본노드, 파일로드
# CATEGORY = "abyz22"
# def run(sefl,*args,**kwargs):
# def run(self,*args,**kwargs):
# return None