mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-08 08:12:34 +08:00
Merge c9e2893cbb into 31dd6c0531
This commit is contained in:
commit
96f009b667
140
nodes.py
140
nodes.py
@ -40,7 +40,7 @@ class CLIPTextEncode:
|
|||||||
RETURN_TYPES = ("CONDITIONING",)
|
RETURN_TYPES = ("CONDITIONING",)
|
||||||
FUNCTION = "encode"
|
FUNCTION = "encode"
|
||||||
|
|
||||||
CATEGORY = "conditioning"
|
CATEGORY = "Conditioning"
|
||||||
|
|
||||||
def encode(self, clip, text):
|
def encode(self, clip, text):
|
||||||
return ([[clip.encode(text), {}]], )
|
return ([[clip.encode(text), {}]], )
|
||||||
@ -52,7 +52,7 @@ class ConditioningCombine:
|
|||||||
RETURN_TYPES = ("CONDITIONING",)
|
RETURN_TYPES = ("CONDITIONING",)
|
||||||
FUNCTION = "combine"
|
FUNCTION = "combine"
|
||||||
|
|
||||||
CATEGORY = "conditioning"
|
CATEGORY = "Conditioning"
|
||||||
|
|
||||||
def combine(self, conditioning_1, conditioning_2):
|
def combine(self, conditioning_1, conditioning_2):
|
||||||
return (conditioning_1 + conditioning_2, )
|
return (conditioning_1 + conditioning_2, )
|
||||||
@ -70,7 +70,7 @@ class ConditioningSetArea:
|
|||||||
RETURN_TYPES = ("CONDITIONING",)
|
RETURN_TYPES = ("CONDITIONING",)
|
||||||
FUNCTION = "append"
|
FUNCTION = "append"
|
||||||
|
|
||||||
CATEGORY = "conditioning"
|
CATEGORY = "Conditioning"
|
||||||
|
|
||||||
def append(self, conditioning, width, height, x, y, strength, min_sigma=0.0, max_sigma=99.0):
|
def append(self, conditioning, width, height, x, y, strength, min_sigma=0.0, max_sigma=99.0):
|
||||||
c = []
|
c = []
|
||||||
@ -93,7 +93,7 @@ class VAEDecode:
|
|||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
FUNCTION = "decode"
|
FUNCTION = "decode"
|
||||||
|
|
||||||
CATEGORY = "latent"
|
CATEGORY = "Latent"
|
||||||
|
|
||||||
def decode(self, vae, samples):
|
def decode(self, vae, samples):
|
||||||
return (vae.decode(samples["samples"]), )
|
return (vae.decode(samples["samples"]), )
|
||||||
@ -123,7 +123,7 @@ class VAEEncode:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "encode"
|
FUNCTION = "encode"
|
||||||
|
|
||||||
CATEGORY = "latent"
|
CATEGORY = "Latent"
|
||||||
|
|
||||||
def encode(self, vae, pixels):
|
def encode(self, vae, pixels):
|
||||||
x = (pixels.shape[1] // 64) * 64
|
x = (pixels.shape[1] // 64) * 64
|
||||||
@ -165,7 +165,7 @@ class VAEEncodeForInpaint:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "encode"
|
FUNCTION = "encode"
|
||||||
|
|
||||||
CATEGORY = "latent/inpaint"
|
CATEGORY = "Latent/Inpaint"
|
||||||
|
|
||||||
def encode(self, vae, pixels, mask):
|
def encode(self, vae, pixels, mask):
|
||||||
x = (pixels.shape[1] // 64) * 64
|
x = (pixels.shape[1] // 64) * 64
|
||||||
@ -197,7 +197,7 @@ class CheckpointLoader:
|
|||||||
RETURN_TYPES = ("MODEL", "CLIP", "VAE")
|
RETURN_TYPES = ("MODEL", "CLIP", "VAE")
|
||||||
FUNCTION = "load_checkpoint"
|
FUNCTION = "load_checkpoint"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_checkpoint(self, config_name, ckpt_name, output_vae=True, output_clip=True):
|
def load_checkpoint(self, config_name, ckpt_name, output_vae=True, output_clip=True):
|
||||||
config_path = folder_paths.get_full_path("configs", config_name)
|
config_path = folder_paths.get_full_path("configs", config_name)
|
||||||
@ -212,7 +212,7 @@ class CheckpointLoaderSimple:
|
|||||||
RETURN_TYPES = ("MODEL", "CLIP", "VAE")
|
RETURN_TYPES = ("MODEL", "CLIP", "VAE")
|
||||||
FUNCTION = "load_checkpoint"
|
FUNCTION = "load_checkpoint"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True):
|
def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True):
|
||||||
ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
|
ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
|
||||||
@ -228,7 +228,7 @@ class CLIPSetLastLayer:
|
|||||||
RETURN_TYPES = ("CLIP",)
|
RETURN_TYPES = ("CLIP",)
|
||||||
FUNCTION = "set_last_layer"
|
FUNCTION = "set_last_layer"
|
||||||
|
|
||||||
CATEGORY = "conditioning"
|
CATEGORY = "Conditioning"
|
||||||
|
|
||||||
def set_last_layer(self, clip, stop_at_clip_layer):
|
def set_last_layer(self, clip, stop_at_clip_layer):
|
||||||
clip = clip.clone()
|
clip = clip.clone()
|
||||||
@ -247,7 +247,7 @@ class LoraLoader:
|
|||||||
RETURN_TYPES = ("MODEL", "CLIP")
|
RETURN_TYPES = ("MODEL", "CLIP")
|
||||||
FUNCTION = "load_lora"
|
FUNCTION = "load_lora"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_lora(self, model, clip, lora_name, strength_model, strength_clip):
|
def load_lora(self, model, clip, lora_name, strength_model, strength_clip):
|
||||||
lora_path = folder_paths.get_full_path("loras", lora_name)
|
lora_path = folder_paths.get_full_path("loras", lora_name)
|
||||||
@ -261,7 +261,7 @@ class VAELoader:
|
|||||||
RETURN_TYPES = ("VAE",)
|
RETURN_TYPES = ("VAE",)
|
||||||
FUNCTION = "load_vae"
|
FUNCTION = "load_vae"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
#TODO: scale factor?
|
#TODO: scale factor?
|
||||||
def load_vae(self, vae_name):
|
def load_vae(self, vae_name):
|
||||||
@ -277,7 +277,7 @@ class ControlNetLoader:
|
|||||||
RETURN_TYPES = ("CONTROL_NET",)
|
RETURN_TYPES = ("CONTROL_NET",)
|
||||||
FUNCTION = "load_controlnet"
|
FUNCTION = "load_controlnet"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_controlnet(self, control_net_name):
|
def load_controlnet(self, control_net_name):
|
||||||
controlnet_path = folder_paths.get_full_path("controlnet", control_net_name)
|
controlnet_path = folder_paths.get_full_path("controlnet", control_net_name)
|
||||||
@ -293,7 +293,7 @@ class DiffControlNetLoader:
|
|||||||
RETURN_TYPES = ("CONTROL_NET",)
|
RETURN_TYPES = ("CONTROL_NET",)
|
||||||
FUNCTION = "load_controlnet"
|
FUNCTION = "load_controlnet"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_controlnet(self, model, control_net_name):
|
def load_controlnet(self, model, control_net_name):
|
||||||
controlnet_path = folder_paths.get_full_path("controlnet", control_net_name)
|
controlnet_path = folder_paths.get_full_path("controlnet", control_net_name)
|
||||||
@ -312,7 +312,7 @@ class ControlNetApply:
|
|||||||
RETURN_TYPES = ("CONDITIONING",)
|
RETURN_TYPES = ("CONDITIONING",)
|
||||||
FUNCTION = "apply_controlnet"
|
FUNCTION = "apply_controlnet"
|
||||||
|
|
||||||
CATEGORY = "conditioning"
|
CATEGORY = "Conditioning"
|
||||||
|
|
||||||
def apply_controlnet(self, conditioning, control_net, image, strength):
|
def apply_controlnet(self, conditioning, control_net, image, strength):
|
||||||
c = []
|
c = []
|
||||||
@ -335,7 +335,7 @@ class CLIPLoader:
|
|||||||
RETURN_TYPES = ("CLIP",)
|
RETURN_TYPES = ("CLIP",)
|
||||||
FUNCTION = "load_clip"
|
FUNCTION = "load_clip"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_clip(self, clip_name):
|
def load_clip(self, clip_name):
|
||||||
clip_path = folder_paths.get_full_path("clip", clip_name)
|
clip_path = folder_paths.get_full_path("clip", clip_name)
|
||||||
@ -350,7 +350,7 @@ class CLIPVisionLoader:
|
|||||||
RETURN_TYPES = ("CLIP_VISION",)
|
RETURN_TYPES = ("CLIP_VISION",)
|
||||||
FUNCTION = "load_clip"
|
FUNCTION = "load_clip"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_clip(self, clip_name):
|
def load_clip(self, clip_name):
|
||||||
clip_path = folder_paths.get_full_path("clip_vision", clip_name)
|
clip_path = folder_paths.get_full_path("clip_vision", clip_name)
|
||||||
@ -366,7 +366,7 @@ class CLIPVisionEncode:
|
|||||||
RETURN_TYPES = ("CLIP_VISION_OUTPUT",)
|
RETURN_TYPES = ("CLIP_VISION_OUTPUT",)
|
||||||
FUNCTION = "encode"
|
FUNCTION = "encode"
|
||||||
|
|
||||||
CATEGORY = "conditioning/style_model"
|
CATEGORY = "Conditioning/Style Model"
|
||||||
|
|
||||||
def encode(self, clip_vision, image):
|
def encode(self, clip_vision, image):
|
||||||
output = clip_vision.encode_image(image)
|
output = clip_vision.encode_image(image)
|
||||||
@ -380,7 +380,7 @@ class StyleModelLoader:
|
|||||||
RETURN_TYPES = ("STYLE_MODEL",)
|
RETURN_TYPES = ("STYLE_MODEL",)
|
||||||
FUNCTION = "load_style_model"
|
FUNCTION = "load_style_model"
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
CATEGORY = "Loaders"
|
||||||
|
|
||||||
def load_style_model(self, style_model_name):
|
def load_style_model(self, style_model_name):
|
||||||
style_model_path = folder_paths.get_full_path("style_models", style_model_name)
|
style_model_path = folder_paths.get_full_path("style_models", style_model_name)
|
||||||
@ -398,7 +398,7 @@ class StyleModelApply:
|
|||||||
RETURN_TYPES = ("CONDITIONING",)
|
RETURN_TYPES = ("CONDITIONING",)
|
||||||
FUNCTION = "apply_stylemodel"
|
FUNCTION = "apply_stylemodel"
|
||||||
|
|
||||||
CATEGORY = "conditioning/style_model"
|
CATEGORY = "Conditioning/Style Model"
|
||||||
|
|
||||||
def apply_stylemodel(self, clip_vision_output, style_model, conditioning):
|
def apply_stylemodel(self, clip_vision_output, style_model, conditioning):
|
||||||
cond = style_model.get_cond(clip_vision_output)
|
cond = style_model.get_cond(clip_vision_output)
|
||||||
@ -420,7 +420,7 @@ class EmptyLatentImage:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "generate"
|
FUNCTION = "generate"
|
||||||
|
|
||||||
CATEGORY = "latent"
|
CATEGORY = "Latent"
|
||||||
|
|
||||||
def generate(self, width, height, batch_size=1):
|
def generate(self, width, height, batch_size=1):
|
||||||
latent = torch.zeros([batch_size, 4, height // 8, width // 8])
|
latent = torch.zeros([batch_size, 4, height // 8, width // 8])
|
||||||
@ -441,7 +441,7 @@ class LatentUpscale:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "upscale"
|
FUNCTION = "upscale"
|
||||||
|
|
||||||
CATEGORY = "latent"
|
CATEGORY = "Latent"
|
||||||
|
|
||||||
def upscale(self, samples, upscale_method, width, height, crop):
|
def upscale(self, samples, upscale_method, width, height, crop):
|
||||||
s = samples.copy()
|
s = samples.copy()
|
||||||
@ -457,7 +457,7 @@ class LatentRotate:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "rotate"
|
FUNCTION = "rotate"
|
||||||
|
|
||||||
CATEGORY = "latent/transform"
|
CATEGORY = "Latent/Transform"
|
||||||
|
|
||||||
def rotate(self, samples, rotation):
|
def rotate(self, samples, rotation):
|
||||||
s = samples.copy()
|
s = samples.copy()
|
||||||
@ -481,7 +481,7 @@ class LatentFlip:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "flip"
|
FUNCTION = "flip"
|
||||||
|
|
||||||
CATEGORY = "latent/transform"
|
CATEGORY = "Latent/Transform"
|
||||||
|
|
||||||
def flip(self, samples, flip_method):
|
def flip(self, samples, flip_method):
|
||||||
s = samples.copy()
|
s = samples.copy()
|
||||||
@ -504,7 +504,7 @@ class LatentComposite:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "composite"
|
FUNCTION = "composite"
|
||||||
|
|
||||||
CATEGORY = "latent"
|
CATEGORY = "Latent"
|
||||||
|
|
||||||
def composite(self, samples_to, samples_from, x, y, composite_method="normal", feather=0):
|
def composite(self, samples_to, samples_from, x, y, composite_method="normal", feather=0):
|
||||||
x = x // 8
|
x = x // 8
|
||||||
@ -546,7 +546,7 @@ class LatentCrop:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "crop"
|
FUNCTION = "crop"
|
||||||
|
|
||||||
CATEGORY = "latent/transform"
|
CATEGORY = "Latent/Transform"
|
||||||
|
|
||||||
def crop(self, samples, width, height, x, y):
|
def crop(self, samples, width, height, x, y):
|
||||||
s = samples.copy()
|
s = samples.copy()
|
||||||
@ -586,7 +586,7 @@ class SetLatentNoiseMask:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "set_mask"
|
FUNCTION = "set_mask"
|
||||||
|
|
||||||
CATEGORY = "latent/inpaint"
|
CATEGORY = "Latent/Inpaint"
|
||||||
|
|
||||||
def set_mask(self, samples, mask):
|
def set_mask(self, samples, mask):
|
||||||
s = samples.copy()
|
s = samples.copy()
|
||||||
@ -679,7 +679,7 @@ class KSampler:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "sample"
|
FUNCTION = "sample"
|
||||||
|
|
||||||
CATEGORY = "sampling"
|
CATEGORY = "Sampling"
|
||||||
|
|
||||||
def sample(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=1.0):
|
def sample(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=1.0):
|
||||||
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
|
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
|
||||||
@ -706,7 +706,7 @@ class KSamplerAdvanced:
|
|||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "sample"
|
FUNCTION = "sample"
|
||||||
|
|
||||||
CATEGORY = "sampling"
|
CATEGORY = "Sampling"
|
||||||
|
|
||||||
def sample(self, model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0):
|
def sample(self, model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0):
|
||||||
force_full_denoise = True
|
force_full_denoise = True
|
||||||
@ -735,7 +735,7 @@ class SaveImage:
|
|||||||
|
|
||||||
OUTPUT_NODE = True
|
OUTPUT_NODE = True
|
||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "Image"
|
||||||
|
|
||||||
def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
|
def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
|
||||||
def map_filename(filename):
|
def map_filename(filename):
|
||||||
@ -818,7 +818,7 @@ class LoadImage:
|
|||||||
{"image": (sorted(os.listdir(s.input_dir)), )},
|
{"image": (sorted(os.listdir(s.input_dir)), )},
|
||||||
}
|
}
|
||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "Image"
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE", "MASK")
|
RETURN_TYPES = ("IMAGE", "MASK")
|
||||||
FUNCTION = "load_image"
|
FUNCTION = "load_image"
|
||||||
@ -852,7 +852,7 @@ class LoadImageMask:
|
|||||||
"channel": (["alpha", "red", "green", "blue"], ),}
|
"channel": (["alpha", "red", "green", "blue"], ),}
|
||||||
}
|
}
|
||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "Image"
|
||||||
|
|
||||||
RETURN_TYPES = ("MASK",)
|
RETURN_TYPES = ("MASK",)
|
||||||
FUNCTION = "load_image"
|
FUNCTION = "load_image"
|
||||||
@ -891,7 +891,7 @@ class ImageScale:
|
|||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
FUNCTION = "upscale"
|
FUNCTION = "upscale"
|
||||||
|
|
||||||
CATEGORY = "image/upscaling"
|
CATEGORY = "Image/Upscaling"
|
||||||
|
|
||||||
def upscale(self, image, upscale_method, width, height, crop):
|
def upscale(self, image, upscale_method, width, height, crop):
|
||||||
samples = image.movedim(-1,1)
|
samples = image.movedim(-1,1)
|
||||||
@ -908,7 +908,7 @@ class ImageInvert:
|
|||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
FUNCTION = "invert"
|
FUNCTION = "invert"
|
||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "Image"
|
||||||
|
|
||||||
def invert(self, image):
|
def invert(self, image):
|
||||||
s = 1.0 - image
|
s = 1.0 - image
|
||||||
@ -933,7 +933,7 @@ class ImagePadForOutpaint:
|
|||||||
RETURN_TYPES = ("IMAGE", "MASK")
|
RETURN_TYPES = ("IMAGE", "MASK")
|
||||||
FUNCTION = "expand_image"
|
FUNCTION = "expand_image"
|
||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "Image"
|
||||||
|
|
||||||
def expand_image(self, image, left, top, right, bottom, feathering):
|
def expand_image(self, image, left, top, right, bottom, feathering):
|
||||||
d1, d2, d3, d4 = image.size()
|
d1, d2, d3, d4 = image.size()
|
||||||
@ -979,43 +979,43 @@ class ImagePadForOutpaint:
|
|||||||
|
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
|
"CLIP Loader": CLIPLoader,
|
||||||
|
"CLIP Set Last Layer": CLIPSetLastLayer,
|
||||||
|
"CLIP Text Encode": CLIPTextEncode,
|
||||||
|
"CLIP Vision Encode": CLIPVisionEncode,
|
||||||
|
"CLIP Vision Loader": CLIPVisionLoader,
|
||||||
|
"Checkpoint Loader": CheckpointLoader,
|
||||||
|
"Checkpoint Loader (Simple)": CheckpointLoaderSimple,
|
||||||
|
"Conditioning Combine": ConditioningCombine,
|
||||||
|
"Conditioning Set Area": ConditioningSetArea,
|
||||||
|
"ControlNet Apply": ControlNetApply,
|
||||||
|
"ControlNet Loader": ControlNetLoader,
|
||||||
|
"Diff ControlNet Loader": DiffControlNetLoader,
|
||||||
|
"Empty Latent Image": EmptyLatentImage,
|
||||||
|
"Image Invert": ImageInvert,
|
||||||
|
"Image Padding (Outpaint)": ImagePadForOutpaint,
|
||||||
|
"Image Scale": ImageScale,
|
||||||
"KSampler": KSampler,
|
"KSampler": KSampler,
|
||||||
"CheckpointLoader": CheckpointLoader,
|
"KSampler (Advanced)": KSamplerAdvanced,
|
||||||
"CheckpointLoaderSimple": CheckpointLoaderSimple,
|
"Latent Composite": LatentComposite,
|
||||||
"CLIPTextEncode": CLIPTextEncode,
|
"Latent Crop": LatentCrop,
|
||||||
"CLIPSetLastLayer": CLIPSetLastLayer,
|
"Latent Flip": LatentFlip,
|
||||||
"VAEDecode": VAEDecode,
|
"Latent Rotate": LatentRotate,
|
||||||
"VAEEncode": VAEEncode,
|
"Latent Upscale": LatentUpscale,
|
||||||
"VAEEncodeForInpaint": VAEEncodeForInpaint,
|
"Load Image": LoadImage,
|
||||||
"VAELoader": VAELoader,
|
"Load Image Mask": LoadImageMask,
|
||||||
"EmptyLatentImage": EmptyLatentImage,
|
"Lora Loader": LoraLoader,
|
||||||
"LatentUpscale": LatentUpscale,
|
"Preview Image": PreviewImage,
|
||||||
"SaveImage": SaveImage,
|
"Save Image": SaveImage,
|
||||||
"PreviewImage": PreviewImage,
|
"Mask Latent Noise": SetLatentNoiseMask,
|
||||||
"LoadImage": LoadImage,
|
"Style Model Apply": StyleModelApply,
|
||||||
"LoadImageMask": LoadImageMask,
|
"Style Model Loader": StyleModelLoader,
|
||||||
"ImageScale": ImageScale,
|
"VAE Decode": VAEDecode,
|
||||||
"ImageInvert": ImageInvert,
|
"VAE Decode (Tiled)": VAEDecodeTiled,
|
||||||
"ImagePadForOutpaint": ImagePadForOutpaint,
|
"VAE Encode": VAEEncode,
|
||||||
"ConditioningCombine": ConditioningCombine,
|
"VAE Encode (Inpaint)": VAEEncodeForInpaint,
|
||||||
"ConditioningSetArea": ConditioningSetArea,
|
"VAE Encode (Tiled)": VAEEncodeTiled,
|
||||||
"KSamplerAdvanced": KSamplerAdvanced,
|
"VAE Loader": VAELoader,
|
||||||
"SetLatentNoiseMask": SetLatentNoiseMask,
|
|
||||||
"LatentComposite": LatentComposite,
|
|
||||||
"LatentRotate": LatentRotate,
|
|
||||||
"LatentFlip": LatentFlip,
|
|
||||||
"LatentCrop": LatentCrop,
|
|
||||||
"LoraLoader": LoraLoader,
|
|
||||||
"CLIPLoader": CLIPLoader,
|
|
||||||
"CLIPVisionEncode": CLIPVisionEncode,
|
|
||||||
"StyleModelApply": StyleModelApply,
|
|
||||||
"ControlNetApply": ControlNetApply,
|
|
||||||
"ControlNetLoader": ControlNetLoader,
|
|
||||||
"DiffControlNetLoader": DiffControlNetLoader,
|
|
||||||
"StyleModelLoader": StyleModelLoader,
|
|
||||||
"CLIPVisionLoader": CLIPVisionLoader,
|
|
||||||
"VAEDecodeTiled": VAEDecodeTiled,
|
|
||||||
"VAEEncodeTiled": VAEEncodeTiled,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def load_custom_node(module_path):
|
def load_custom_node(module_path):
|
||||||
|
|||||||
@ -189,6 +189,6 @@ app.registerExtension({
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
RerouteNode.category = "utils";
|
RerouteNode.category = "Utilities";
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -357,6 +357,6 @@ app.registerExtension({
|
|||||||
title: "Primitive",
|
title: "Primitive",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
PrimitiveNode.category = "utils";
|
PrimitiveNode.category = "Utilities";
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -313,7 +313,7 @@ export class ComfyUI {
|
|||||||
this.menuContainer = $el("div.comfy-menu", { parent: document.body }, [
|
this.menuContainer = $el("div.comfy-menu", { parent: document.body }, [
|
||||||
$el("div", { style: { overflow: "hidden", position: "relative", width: "100%" } }, [
|
$el("div", { style: { overflow: "hidden", position: "relative", width: "100%" } }, [
|
||||||
$el("span.drag-handle"),
|
$el("span.drag-handle"),
|
||||||
$el("span", { $: (q) => (this.queueSize = q) }),
|
$el("span", { className: "comfy-queue-size", $: (q) => (this.queueSize = q) }),
|
||||||
$el("button.comfy-settings-btn", { textContent: "⚙️", onclick: () => this.settings.show() }),
|
$el("button.comfy-settings-btn", { textContent: "⚙️", onclick: () => this.settings.show() }),
|
||||||
]),
|
]),
|
||||||
$el("button.comfy-queue-btn", { textContent: "Queue Prompt", onclick: () => app.queuePrompt(0, this.batchCount) }),
|
$el("button.comfy-queue-btn", { textContent: "Queue Prompt", onclick: () => app.queuePrompt(0, this.batchCount) }),
|
||||||
@ -347,10 +347,11 @@ export class ComfyUI {
|
|||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
$el("div.comfy-menu-btns", [
|
$el("div.comfy-menu-btns", [
|
||||||
$el("button", { textContent: "Queue Front", onclick: () => app.queuePrompt(-1, this.batchCount) }),
|
$el("button", { textContent: "Queue Front", className: "comfy-queue-front-btn", onclick: () => app.queuePrompt(-1, this.batchCount) }),
|
||||||
$el("button", {
|
$el("button", {
|
||||||
$: (b) => (this.queue.button = b),
|
$: (b) => (this.queue.button = b),
|
||||||
textContent: "View Queue",
|
textContent: "View Queue",
|
||||||
|
className: "comfy-view-queue-btn",
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
this.history.hide();
|
this.history.hide();
|
||||||
this.queue.toggle();
|
this.queue.toggle();
|
||||||
@ -359,6 +360,7 @@ export class ComfyUI {
|
|||||||
$el("button", {
|
$el("button", {
|
||||||
$: (b) => (this.history.button = b),
|
$: (b) => (this.history.button = b),
|
||||||
textContent: "View History",
|
textContent: "View History",
|
||||||
|
className: "comfy-history-btn",
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
this.queue.hide();
|
this.queue.hide();
|
||||||
this.history.toggle();
|
this.history.toggle();
|
||||||
@ -369,6 +371,7 @@ export class ComfyUI {
|
|||||||
this.history.element,
|
this.history.element,
|
||||||
$el("button", {
|
$el("button", {
|
||||||
textContent: "Save",
|
textContent: "Save",
|
||||||
|
className: "comfy-save-btn",
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
const json = JSON.stringify(app.graph.serialize(), null, 2); // convert the data to a JSON string
|
const json = JSON.stringify(app.graph.serialize(), null, 2); // convert the data to a JSON string
|
||||||
const blob = new Blob([json], { type: "application/json" });
|
const blob = new Blob([json], { type: "application/json" });
|
||||||
@ -386,10 +389,10 @@ export class ComfyUI {
|
|||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
$el("button", { textContent: "Load", onclick: () => fileInput.click() }),
|
$el("button", { textContent: "Load", className: "comfy-load-btn", onclick: () => fileInput.click() }),
|
||||||
$el("button", { textContent: "Refresh", onclick: () => app.refreshComboInNodes() }),
|
$el("button", { textContent: "Clear", className: "comfy-clear-btn", onclick: () => app.graph.clear() }),
|
||||||
$el("button", { textContent: "Clear", onclick: () => app.graph.clear() }),
|
$el("button", { textContent: "Refresh", className: "comfy-refresh-btn" onclick: () => app.refreshComboInNodes() }),
|
||||||
$el("button", { textContent: "Load Default", onclick: () => app.loadGraphData() }),
|
$el("button", { textContent: "Load Default", className: "comfy-load-default-btn", onclick: () => app.loadGraphData() }),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
dragElement(this.menuContainer);
|
dragElement(this.menuContainer);
|
||||||
|
|||||||
@ -88,23 +88,48 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.comfy-menu {
|
.comfy-menu {
|
||||||
width: 200px;
|
width: 250px !important;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: 0%;
|
right: 0%;
|
||||||
background-color: white;
|
background: rgba(68,68,68,0.75);
|
||||||
color: #000;
|
background: linear-gradient(0deg, rgba(68,68,68,0.75) 0%, rgba(102,102,102,0.75) 74%, rgba(119,119,119,0.75) 100%);
|
||||||
|
backdrop-filter: blur(30px);
|
||||||
|
color: #CACACA;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
text-shadow: 1px 0 1px rgba(0,0,0,0.25);
|
||||||
|
font-family: Helvetica;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
width: 170px;
|
width: 170px;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
box-shadow: 0px 0px 30px rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-queue-size {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-top:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-menu button {
|
.comfy-menu button {
|
||||||
font-size: 20px;
|
cursor: pointer;
|
||||||
|
display: inline !important;
|
||||||
|
font-size: 18px;
|
||||||
|
text-shadow: 1px 0 1px rgba(0,0,0,0.25);
|
||||||
|
font-family: Helvetica;
|
||||||
|
border-radius: 0;
|
||||||
|
background-color: #8899aa;
|
||||||
|
border-left: 0;
|
||||||
|
border-right: 0;
|
||||||
|
border-top: 1px solid rgba(255,255,255,0.5);
|
||||||
|
border-bottom: 1px solid rgba(127,127,127,0.5);
|
||||||
|
color: #FFF;
|
||||||
|
transition: background-color .1s ease-in-out
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-menu button:hover {
|
||||||
|
background-color: #6686a5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-menu-btns {
|
.comfy-menu-btns {
|
||||||
@ -114,7 +139,6 @@ body {
|
|||||||
|
|
||||||
.comfy-menu-btns button {
|
.comfy-menu-btns button {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
width: 50%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-menu span.drag-handle {
|
.comfy-menu span.drag-handle {
|
||||||
@ -130,9 +154,9 @@ body {
|
|||||||
margin-left: -.2em;
|
margin-left: -.2em;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
|
text-shadow: 1px 1px 1px rgba(0,0,0,0.25);
|
||||||
letter-spacing: 2px;
|
letter-spacing: 2px;
|
||||||
color: #cccccc;
|
color: #cccccc;
|
||||||
text-shadow: 1px 0 1px black;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -143,18 +167,57 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.comfy-queue-btn {
|
.comfy-queue-btn {
|
||||||
|
font-size: 20px !important;
|
||||||
|
font-weight: 600;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
background-color: #69b768 !important
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-queue-btn:hover {
|
||||||
|
background-color: #42b240 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-queue-front-btn {
|
||||||
|
width: 50%;
|
||||||
|
border-right: 1px solid rgba(0,0,0,0.25) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-view-queue-btn {
|
||||||
|
width: 50%;
|
||||||
|
border-left: 1px solid rgba(255,255,255,0.25) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-history-btn {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-save-btn {
|
||||||
|
width: 50%;
|
||||||
|
border-right: 1px solid rgba(0,0,0,0.25) !important;
|
||||||
|
}
|
||||||
|
.comfy-load-btn {
|
||||||
|
width: 50%;
|
||||||
|
border-left: 1px solid rgba(255,255,255,0.25) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-clear-btn {
|
||||||
|
width: 50%;
|
||||||
|
border-right: 1px solid rgba(0,0,0,0.25) !important;
|
||||||
|
}
|
||||||
|
.comfy-load-default-btn {
|
||||||
|
width: 50%;
|
||||||
|
border-left: 1px solid rgba(255,255,255,0.25) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-list {
|
.comfy-list {
|
||||||
background-color: rgb(225, 225, 225);
|
background-color: rgba(0,0,0,0.25);
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-list-items {
|
.comfy-list-items {
|
||||||
overflow-y: scroll;
|
overflow-y: auto;
|
||||||
max-height: 100px;
|
max-height: 100px;
|
||||||
background-color: #d0d0d0;
|
background-color: rgba(0,0,0,0.25);
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,6 +249,8 @@ button.comfy-settings-btn {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
border: none;
|
border: none;
|
||||||
|
background: none;
|
||||||
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-modal.comfy-settings {
|
.comfy-modal.comfy-settings {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user