-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Segment-Anything
- Loading branch information
Showing
82 changed files
with
5,894 additions
and
1,106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
from bizyair import BizyAirBaseNode, data_types | ||
from bizyair.path_utils import path_manager as folder_paths | ||
|
||
|
||
class InstantIDModelLoader(BizyAirBaseNode): | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"instantid_file": (folder_paths.get_filename_list("instantid"),) | ||
} | ||
} | ||
|
||
RETURN_TYPES = (data_types.INSTANTID,) | ||
FUNCTION = "default_function" | ||
CATEGORY = "InstantID" | ||
NODE_DISPLAY_NAME = "Load InstantID Model" | ||
|
||
|
||
class ApplyInstantID(BizyAirBaseNode): | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"instantid": (data_types.INSTANTID,), | ||
"insightface": (data_types.FACEANALYSIS,), | ||
"control_net": (data_types.CONTROL_NET,), | ||
"image": ("IMAGE",), | ||
"model": (data_types.MODEL,), | ||
"positive": (data_types.CONDITIONING,), | ||
"negative": (data_types.CONDITIONING,), | ||
"weight": ( | ||
"FLOAT", | ||
{ | ||
"default": 0.8, | ||
"min": 0.0, | ||
"max": 5.0, | ||
"step": 0.01, | ||
}, | ||
), | ||
"start_at": ( | ||
"FLOAT", | ||
{ | ||
"default": 0.0, | ||
"min": 0.0, | ||
"max": 1.0, | ||
"step": 0.001, | ||
}, | ||
), | ||
"end_at": ( | ||
"FLOAT", | ||
{ | ||
"default": 1.0, | ||
"min": 0.0, | ||
"max": 1.0, | ||
"step": 0.001, | ||
}, | ||
), | ||
}, | ||
"optional": { | ||
"image_kps": ("IMAGE",), | ||
"mask": ("MASK",), | ||
}, | ||
} | ||
|
||
RETURN_TYPES = ( | ||
data_types.MODEL, | ||
data_types.CONDITIONING, | ||
data_types.CONDITIONING, | ||
) | ||
RETURN_NAMES = ( | ||
"MODEL", | ||
"positive", | ||
"negative", | ||
) | ||
# FUNCTION = "apply_instantid" use default_function | ||
CATEGORY = "InstantID" | ||
NODE_DISPLAY_NAME = "Apply InstantID" | ||
|
||
|
||
class ApplyInstantIDAdvanced(ApplyInstantID): | ||
NODE_DISPLAY_NAME = "Apply InstantID Adavanced" | ||
|
||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"instantid": (data_types.INSTANTID,), | ||
"insightface": (data_types.FACEANALYSIS,), | ||
"control_net": (data_types.CONTROL_NET,), | ||
"image": ("IMAGE",), | ||
"model": (data_types.MODEL,), | ||
"positive": (data_types.CONDITIONING,), | ||
"negative": (data_types.CONDITIONING,), | ||
"ip_weight": ( | ||
"FLOAT", | ||
{ | ||
"default": 0.8, | ||
"min": 0.0, | ||
"max": 3.0, | ||
"step": 0.01, | ||
}, | ||
), | ||
"cn_strength": ( | ||
"FLOAT", | ||
{ | ||
"default": 0.8, | ||
"min": 0.0, | ||
"max": 10.0, | ||
"step": 0.01, | ||
}, | ||
), | ||
"start_at": ( | ||
"FLOAT", | ||
{ | ||
"default": 0.0, | ||
"min": 0.0, | ||
"max": 1.0, | ||
"step": 0.001, | ||
}, | ||
), | ||
"end_at": ( | ||
"FLOAT", | ||
{ | ||
"default": 1.0, | ||
"min": 0.0, | ||
"max": 1.0, | ||
"step": 0.001, | ||
}, | ||
), | ||
"noise": ( | ||
"FLOAT", | ||
{ | ||
"default": 0.0, | ||
"min": 0.0, | ||
"max": 1.0, | ||
"step": 0.1, | ||
}, | ||
), | ||
"combine_embeds": ( | ||
["average", "norm average", "concat"], | ||
{"default": "average"}, | ||
), | ||
}, | ||
"optional": { | ||
"image_kps": ("IMAGE",), | ||
"mask": ("MASK",), | ||
}, | ||
} | ||
|
||
|
||
class InstantIDFaceAnalysis(BizyAirBaseNode): | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"provider": (["CUDA"],), | ||
}, | ||
} | ||
|
||
RETURN_TYPES = (data_types.FACEANALYSIS,) | ||
# FUNCTION = "load_insight_face" | ||
CATEGORY = "InstantID" | ||
NODE_DISPLAY_NAME = "InstantID Face Analysis" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from comfy.cldm.control_types import UNION_CONTROLNET_TYPES | ||
|
||
from bizyair import BizyAirBaseNode, data_types | ||
|
||
|
||
class SetUnionControlNetType(BizyAirBaseNode): | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"control_net": (data_types.CONTROL_NET,), | ||
"type": (["auto"] + list(UNION_CONTROLNET_TYPES.keys()),), | ||
} | ||
} | ||
|
||
CATEGORY = "conditioning/controlnet" | ||
RETURN_TYPES = (data_types.CONTROL_NET,) | ||
|
||
# FUNCTION = "set_controlnet_type" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import os | ||
import urllib.request | ||
|
||
import folder_paths | ||
|
||
from bizyair import BizyAirBaseNode | ||
from bizyair.image_utils import encode_data | ||
from nodes import LoadImage | ||
|
||
|
||
class LoadImageURL(BizyAirBaseNode): | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"url": ( | ||
"STRING", | ||
{ | ||
"multiline": True, # True if you want the field to look like the one on the ClipTextEncode node | ||
"default": "url or path", | ||
"lazy": True, | ||
}, | ||
), | ||
}, | ||
} | ||
|
||
CATEGORY = "image_utils" | ||
RETURN_TYPES = ("IMAGE", "MASK") | ||
FUNCTION = "apply" | ||
NODE_DISPLAY_NAME = "Load Image (URL)" | ||
|
||
def apply(self, url: str): | ||
url = url.strip() | ||
input_dir = folder_paths.get_input_directory() | ||
filename = os.path.basename(url) | ||
file_path = os.path.join(input_dir, filename) | ||
|
||
# Check if the file already exists | ||
if os.path.exists(file_path): | ||
print(f"File {filename} already exists, skipping download.") | ||
else: | ||
# Download the image | ||
urllib.request.urlretrieve(url, file_path) | ||
print(f"Image successfully downloaded and saved as {filename}.") | ||
return LoadImage().load_image(filename) | ||
|
||
|
||
class Image_Encode(BizyAirBaseNode): | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": {"image": ("IMAGE",)}, | ||
"optional": { | ||
"lossless": ( | ||
"BOOLEAN", | ||
{"default": False, "label_on": "yes", "label_off": "no"}, | ||
), | ||
}, | ||
} | ||
|
||
CATEGORY = "image_utils" | ||
FUNCTION = "apply" | ||
RETURN_TYPES = ("IMAGE",) | ||
NODE_DISPLAY_NAME = "Image Encode" | ||
|
||
def apply(self, image, lossless=False): | ||
out = encode_data(image, lossless=lossless) | ||
return (out,) |
Oops, something went wrong.