mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-09 10:53:31 +08:00
Merge branch 'master' into download-api-add-directory-input
This commit is contained in:
commit
db1814cc44
@ -118,6 +118,29 @@ class UserManager():
|
|||||||
|
|
||||||
@routes.get("/userdata")
|
@routes.get("/userdata")
|
||||||
async def listuserdata(request):
|
async def listuserdata(request):
|
||||||
|
"""
|
||||||
|
List user data files in a specified directory.
|
||||||
|
|
||||||
|
This endpoint allows listing files in a user's data directory, with options for recursion,
|
||||||
|
full file information, and path splitting.
|
||||||
|
|
||||||
|
Query Parameters:
|
||||||
|
- dir (required): The directory to list files from.
|
||||||
|
- recurse (optional): If "true", recursively list files in subdirectories.
|
||||||
|
- full_info (optional): If "true", return detailed file information (path, size, modified time).
|
||||||
|
- split (optional): If "true", split file paths into components (only applies when full_info is false).
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
- 400: If 'dir' parameter is missing.
|
||||||
|
- 403: If the requested path is not allowed.
|
||||||
|
- 404: If the requested directory does not exist.
|
||||||
|
- 200: JSON response with the list of files or file information.
|
||||||
|
|
||||||
|
The response format depends on the query parameters:
|
||||||
|
- Default: List of relative file paths.
|
||||||
|
- full_info=true: List of dictionaries with file details.
|
||||||
|
- split=true (and full_info=false): List of lists, each containing path components.
|
||||||
|
"""
|
||||||
directory = request.rel_url.query.get('dir', '')
|
directory = request.rel_url.query.get('dir', '')
|
||||||
if not directory:
|
if not directory:
|
||||||
return web.Response(status=400, text="Directory not provided")
|
return web.Response(status=400, text="Directory not provided")
|
||||||
|
|||||||
@ -88,6 +88,8 @@ class ControlBase:
|
|||||||
self.strength = strength
|
self.strength = strength
|
||||||
self.timestep_percent_range = timestep_percent_range
|
self.timestep_percent_range = timestep_percent_range
|
||||||
if self.latent_format is not None:
|
if self.latent_format is not None:
|
||||||
|
if vae is None:
|
||||||
|
logging.warning("WARNING: no VAE provided to the controlnet apply node when this controlnet requires one.")
|
||||||
self.vae = vae
|
self.vae = vae
|
||||||
self.extra_concat_orig = extra_concat.copy()
|
self.extra_concat_orig = extra_concat.copy()
|
||||||
if self.concat_mask and len(self.extra_concat_orig) == 0:
|
if self.concat_mask and len(self.extra_concat_orig) == 0:
|
||||||
@ -222,6 +224,9 @@ class ControlNet(ControlBase):
|
|||||||
compression_ratio = self.compression_ratio
|
compression_ratio = self.compression_ratio
|
||||||
if self.vae is not None:
|
if self.vae is not None:
|
||||||
compression_ratio *= self.vae.downscale_ratio
|
compression_ratio *= self.vae.downscale_ratio
|
||||||
|
else:
|
||||||
|
if self.latent_format is not None:
|
||||||
|
raise ValueError("This Controlnet needs a VAE but none was provided, please use a ControlNetApply node with a VAE input and connect it.")
|
||||||
self.cond_hint = comfy.utils.common_upscale(self.cond_hint_original, x_noisy.shape[3] * compression_ratio, x_noisy.shape[2] * compression_ratio, self.upscale_algorithm, "center")
|
self.cond_hint = comfy.utils.common_upscale(self.cond_hint_original, x_noisy.shape[3] * compression_ratio, x_noisy.shape[2] * compression_ratio, self.upscale_algorithm, "center")
|
||||||
if self.vae is not None:
|
if self.vae is not None:
|
||||||
loaded_models = comfy.model_management.loaded_models(only_currently_used=True)
|
loaded_models = comfy.model_management.loaded_models(only_currently_used=True)
|
||||||
@ -335,7 +340,7 @@ class ControlLoraOps:
|
|||||||
|
|
||||||
|
|
||||||
class ControlLora(ControlNet):
|
class ControlLora(ControlNet):
|
||||||
def __init__(self, control_weights, global_average_pooling=False, device=None):
|
def __init__(self, control_weights, global_average_pooling=False, device=None, model_options={}): #TODO? model_options
|
||||||
ControlBase.__init__(self, device)
|
ControlBase.__init__(self, device)
|
||||||
self.control_weights = control_weights
|
self.control_weights = control_weights
|
||||||
self.global_average_pooling = global_average_pooling
|
self.global_average_pooling = global_average_pooling
|
||||||
@ -392,19 +397,25 @@ class ControlLora(ControlNet):
|
|||||||
def inference_memory_requirements(self, dtype):
|
def inference_memory_requirements(self, dtype):
|
||||||
return comfy.utils.calculate_parameters(self.control_weights) * comfy.model_management.dtype_size(dtype) + ControlBase.inference_memory_requirements(self, dtype)
|
return comfy.utils.calculate_parameters(self.control_weights) * comfy.model_management.dtype_size(dtype) + ControlBase.inference_memory_requirements(self, dtype)
|
||||||
|
|
||||||
def controlnet_config(sd):
|
def controlnet_config(sd, model_options={}):
|
||||||
model_config = comfy.model_detection.model_config_from_unet(sd, "", True)
|
model_config = comfy.model_detection.model_config_from_unet(sd, "", True)
|
||||||
|
|
||||||
supported_inference_dtypes = model_config.supported_inference_dtypes
|
unet_dtype = model_options.get("dtype", None)
|
||||||
|
if unet_dtype is None:
|
||||||
|
weight_dtype = comfy.utils.weight_dtype(sd)
|
||||||
|
|
||||||
|
supported_inference_dtypes = list(model_config.supported_inference_dtypes)
|
||||||
|
if weight_dtype is not None:
|
||||||
|
supported_inference_dtypes.append(weight_dtype)
|
||||||
|
|
||||||
|
unet_dtype = comfy.model_management.unet_dtype(model_params=-1, supported_dtypes=supported_inference_dtypes)
|
||||||
|
|
||||||
controlnet_config = model_config.unet_config
|
|
||||||
unet_dtype = comfy.model_management.unet_dtype(supported_dtypes=supported_inference_dtypes)
|
|
||||||
load_device = comfy.model_management.get_torch_device()
|
load_device = comfy.model_management.get_torch_device()
|
||||||
manual_cast_dtype = comfy.model_management.unet_manual_cast(unet_dtype, load_device)
|
manual_cast_dtype = comfy.model_management.unet_manual_cast(unet_dtype, load_device)
|
||||||
if manual_cast_dtype is not None:
|
|
||||||
operations = comfy.ops.manual_cast
|
operations = model_options.get("custom_operations", None)
|
||||||
else:
|
if operations is None:
|
||||||
operations = comfy.ops.disable_weight_init
|
operations = comfy.ops.pick_operations(unet_dtype, manual_cast_dtype, disable_fast_fp8=True)
|
||||||
|
|
||||||
offload_device = comfy.model_management.unet_offload_device()
|
offload_device = comfy.model_management.unet_offload_device()
|
||||||
return model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device
|
return model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device
|
||||||
@ -419,9 +430,9 @@ def controlnet_load_state_dict(control_model, sd):
|
|||||||
logging.debug("unexpected controlnet keys: {}".format(unexpected))
|
logging.debug("unexpected controlnet keys: {}".format(unexpected))
|
||||||
return control_model
|
return control_model
|
||||||
|
|
||||||
def load_controlnet_mmdit(sd):
|
def load_controlnet_mmdit(sd, model_options={}):
|
||||||
new_sd = comfy.model_detection.convert_diffusers_mmdit(sd, "")
|
new_sd = comfy.model_detection.convert_diffusers_mmdit(sd, "")
|
||||||
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(new_sd)
|
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(new_sd, model_options=model_options)
|
||||||
num_blocks = comfy.model_detection.count_blocks(new_sd, 'joint_blocks.{}.')
|
num_blocks = comfy.model_detection.count_blocks(new_sd, 'joint_blocks.{}.')
|
||||||
for k in sd:
|
for k in sd:
|
||||||
new_sd[k] = sd[k]
|
new_sd[k] = sd[k]
|
||||||
@ -440,8 +451,8 @@ def load_controlnet_mmdit(sd):
|
|||||||
return control
|
return control
|
||||||
|
|
||||||
|
|
||||||
def load_controlnet_hunyuandit(controlnet_data):
|
def load_controlnet_hunyuandit(controlnet_data, model_options={}):
|
||||||
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(controlnet_data)
|
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(controlnet_data, model_options=model_options)
|
||||||
|
|
||||||
control_model = comfy.ldm.hydit.controlnet.HunYuanControlNet(operations=operations, device=offload_device, dtype=unet_dtype)
|
control_model = comfy.ldm.hydit.controlnet.HunYuanControlNet(operations=operations, device=offload_device, dtype=unet_dtype)
|
||||||
control_model = controlnet_load_state_dict(control_model, controlnet_data)
|
control_model = controlnet_load_state_dict(control_model, controlnet_data)
|
||||||
@ -451,17 +462,17 @@ def load_controlnet_hunyuandit(controlnet_data):
|
|||||||
control = ControlNet(control_model, compression_ratio=1, latent_format=latent_format, load_device=load_device, manual_cast_dtype=manual_cast_dtype, extra_conds=extra_conds, strength_type=StrengthType.CONSTANT)
|
control = ControlNet(control_model, compression_ratio=1, latent_format=latent_format, load_device=load_device, manual_cast_dtype=manual_cast_dtype, extra_conds=extra_conds, strength_type=StrengthType.CONSTANT)
|
||||||
return control
|
return control
|
||||||
|
|
||||||
def load_controlnet_flux_xlabs_mistoline(sd, mistoline=False):
|
def load_controlnet_flux_xlabs_mistoline(sd, mistoline=False, model_options={}):
|
||||||
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(sd)
|
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(sd, model_options=model_options)
|
||||||
control_model = comfy.ldm.flux.controlnet.ControlNetFlux(mistoline=mistoline, operations=operations, device=offload_device, dtype=unet_dtype, **model_config.unet_config)
|
control_model = comfy.ldm.flux.controlnet.ControlNetFlux(mistoline=mistoline, operations=operations, device=offload_device, dtype=unet_dtype, **model_config.unet_config)
|
||||||
control_model = controlnet_load_state_dict(control_model, sd)
|
control_model = controlnet_load_state_dict(control_model, sd)
|
||||||
extra_conds = ['y', 'guidance']
|
extra_conds = ['y', 'guidance']
|
||||||
control = ControlNet(control_model, load_device=load_device, manual_cast_dtype=manual_cast_dtype, extra_conds=extra_conds)
|
control = ControlNet(control_model, load_device=load_device, manual_cast_dtype=manual_cast_dtype, extra_conds=extra_conds)
|
||||||
return control
|
return control
|
||||||
|
|
||||||
def load_controlnet_flux_instantx(sd):
|
def load_controlnet_flux_instantx(sd, model_options={}):
|
||||||
new_sd = comfy.model_detection.convert_diffusers_mmdit(sd, "")
|
new_sd = comfy.model_detection.convert_diffusers_mmdit(sd, "")
|
||||||
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(new_sd)
|
model_config, operations, load_device, unet_dtype, manual_cast_dtype, offload_device = controlnet_config(new_sd, model_options=model_options)
|
||||||
for k in sd:
|
for k in sd:
|
||||||
new_sd[k] = sd[k]
|
new_sd[k] = sd[k]
|
||||||
|
|
||||||
@ -487,13 +498,13 @@ def convert_mistoline(sd):
|
|||||||
return comfy.utils.state_dict_prefix_replace(sd, {"single_controlnet_blocks.": "controlnet_single_blocks."})
|
return comfy.utils.state_dict_prefix_replace(sd, {"single_controlnet_blocks.": "controlnet_single_blocks."})
|
||||||
|
|
||||||
|
|
||||||
def load_controlnet(ckpt_path, model=None):
|
def load_controlnet_state_dict(state_dict, model=None, model_options={}):
|
||||||
controlnet_data = comfy.utils.load_torch_file(ckpt_path, safe_load=True)
|
controlnet_data = state_dict
|
||||||
if 'after_proj_list.18.bias' in controlnet_data.keys(): #Hunyuan DiT
|
if 'after_proj_list.18.bias' in controlnet_data.keys(): #Hunyuan DiT
|
||||||
return load_controlnet_hunyuandit(controlnet_data)
|
return load_controlnet_hunyuandit(controlnet_data, model_options=model_options)
|
||||||
|
|
||||||
if "lora_controlnet" in controlnet_data:
|
if "lora_controlnet" in controlnet_data:
|
||||||
return ControlLora(controlnet_data)
|
return ControlLora(controlnet_data, model_options=model_options)
|
||||||
|
|
||||||
controlnet_config = None
|
controlnet_config = None
|
||||||
supported_inference_dtypes = None
|
supported_inference_dtypes = None
|
||||||
@ -550,13 +561,13 @@ def load_controlnet(ckpt_path, model=None):
|
|||||||
controlnet_data = new_sd
|
controlnet_data = new_sd
|
||||||
elif "controlnet_blocks.0.weight" in controlnet_data:
|
elif "controlnet_blocks.0.weight" in controlnet_data:
|
||||||
if "double_blocks.0.img_attn.norm.key_norm.scale" in controlnet_data:
|
if "double_blocks.0.img_attn.norm.key_norm.scale" in controlnet_data:
|
||||||
return load_controlnet_flux_xlabs_mistoline(controlnet_data)
|
return load_controlnet_flux_xlabs_mistoline(controlnet_data, model_options=model_options)
|
||||||
elif "pos_embed_input.proj.weight" in controlnet_data:
|
elif "pos_embed_input.proj.weight" in controlnet_data:
|
||||||
return load_controlnet_mmdit(controlnet_data) #SD3 diffusers controlnet
|
return load_controlnet_mmdit(controlnet_data, model_options=model_options) #SD3 diffusers controlnet
|
||||||
elif "controlnet_x_embedder.weight" in controlnet_data:
|
elif "controlnet_x_embedder.weight" in controlnet_data:
|
||||||
return load_controlnet_flux_instantx(controlnet_data)
|
return load_controlnet_flux_instantx(controlnet_data, model_options=model_options)
|
||||||
elif "controlnet_blocks.0.linear.weight" in controlnet_data: #mistoline flux
|
elif "controlnet_blocks.0.linear.weight" in controlnet_data: #mistoline flux
|
||||||
return load_controlnet_flux_xlabs_mistoline(convert_mistoline(controlnet_data), mistoline=True)
|
return load_controlnet_flux_xlabs_mistoline(convert_mistoline(controlnet_data), mistoline=True, model_options=model_options)
|
||||||
|
|
||||||
pth_key = 'control_model.zero_convs.0.0.weight'
|
pth_key = 'control_model.zero_convs.0.0.weight'
|
||||||
pth = False
|
pth = False
|
||||||
@ -568,25 +579,36 @@ def load_controlnet(ckpt_path, model=None):
|
|||||||
elif key in controlnet_data:
|
elif key in controlnet_data:
|
||||||
prefix = ""
|
prefix = ""
|
||||||
else:
|
else:
|
||||||
net = load_t2i_adapter(controlnet_data)
|
net = load_t2i_adapter(controlnet_data, model_options=model_options)
|
||||||
if net is None:
|
if net is None:
|
||||||
logging.error("error checkpoint does not contain controlnet or t2i adapter data {}".format(ckpt_path))
|
logging.error("error could not detect control model type.")
|
||||||
return net
|
return net
|
||||||
|
|
||||||
if controlnet_config is None:
|
if controlnet_config is None:
|
||||||
model_config = comfy.model_detection.model_config_from_unet(controlnet_data, prefix, True)
|
model_config = comfy.model_detection.model_config_from_unet(controlnet_data, prefix, True)
|
||||||
supported_inference_dtypes = model_config.supported_inference_dtypes
|
supported_inference_dtypes = list(model_config.supported_inference_dtypes)
|
||||||
controlnet_config = model_config.unet_config
|
controlnet_config = model_config.unet_config
|
||||||
|
|
||||||
|
unet_dtype = model_options.get("dtype", None)
|
||||||
|
if unet_dtype is None:
|
||||||
|
weight_dtype = comfy.utils.weight_dtype(controlnet_data)
|
||||||
|
|
||||||
|
if supported_inference_dtypes is None:
|
||||||
|
supported_inference_dtypes = [comfy.model_management.unet_dtype()]
|
||||||
|
|
||||||
|
if weight_dtype is not None:
|
||||||
|
supported_inference_dtypes.append(weight_dtype)
|
||||||
|
|
||||||
|
unet_dtype = comfy.model_management.unet_dtype(model_params=-1, supported_dtypes=supported_inference_dtypes)
|
||||||
|
|
||||||
load_device = comfy.model_management.get_torch_device()
|
load_device = comfy.model_management.get_torch_device()
|
||||||
if supported_inference_dtypes is None:
|
|
||||||
unet_dtype = comfy.model_management.unet_dtype()
|
|
||||||
else:
|
|
||||||
unet_dtype = comfy.model_management.unet_dtype(supported_dtypes=supported_inference_dtypes)
|
|
||||||
|
|
||||||
manual_cast_dtype = comfy.model_management.unet_manual_cast(unet_dtype, load_device)
|
manual_cast_dtype = comfy.model_management.unet_manual_cast(unet_dtype, load_device)
|
||||||
if manual_cast_dtype is not None:
|
operations = model_options.get("custom_operations", None)
|
||||||
controlnet_config["operations"] = comfy.ops.manual_cast
|
if operations is None:
|
||||||
|
operations = comfy.ops.pick_operations(unet_dtype, manual_cast_dtype)
|
||||||
|
|
||||||
|
controlnet_config["operations"] = operations
|
||||||
controlnet_config["dtype"] = unet_dtype
|
controlnet_config["dtype"] = unet_dtype
|
||||||
controlnet_config["device"] = comfy.model_management.unet_offload_device()
|
controlnet_config["device"] = comfy.model_management.unet_offload_device()
|
||||||
controlnet_config.pop("out_channels")
|
controlnet_config.pop("out_channels")
|
||||||
@ -622,14 +644,21 @@ def load_controlnet(ckpt_path, model=None):
|
|||||||
if len(unexpected) > 0:
|
if len(unexpected) > 0:
|
||||||
logging.debug("unexpected controlnet keys: {}".format(unexpected))
|
logging.debug("unexpected controlnet keys: {}".format(unexpected))
|
||||||
|
|
||||||
global_average_pooling = False
|
global_average_pooling = model_options.get("global_average_pooling", False)
|
||||||
filename = os.path.splitext(ckpt_path)[0]
|
|
||||||
if filename.endswith("_shuffle") or filename.endswith("_shuffle_fp16"): #TODO: smarter way of enabling global_average_pooling
|
|
||||||
global_average_pooling = True
|
|
||||||
|
|
||||||
control = ControlNet(control_model, global_average_pooling=global_average_pooling, load_device=load_device, manual_cast_dtype=manual_cast_dtype)
|
control = ControlNet(control_model, global_average_pooling=global_average_pooling, load_device=load_device, manual_cast_dtype=manual_cast_dtype)
|
||||||
return control
|
return control
|
||||||
|
|
||||||
|
def load_controlnet(ckpt_path, model=None, model_options={}):
|
||||||
|
if "global_average_pooling" not in model_options:
|
||||||
|
filename = os.path.splitext(ckpt_path)[0]
|
||||||
|
if filename.endswith("_shuffle") or filename.endswith("_shuffle_fp16"): #TODO: smarter way of enabling global_average_pooling
|
||||||
|
model_options["global_average_pooling"] = True
|
||||||
|
|
||||||
|
cnet = load_controlnet_state_dict(comfy.utils.load_torch_file(ckpt_path, safe_load=True), model=model, model_options=model_options)
|
||||||
|
if cnet is None:
|
||||||
|
logging.error("error checkpoint does not contain controlnet or t2i adapter data {}".format(ckpt_path))
|
||||||
|
return cnet
|
||||||
|
|
||||||
class T2IAdapter(ControlBase):
|
class T2IAdapter(ControlBase):
|
||||||
def __init__(self, t2i_model, channels_in, compression_ratio, upscale_algorithm, device=None):
|
def __init__(self, t2i_model, channels_in, compression_ratio, upscale_algorithm, device=None):
|
||||||
super().__init__(device)
|
super().__init__(device)
|
||||||
@ -685,7 +714,7 @@ class T2IAdapter(ControlBase):
|
|||||||
self.copy_to(c)
|
self.copy_to(c)
|
||||||
return c
|
return c
|
||||||
|
|
||||||
def load_t2i_adapter(t2i_data):
|
def load_t2i_adapter(t2i_data, model_options={}): #TODO: model_options
|
||||||
compression_ratio = 8
|
compression_ratio = 8
|
||||||
upscale_algorithm = 'nearest-exact'
|
upscale_algorithm = 'nearest-exact'
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,17 @@ def get_sigmas_vp(n, beta_d=19.9, beta_min=0.1, eps_s=1e-3, device='cpu'):
|
|||||||
return append_zero(sigmas)
|
return append_zero(sigmas)
|
||||||
|
|
||||||
|
|
||||||
|
def get_sigmas_laplace(n, sigma_min, sigma_max, mu=0., beta=0.5, device='cpu'):
|
||||||
|
"""Constructs the noise schedule proposed by Tiankai et al. (2024). """
|
||||||
|
epsilon = 1e-5 # avoid log(0)
|
||||||
|
x = torch.linspace(0, 1, n, device=device)
|
||||||
|
clamp = lambda x: torch.clamp(x, min=sigma_min, max=sigma_max)
|
||||||
|
lmb = mu - beta * torch.sign(0.5-x) * torch.log(1 - 2 * torch.abs(0.5-x) + epsilon)
|
||||||
|
sigmas = clamp(torch.exp(lmb))
|
||||||
|
return sigmas
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def to_d(x, sigma, denoised):
|
def to_d(x, sigma, denoised):
|
||||||
"""Converts a denoiser output to a Karras ODE derivative."""
|
"""Converts a denoiser output to a Karras ODE derivative."""
|
||||||
return (x - denoised) / utils.append_dims(sigma, x.ndim)
|
return (x - denoised) / utils.append_dims(sigma, x.ndim)
|
||||||
|
|||||||
@ -414,7 +414,7 @@ def calculate_weight(patches, weight, key, intermediate_dtype=torch.float32):
|
|||||||
weight *= strength_model
|
weight *= strength_model
|
||||||
|
|
||||||
if isinstance(v, list):
|
if isinstance(v, list):
|
||||||
v = (calculate_weight(v[1:], v[0].clone(), key, intermediate_dtype=intermediate_dtype), )
|
v = (calculate_weight(v[1:], comfy.model_management.cast_to_device(v[0], weight.device, intermediate_dtype, copy=True), key, intermediate_dtype=intermediate_dtype), )
|
||||||
|
|
||||||
if len(v) == 1:
|
if len(v) == 1:
|
||||||
patch_type = "diff"
|
patch_type = "diff"
|
||||||
|
|||||||
@ -626,6 +626,8 @@ def maximum_vram_for_weights(device=None):
|
|||||||
return (get_total_memory(device) * 0.88 - minimum_inference_memory())
|
return (get_total_memory(device) * 0.88 - minimum_inference_memory())
|
||||||
|
|
||||||
def unet_dtype(device=None, model_params=0, supported_dtypes=[torch.float16, torch.bfloat16, torch.float32]):
|
def unet_dtype(device=None, model_params=0, supported_dtypes=[torch.float16, torch.bfloat16, torch.float32]):
|
||||||
|
if model_params < 0:
|
||||||
|
model_params = 1000000000000000000000
|
||||||
if args.bf16_unet:
|
if args.bf16_unet:
|
||||||
return torch.bfloat16
|
return torch.bfloat16
|
||||||
if args.fp16_unet:
|
if args.fp16_unet:
|
||||||
|
|||||||
@ -300,10 +300,10 @@ class fp8_ops(manual_cast):
|
|||||||
return torch.nn.functional.linear(input, weight, bias)
|
return torch.nn.functional.linear(input, weight, bias)
|
||||||
|
|
||||||
|
|
||||||
def pick_operations(weight_dtype, compute_dtype, load_device=None):
|
def pick_operations(weight_dtype, compute_dtype, load_device=None, disable_fast_fp8=False):
|
||||||
if compute_dtype is None or weight_dtype == compute_dtype:
|
if compute_dtype is None or weight_dtype == compute_dtype:
|
||||||
return disable_weight_init
|
return disable_weight_init
|
||||||
if args.fast:
|
if args.fast and not disable_fast_fp8:
|
||||||
if comfy.model_management.supports_fp8_compute(load_device):
|
if comfy.model_management.supports_fp8_compute(load_device):
|
||||||
return fp8_ops
|
return fp8_ops
|
||||||
return manual_cast
|
return manual_cast
|
||||||
|
|||||||
@ -645,7 +645,7 @@ def load_diffusion_model_state_dict(sd, model_options={}): #load unet in diffuse
|
|||||||
|
|
||||||
manual_cast_dtype = model_management.unet_manual_cast(unet_dtype, load_device, model_config.supported_inference_dtypes)
|
manual_cast_dtype = model_management.unet_manual_cast(unet_dtype, load_device, model_config.supported_inference_dtypes)
|
||||||
model_config.set_inference_dtype(unet_dtype, manual_cast_dtype)
|
model_config.set_inference_dtype(unet_dtype, manual_cast_dtype)
|
||||||
model_config.custom_operations = model_options.get("custom_operations", None)
|
model_config.custom_operations = model_options.get("custom_operations", model_config.custom_operations)
|
||||||
model = model_config.get_model(new_sd, "")
|
model = model_config.get_model(new_sd, "")
|
||||||
model = model.to(offload_device)
|
model = model.to(offload_device)
|
||||||
model.load_model_weights(new_sd, "")
|
model.load_model_weights(new_sd, "")
|
||||||
|
|||||||
@ -90,6 +90,27 @@ class PolyexponentialScheduler:
|
|||||||
sigmas = k_diffusion_sampling.get_sigmas_polyexponential(n=steps, sigma_min=sigma_min, sigma_max=sigma_max, rho=rho)
|
sigmas = k_diffusion_sampling.get_sigmas_polyexponential(n=steps, sigma_min=sigma_min, sigma_max=sigma_max, rho=rho)
|
||||||
return (sigmas, )
|
return (sigmas, )
|
||||||
|
|
||||||
|
class LaplaceScheduler:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(s):
|
||||||
|
return {"required":
|
||||||
|
{"steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
|
||||||
|
"sigma_max": ("FLOAT", {"default": 14.614642, "min": 0.0, "max": 5000.0, "step":0.01, "round": False}),
|
||||||
|
"sigma_min": ("FLOAT", {"default": 0.0291675, "min": 0.0, "max": 5000.0, "step":0.01, "round": False}),
|
||||||
|
"mu": ("FLOAT", {"default": 0.0, "min": -10.0, "max": 10.0, "step":0.1, "round": False}),
|
||||||
|
"beta": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 10.0, "step":0.1, "round": False}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RETURN_TYPES = ("SIGMAS",)
|
||||||
|
CATEGORY = "sampling/custom_sampling/schedulers"
|
||||||
|
|
||||||
|
FUNCTION = "get_sigmas"
|
||||||
|
|
||||||
|
def get_sigmas(self, steps, sigma_max, sigma_min, mu, beta):
|
||||||
|
sigmas = k_diffusion_sampling.get_sigmas_laplace(n=steps, sigma_min=sigma_min, sigma_max=sigma_max, mu=mu, beta=beta)
|
||||||
|
return (sigmas, )
|
||||||
|
|
||||||
|
|
||||||
class SDTurboScheduler:
|
class SDTurboScheduler:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
@ -673,6 +694,7 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
"KarrasScheduler": KarrasScheduler,
|
"KarrasScheduler": KarrasScheduler,
|
||||||
"ExponentialScheduler": ExponentialScheduler,
|
"ExponentialScheduler": ExponentialScheduler,
|
||||||
"PolyexponentialScheduler": PolyexponentialScheduler,
|
"PolyexponentialScheduler": PolyexponentialScheduler,
|
||||||
|
"LaplaceScheduler": LaplaceScheduler,
|
||||||
"VPScheduler": VPScheduler,
|
"VPScheduler": VPScheduler,
|
||||||
"BetaSamplingScheduler": BetaSamplingScheduler,
|
"BetaSamplingScheduler": BetaSamplingScheduler,
|
||||||
"SDTurboScheduler": SDTurboScheduler,
|
"SDTurboScheduler": SDTurboScheduler,
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class EmptySD3LatentImage:
|
|||||||
CATEGORY = "latent/sd3"
|
CATEGORY = "latent/sd3"
|
||||||
|
|
||||||
def generate(self, width, height, batch_size=1):
|
def generate(self, width, height, batch_size=1):
|
||||||
latent = torch.ones([batch_size, 16, height // 8, width // 8], device=self.device) * 0.0609
|
latent = torch.zeros([batch_size, 16, height // 8, width // 8], device=self.device)
|
||||||
return ({"samples":latent}, )
|
return ({"samples":latent}, )
|
||||||
|
|
||||||
class CLIPTextEncodeSD3:
|
class CLIPTextEncodeSD3:
|
||||||
@ -93,6 +93,7 @@ class ControlNetApplySD3(nodes.ControlNetApplyAdvanced):
|
|||||||
"end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
|
"end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
|
||||||
}}
|
}}
|
||||||
CATEGORY = "conditioning/controlnet"
|
CATEGORY = "conditioning/controlnet"
|
||||||
|
DEPRECATED = True
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"TripleCLIPLoader": TripleCLIPLoader,
|
"TripleCLIPLoader": TripleCLIPLoader,
|
||||||
@ -103,5 +104,5 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
|
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||||
# Sampling
|
# Sampling
|
||||||
"ControlNetApplySD3": "ControlNetApply SD3 and HunyuanDiT",
|
"ControlNetApplySD3": "Apply Controlnet with VAE",
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,8 @@ a111:
|
|||||||
|
|
||||||
#comfyui:
|
#comfyui:
|
||||||
# base_path: path/to/comfyui/
|
# base_path: path/to/comfyui/
|
||||||
|
# # You can use is_default to mark that these folders should be listed first, and used as the default dirs for eg downloads
|
||||||
|
# #is_default: true
|
||||||
# checkpoints: models/checkpoints/
|
# checkpoints: models/checkpoints/
|
||||||
# clip: models/clip/
|
# clip: models/clip/
|
||||||
# clip_vision: models/clip_vision/
|
# clip_vision: models/clip_vision/
|
||||||
|
|||||||
@ -195,11 +195,14 @@ def exists_annotated_filepath(name) -> bool:
|
|||||||
return os.path.exists(filepath)
|
return os.path.exists(filepath)
|
||||||
|
|
||||||
|
|
||||||
def add_model_folder_path(folder_name: str, full_folder_path: str) -> None:
|
def add_model_folder_path(folder_name: str, full_folder_path: str, is_default: bool = False) -> None:
|
||||||
global folder_names_and_paths
|
global folder_names_and_paths
|
||||||
folder_name = map_legacy(folder_name)
|
folder_name = map_legacy(folder_name)
|
||||||
if folder_name in folder_names_and_paths:
|
if folder_name in folder_names_and_paths:
|
||||||
folder_names_and_paths[folder_name][0].append(full_folder_path)
|
if is_default:
|
||||||
|
folder_names_and_paths[folder_name][0].insert(0, full_folder_path)
|
||||||
|
else:
|
||||||
|
folder_names_and_paths[folder_name][0].append(full_folder_path)
|
||||||
else:
|
else:
|
||||||
folder_names_and_paths[folder_name] = ([full_folder_path], set())
|
folder_names_and_paths[folder_name] = ([full_folder_path], set())
|
||||||
|
|
||||||
|
|||||||
10
nodes.py
10
nodes.py
@ -787,6 +787,7 @@ class ControlNetApply:
|
|||||||
RETURN_TYPES = ("CONDITIONING",)
|
RETURN_TYPES = ("CONDITIONING",)
|
||||||
FUNCTION = "apply_controlnet"
|
FUNCTION = "apply_controlnet"
|
||||||
|
|
||||||
|
DEPRECATED = True
|
||||||
CATEGORY = "conditioning/controlnet"
|
CATEGORY = "conditioning/controlnet"
|
||||||
|
|
||||||
def apply_controlnet(self, conditioning, control_net, image, strength):
|
def apply_controlnet(self, conditioning, control_net, image, strength):
|
||||||
@ -816,7 +817,10 @@ class ControlNetApplyAdvanced:
|
|||||||
"strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
|
"strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
|
||||||
"start_percent": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
|
"start_percent": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
|
||||||
"end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
|
"end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
|
||||||
}}
|
},
|
||||||
|
"optional": {"vae": ("VAE", ),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("CONDITIONING","CONDITIONING")
|
RETURN_TYPES = ("CONDITIONING","CONDITIONING")
|
||||||
RETURN_NAMES = ("positive", "negative")
|
RETURN_NAMES = ("positive", "negative")
|
||||||
@ -1917,8 +1921,8 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
|||||||
"ConditioningSetArea": "Conditioning (Set Area)",
|
"ConditioningSetArea": "Conditioning (Set Area)",
|
||||||
"ConditioningSetAreaPercentage": "Conditioning (Set Area with Percentage)",
|
"ConditioningSetAreaPercentage": "Conditioning (Set Area with Percentage)",
|
||||||
"ConditioningSetMask": "Conditioning (Set Mask)",
|
"ConditioningSetMask": "Conditioning (Set Mask)",
|
||||||
"ControlNetApply": "Apply ControlNet",
|
"ControlNetApply": "Apply ControlNet (OLD)",
|
||||||
"ControlNetApplyAdvanced": "Apply ControlNet (Advanced)",
|
"ControlNetApplyAdvanced": "Apply ControlNet",
|
||||||
# Latent
|
# Latent
|
||||||
"VAEEncodeForInpaint": "VAE Encode (for Inpainting)",
|
"VAEEncodeForInpaint": "VAE Encode (for Inpainting)",
|
||||||
"SetLatentNoiseMask": "Set Latent Noise Mask",
|
"SetLatentNoiseMask": "Set Latent Noise Mask",
|
||||||
|
|||||||
@ -38,6 +38,9 @@ def get_images(ws, prompt):
|
|||||||
if data['node'] is None and data['prompt_id'] == prompt_id:
|
if data['node'] is None and data['prompt_id'] == prompt_id:
|
||||||
break #Execution is done
|
break #Execution is done
|
||||||
else:
|
else:
|
||||||
|
# If you want to be able to decode the binary stream for latent previews, here is how you can do it:
|
||||||
|
# bytesIO = BytesIO(out[8:])
|
||||||
|
# preview_image = Image.open(bytesIO) # This is your preview in PIL image format, store it in a global
|
||||||
continue #previews are binary data
|
continue #previews are binary data
|
||||||
|
|
||||||
history = get_history(prompt_id)[prompt_id]
|
history = get_history(prompt_id)[prompt_id]
|
||||||
|
|||||||
@ -71,7 +71,7 @@ def test_load_extra_model_paths_expands_userpath(
|
|||||||
load_extra_path_config(dummy_yaml_file_name)
|
load_extra_path_config(dummy_yaml_file_name)
|
||||||
|
|
||||||
expected_calls = [
|
expected_calls = [
|
||||||
('checkpoints', os.path.join(mock_expanded_home, 'App', 'subfolder1')),
|
('checkpoints', os.path.join(mock_expanded_home, 'App', 'subfolder1'), False),
|
||||||
]
|
]
|
||||||
|
|
||||||
assert mock_add_model_folder_path.call_count == len(expected_calls)
|
assert mock_add_model_folder_path.call_count == len(expected_calls)
|
||||||
@ -111,7 +111,7 @@ def test_load_extra_model_paths_expands_appdata(
|
|||||||
|
|
||||||
expected_base_path = 'C:/Users/TestUser/AppData/Roaming/ComfyUI'
|
expected_base_path = 'C:/Users/TestUser/AppData/Roaming/ComfyUI'
|
||||||
expected_calls = [
|
expected_calls = [
|
||||||
('checkpoints', os.path.join(expected_base_path, 'models/checkpoints')),
|
('checkpoints', os.path.join(expected_base_path, 'models/checkpoints'), False),
|
||||||
]
|
]
|
||||||
|
|
||||||
assert mock_add_model_folder_path.call_count == len(expected_calls)
|
assert mock_add_model_folder_path.call_count == len(expected_calls)
|
||||||
|
|||||||
@ -14,6 +14,9 @@ def load_extra_path_config(yaml_path):
|
|||||||
if "base_path" in conf:
|
if "base_path" in conf:
|
||||||
base_path = conf.pop("base_path")
|
base_path = conf.pop("base_path")
|
||||||
base_path = os.path.expandvars(os.path.expanduser(base_path))
|
base_path = os.path.expandvars(os.path.expanduser(base_path))
|
||||||
|
is_default = False
|
||||||
|
if "is_default" in conf:
|
||||||
|
is_default = conf.pop("is_default")
|
||||||
for x in conf:
|
for x in conf:
|
||||||
for y in conf[x].split("\n"):
|
for y in conf[x].split("\n"):
|
||||||
if len(y) == 0:
|
if len(y) == 0:
|
||||||
@ -22,4 +25,4 @@ def load_extra_path_config(yaml_path):
|
|||||||
if base_path is not None:
|
if base_path is not None:
|
||||||
full_path = os.path.join(base_path, full_path)
|
full_path = os.path.join(base_path, full_path)
|
||||||
logging.info("Adding extra search path {} {}".format(x, full_path))
|
logging.info("Adding extra search path {} {}".format(x, full_path))
|
||||||
folder_paths.add_model_folder_path(x, full_path)
|
folder_paths.add_model_folder_path(x, full_path, is_default)
|
||||||
|
|||||||
1
web/assets/CREDIT.txt
generated
vendored
Normal file
1
web/assets/CREDIT.txt
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
Thanks to OpenArt (https://openart.ai) for providing the sorted-custom-node-map data, captured in September 2024.
|
||||||
3142
web/assets/GraphView-DN9xGvF3.js
generated
vendored
Normal file
3142
web/assets/GraphView-DN9xGvF3.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/assets/GraphView-DN9xGvF3.js.map
generated
vendored
Normal file
1
web/assets/GraphView-DN9xGvF3.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
158
web/assets/GraphView-DXU9yRen.css
generated
vendored
Normal file
158
web/assets/GraphView-DXU9yRen.css
generated
vendored
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
|
||||||
|
.group-title-editor.node-title-editor[data-v-fc3f26e3] {
|
||||||
|
z-index: 9999;
|
||||||
|
padding: 0.25rem;
|
||||||
|
}
|
||||||
|
[data-v-fc3f26e3] .editable-text {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
[data-v-fc3f26e3] .editable-text input {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
/* Override the default font size */
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-bar-button-icon {
|
||||||
|
font-size: var(--sidebar-icon-size) !important;
|
||||||
|
}
|
||||||
|
.side-bar-button-selected .side-bar-button-icon {
|
||||||
|
font-size: var(--sidebar-icon-size) !important;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-bar-button[data-v-caa3ee9c] {
|
||||||
|
width: var(--sidebar-width);
|
||||||
|
height: var(--sidebar-width);
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-caa3ee9c],
|
||||||
|
.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-caa3ee9c]:hover {
|
||||||
|
border-left: 4px solid var(--p-button-text-primary-color);
|
||||||
|
}
|
||||||
|
.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-caa3ee9c],
|
||||||
|
.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-caa3ee9c]:hover {
|
||||||
|
border-right: 4px solid var(--p-button-text-primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--sidebar-width: 64px;
|
||||||
|
--sidebar-icon-size: 1.5rem;
|
||||||
|
}
|
||||||
|
:root .small-sidebar {
|
||||||
|
--sidebar-width: 40px;
|
||||||
|
--sidebar-icon-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-tool-bar-container[data-v-ed7a1148] {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
pointer-events: auto;
|
||||||
|
|
||||||
|
width: var(--sidebar-width);
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
background-color: var(--comfy-menu-bg);
|
||||||
|
color: var(--fg-color);
|
||||||
|
}
|
||||||
|
.side-tool-bar-end[data-v-ed7a1148] {
|
||||||
|
align-self: flex-end;
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
.sidebar-content-container[data-v-ed7a1148] {
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-splitter-gutter {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.gutter-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-bar-panel[data-v-edca8328] {
|
||||||
|
background-color: var(--bg-color);
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.splitter-overlay[data-v-edca8328] {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: transparent;
|
||||||
|
pointer-events: none;
|
||||||
|
/* Set it the same as the ComfyUI menu */
|
||||||
|
/* Note: Lite-graph DOM widgets have the same z-index as the node id, so
|
||||||
|
999 should be sufficient to make sure splitter overlays on node's DOM
|
||||||
|
widgets */
|
||||||
|
z-index: 999;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-v-37f672ab] .highlight {
|
||||||
|
background-color: var(--p-primary-color);
|
||||||
|
color: var(--p-primary-contrast-color);
|
||||||
|
font-weight: bold;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0rem 0.125rem;
|
||||||
|
margin: -0.125rem 0.125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comfy-vue-node-search-container[data-v-2d409367] {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 26rem;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.comfy-vue-node-search-container[data-v-2d409367] * {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.comfy-vue-node-preview-container[data-v-2d409367] {
|
||||||
|
position: absolute;
|
||||||
|
left: -350px;
|
||||||
|
top: 50px;
|
||||||
|
}
|
||||||
|
.comfy-vue-node-search-box[data-v-2d409367] {
|
||||||
|
z-index: 10;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
._filter-button[data-v-2d409367] {
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
._dialog[data-v-2d409367] {
|
||||||
|
min-width: 26rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invisible-dialog-root {
|
||||||
|
width: 30%;
|
||||||
|
min-width: 24rem;
|
||||||
|
max-width: 48rem;
|
||||||
|
border: 0 !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
margin-top: 25vh;
|
||||||
|
}
|
||||||
|
.node-search-box-dialog-mask {
|
||||||
|
align-items: flex-start !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.node-tooltip[data-v-e0597bf9] {
|
||||||
|
background: var(--comfy-input-bg);
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
|
||||||
|
color: var(--input-text);
|
||||||
|
font-family: sans-serif;
|
||||||
|
left: 0;
|
||||||
|
max-width: 30vw;
|
||||||
|
padding: 4px 8px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
transform: translate(5px, calc(-100% - 5px));
|
||||||
|
white-space: pre-wrap;
|
||||||
|
z-index: 99999;
|
||||||
|
}
|
||||||
6426
web/assets/index-W4jP-SrU.css → web/assets/index-8NH3XvqK.css
generated
vendored
6426
web/assets/index-W4jP-SrU.css → web/assets/index-8NH3XvqK.css
generated
vendored
File diff suppressed because it is too large
Load Diff
378
web/assets/index-CrROdkG4.js → web/assets/index-BDBCRrlL.js
generated
vendored
378
web/assets/index-CrROdkG4.js → web/assets/index-BDBCRrlL.js
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
var __defProp = Object.defineProperty;
|
var __defProp = Object.defineProperty;
|
||||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||||
import { C as ComfyDialog, $ as $el, a as ComfyApp, b as app, L as LGraphCanvas, c as LiteGraph, d as LGraphNode, e as applyTextReplacements, f as ComfyWidgets, g as addValueControlWidgets, D as DraggableList, h as api, i as LGraphGroup, u as useToastStore } from "./index-Dfv2aLsq.js";
|
import { aM as ComfyDialog, aN as $el, aO as ComfyApp, c as app, aH as LGraphCanvas, k as LiteGraph, e as LGraphNode, aP as applyTextReplacements, aQ as ComfyWidgets, aR as addValueControlWidgets, aS as DraggableList, av as useNodeDefStore, aT as api, L as LGraphGroup, aU as useToastStore, at as NodeSourceType, aV as NodeBadgeMode, u as useSettingStore, q as computed, w as watch, aW as BadgePosition, aJ as LGraphBadge$1, aX as _ } from "./index-Drc_oD2f.js";
|
||||||
class ClipspaceDialog extends ComfyDialog {
|
class ClipspaceDialog extends ComfyDialog {
|
||||||
static {
|
static {
|
||||||
__name(this, "ClipspaceDialog");
|
__name(this, "ClipspaceDialog");
|
||||||
@ -213,7 +213,9 @@ const colorPalettes = {
|
|||||||
WIDGET_SECONDARY_TEXT_COLOR: "#999",
|
WIDGET_SECONDARY_TEXT_COLOR: "#999",
|
||||||
LINK_COLOR: "#9A9",
|
LINK_COLOR: "#9A9",
|
||||||
EVENT_LINK_COLOR: "#A86",
|
EVENT_LINK_COLOR: "#A86",
|
||||||
CONNECTING_LINK_COLOR: "#AFA"
|
CONNECTING_LINK_COLOR: "#AFA",
|
||||||
|
BADGE_FG_COLOR: "#FFF",
|
||||||
|
BADGE_BG_COLOR: "#0F1F0F"
|
||||||
},
|
},
|
||||||
comfy_base: {
|
comfy_base: {
|
||||||
"fg-color": "#fff",
|
"fg-color": "#fff",
|
||||||
@ -283,7 +285,9 @@ const colorPalettes = {
|
|||||||
WIDGET_SECONDARY_TEXT_COLOR: "#555",
|
WIDGET_SECONDARY_TEXT_COLOR: "#555",
|
||||||
LINK_COLOR: "#4CAF50",
|
LINK_COLOR: "#4CAF50",
|
||||||
EVENT_LINK_COLOR: "#FF9800",
|
EVENT_LINK_COLOR: "#FF9800",
|
||||||
CONNECTING_LINK_COLOR: "#2196F3"
|
CONNECTING_LINK_COLOR: "#2196F3",
|
||||||
|
BADGE_FG_COLOR: "#000",
|
||||||
|
BADGE_BG_COLOR: "#FFF"
|
||||||
},
|
},
|
||||||
comfy_base: {
|
comfy_base: {
|
||||||
"fg-color": "#222",
|
"fg-color": "#222",
|
||||||
@ -621,6 +625,32 @@ const defaultColorPaletteId = "dark";
|
|||||||
const els = {
|
const els = {
|
||||||
select: null
|
select: null
|
||||||
};
|
};
|
||||||
|
const getCustomColorPalettes = /* @__PURE__ */ __name(() => {
|
||||||
|
return app.ui.settings.getSettingValue(idCustomColorPalettes, {});
|
||||||
|
}, "getCustomColorPalettes");
|
||||||
|
const setCustomColorPalettes = /* @__PURE__ */ __name((customColorPalettes) => {
|
||||||
|
return app.ui.settings.setSettingValue(
|
||||||
|
idCustomColorPalettes,
|
||||||
|
customColorPalettes
|
||||||
|
);
|
||||||
|
}, "setCustomColorPalettes");
|
||||||
|
const defaultColorPalette = colorPalettes[defaultColorPaletteId];
|
||||||
|
const getColorPalette = /* @__PURE__ */ __name((colorPaletteId) => {
|
||||||
|
if (!colorPaletteId) {
|
||||||
|
colorPaletteId = app.ui.settings.getSettingValue(id$4, defaultColorPaletteId);
|
||||||
|
}
|
||||||
|
if (colorPaletteId.startsWith("custom_")) {
|
||||||
|
colorPaletteId = colorPaletteId.substr(7);
|
||||||
|
let customColorPalettes = getCustomColorPalettes();
|
||||||
|
if (customColorPalettes[colorPaletteId]) {
|
||||||
|
return customColorPalettes[colorPaletteId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return colorPalettes[colorPaletteId];
|
||||||
|
}, "getColorPalette");
|
||||||
|
const setColorPalette = /* @__PURE__ */ __name((colorPaletteId) => {
|
||||||
|
app.ui.settings.setSettingValue(id$4, colorPaletteId);
|
||||||
|
}, "setColorPalette");
|
||||||
app.registerExtension({
|
app.registerExtension({
|
||||||
name: id$4,
|
name: id$4,
|
||||||
init() {
|
init() {
|
||||||
@ -695,28 +725,19 @@ app.registerExtension({
|
|||||||
comfy_base: {}
|
comfy_base: {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const defaultColorPalette = colorPalettes[defaultColorPaletteId];
|
const defaultColorPalette2 = colorPalettes[defaultColorPaletteId];
|
||||||
for (const key in defaultColorPalette.colors.litegraph_base) {
|
for (const key in defaultColorPalette2.colors.litegraph_base) {
|
||||||
if (!colorPalette.colors.litegraph_base[key]) {
|
if (!colorPalette.colors.litegraph_base[key]) {
|
||||||
colorPalette.colors.litegraph_base[key] = "";
|
colorPalette.colors.litegraph_base[key] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const key in defaultColorPalette.colors.comfy_base) {
|
for (const key in defaultColorPalette2.colors.comfy_base) {
|
||||||
if (!colorPalette.colors.comfy_base[key]) {
|
if (!colorPalette.colors.comfy_base[key]) {
|
||||||
colorPalette.colors.comfy_base[key] = "";
|
colorPalette.colors.comfy_base[key] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return completeColorPalette(colorPalette);
|
return completeColorPalette(colorPalette);
|
||||||
}, "getColorPaletteTemplate");
|
}, "getColorPaletteTemplate");
|
||||||
const getCustomColorPalettes = /* @__PURE__ */ __name(() => {
|
|
||||||
return app.ui.settings.getSettingValue(idCustomColorPalettes, {});
|
|
||||||
}, "getCustomColorPalettes");
|
|
||||||
const setCustomColorPalettes = /* @__PURE__ */ __name((customColorPalettes) => {
|
|
||||||
return app.ui.settings.setSettingValue(
|
|
||||||
idCustomColorPalettes,
|
|
||||||
customColorPalettes
|
|
||||||
);
|
|
||||||
}, "setCustomColorPalettes");
|
|
||||||
const addCustomColorPalette = /* @__PURE__ */ __name(async (colorPalette) => {
|
const addCustomColorPalette = /* @__PURE__ */ __name(async (colorPalette) => {
|
||||||
if (typeof colorPalette !== "object") {
|
if (typeof colorPalette !== "object") {
|
||||||
alert("Invalid color palette.");
|
alert("Invalid color palette.");
|
||||||
@ -807,25 +828,6 @@ app.registerExtension({
|
|||||||
app.canvas.draw(true, true);
|
app.canvas.draw(true, true);
|
||||||
}
|
}
|
||||||
}, "loadColorPalette");
|
}, "loadColorPalette");
|
||||||
const getColorPalette = /* @__PURE__ */ __name((colorPaletteId) => {
|
|
||||||
if (!colorPaletteId) {
|
|
||||||
colorPaletteId = app.ui.settings.getSettingValue(
|
|
||||||
id$4,
|
|
||||||
defaultColorPaletteId
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (colorPaletteId.startsWith("custom_")) {
|
|
||||||
colorPaletteId = colorPaletteId.substr(7);
|
|
||||||
let customColorPalettes = getCustomColorPalettes();
|
|
||||||
if (customColorPalettes[colorPaletteId]) {
|
|
||||||
return customColorPalettes[colorPaletteId];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return colorPalettes[colorPaletteId];
|
|
||||||
}, "getColorPalette");
|
|
||||||
const setColorPalette = /* @__PURE__ */ __name((colorPaletteId) => {
|
|
||||||
app.ui.settings.setSettingValue(id$4, colorPaletteId);
|
|
||||||
}, "setColorPalette");
|
|
||||||
const fileInput = $el("input", {
|
const fileInput = $el("input", {
|
||||||
type: "file",
|
type: "file",
|
||||||
accept: ".json",
|
accept: ".json",
|
||||||
@ -994,6 +996,10 @@ app.registerExtension({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
window.comfyAPI = window.comfyAPI || {};
|
||||||
|
window.comfyAPI.colorPalette = window.comfyAPI.colorPalette || {};
|
||||||
|
window.comfyAPI.colorPalette.defaultColorPalette = defaultColorPalette;
|
||||||
|
window.comfyAPI.colorPalette.getColorPalette = getColorPalette;
|
||||||
const ext$2 = {
|
const ext$2 = {
|
||||||
name: "Comfy.ContextMenuFilter",
|
name: "Comfy.ContextMenuFilter",
|
||||||
init() {
|
init() {
|
||||||
@ -1360,7 +1366,7 @@ class PrimitiveNode extends LGraphNode {
|
|||||||
this.#mergeWidgetConfig();
|
this.#mergeWidgetConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onConnectionsChange(_, index, connected) {
|
onConnectionsChange(_2, index, connected) {
|
||||||
if (app.configuringGraph) {
|
if (app.configuringGraph) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1806,7 +1812,7 @@ app.registerExtension({
|
|||||||
convertToInput(this, widget, config);
|
convertToInput(this, widget, config);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
nodeType.prototype.getExtraMenuOptions = function(_, options) {
|
nodeType.prototype.getExtraMenuOptions = function(_2, options) {
|
||||||
const r = origGetExtraMenuOptions ? origGetExtraMenuOptions.apply(this, arguments) : void 0;
|
const r = origGetExtraMenuOptions ? origGetExtraMenuOptions.apply(this, arguments) : void 0;
|
||||||
if (this.widgets) {
|
if (this.widgets) {
|
||||||
let toInput = [];
|
let toInput = [];
|
||||||
@ -1862,6 +1868,7 @@ app.registerExtension({
|
|||||||
};
|
};
|
||||||
nodeType.prototype.onGraphConfigured = function() {
|
nodeType.prototype.onGraphConfigured = function() {
|
||||||
if (!this.inputs) return;
|
if (!this.inputs) return;
|
||||||
|
this.widgets ??= [];
|
||||||
for (const input of this.inputs) {
|
for (const input of this.inputs) {
|
||||||
if (input.widget) {
|
if (input.widget) {
|
||||||
if (!input.widget[GET_CONFIG]) {
|
if (!input.widget[GET_CONFIG]) {
|
||||||
@ -1919,7 +1926,7 @@ app.registerExtension({
|
|||||||
return r;
|
return r;
|
||||||
};
|
};
|
||||||
function isNodeAtPos(pos) {
|
function isNodeAtPos(pos) {
|
||||||
for (const n of app2.graph._nodes) {
|
for (const n of app2.graph.nodes) {
|
||||||
if (n.pos[0] === pos[0] && n.pos[1] === pos[1]) {
|
if (n.pos[0] === pos[0] && n.pos[1] === pos[1]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2308,7 +2315,7 @@ class ManageGroupDialog extends ComfyDialog {
|
|||||||
"button.comfy-btn",
|
"button.comfy-btn",
|
||||||
{
|
{
|
||||||
onclick: /* @__PURE__ */ __name((e) => {
|
onclick: /* @__PURE__ */ __name((e) => {
|
||||||
const node = app.graph._nodes.find(
|
const node = app.graph.nodes.find(
|
||||||
(n) => n.type === "workflow/" + this.selectedGroup
|
(n) => n.type === "workflow/" + this.selectedGroup
|
||||||
);
|
);
|
||||||
if (node) {
|
if (node) {
|
||||||
@ -2374,7 +2381,7 @@ class ManageGroupDialog extends ComfyDialog {
|
|||||||
}
|
}
|
||||||
types[g] = type2;
|
types[g] = type2;
|
||||||
if (!nodesByType) {
|
if (!nodesByType) {
|
||||||
nodesByType = app.graph._nodes.reduce((p, n) => {
|
nodesByType = app.graph.nodes.reduce((p, n) => {
|
||||||
p[n.type] ??= [];
|
p[n.type] ??= [];
|
||||||
p[n.type].push(n);
|
p[n.type].push(n);
|
||||||
return p;
|
return p;
|
||||||
@ -2424,7 +2431,7 @@ const Workflow = {
|
|||||||
isInUseGroupNode(name) {
|
isInUseGroupNode(name) {
|
||||||
const id2 = `workflow/${name}`;
|
const id2 = `workflow/${name}`;
|
||||||
if (app.graph.extra?.groupNodes?.[name]) {
|
if (app.graph.extra?.groupNodes?.[name]) {
|
||||||
if (app.graph._nodes.find((n) => n.type === id2)) {
|
if (app.graph.nodes.find((n) => n.type === id2)) {
|
||||||
return Workflow.InUse.InWorkflow;
|
return Workflow.InUse.InWorkflow;
|
||||||
} else {
|
} else {
|
||||||
return Workflow.InUse.Registered;
|
return Workflow.InUse.Registered;
|
||||||
@ -2576,6 +2583,8 @@ class GroupNodeConfig {
|
|||||||
display_name: this.name,
|
display_name: this.name,
|
||||||
category: "group nodes" + ("/" + source),
|
category: "group nodes" + ("/" + source),
|
||||||
input: { required: {} },
|
input: { required: {} },
|
||||||
|
description: `Group node combining ${this.nodeData.nodes.map((n) => n.type).join(", ")}`,
|
||||||
|
python_module: "custom_nodes." + this.name,
|
||||||
[GROUP]: this
|
[GROUP]: this
|
||||||
};
|
};
|
||||||
this.inputs = [];
|
this.inputs = [];
|
||||||
@ -2591,6 +2600,7 @@ class GroupNodeConfig {
|
|||||||
}
|
}
|
||||||
this.#convertedToProcess = null;
|
this.#convertedToProcess = null;
|
||||||
await app.registerNodeDef("workflow/" + this.name, this.nodeDef);
|
await app.registerNodeDef("workflow/" + this.name, this.nodeDef);
|
||||||
|
useNodeDefStore().addNodeDef(this.nodeDef);
|
||||||
}
|
}
|
||||||
getLinks() {
|
getLinks() {
|
||||||
this.linksFrom = {};
|
this.linksFrom = {};
|
||||||
@ -2775,7 +2785,7 @@ class GroupNodeConfig {
|
|||||||
checkPrimitiveConnection(link, inputName, inputs) {
|
checkPrimitiveConnection(link, inputName, inputs) {
|
||||||
const sourceNode = this.nodeData.nodes[link[0]];
|
const sourceNode = this.nodeData.nodes[link[0]];
|
||||||
if (sourceNode.type === "PrimitiveNode") {
|
if (sourceNode.type === "PrimitiveNode") {
|
||||||
const [sourceNodeId, _, targetNodeId, __] = link;
|
const [sourceNodeId, _2, targetNodeId, __] = link;
|
||||||
const primitiveDef = this.primitiveDefs[sourceNodeId];
|
const primitiveDef = this.primitiveDefs[sourceNodeId];
|
||||||
const targetWidget = inputs[inputName];
|
const targetWidget = inputs[inputName];
|
||||||
const primitiveConfig = primitiveDef.input.required.value;
|
const primitiveConfig = primitiveDef.input.required.value;
|
||||||
@ -3177,7 +3187,7 @@ class GroupNodeHandler {
|
|||||||
return newNodes;
|
return newNodes;
|
||||||
};
|
};
|
||||||
const getExtraMenuOptions = this.node.getExtraMenuOptions;
|
const getExtraMenuOptions = this.node.getExtraMenuOptions;
|
||||||
this.node.getExtraMenuOptions = function(_, options) {
|
this.node.getExtraMenuOptions = function(_2, options) {
|
||||||
getExtraMenuOptions?.apply(this, arguments);
|
getExtraMenuOptions?.apply(this, arguments);
|
||||||
let optionIndex = options.findIndex((o) => o.content === "Outputs");
|
let optionIndex = options.findIndex((o) => o.content === "Outputs");
|
||||||
if (optionIndex === -1) optionIndex = options.length;
|
if (optionIndex === -1) optionIndex = options.length;
|
||||||
@ -3353,7 +3363,7 @@ class GroupNodeHandler {
|
|||||||
} else if (innerNode.type === "Reroute") {
|
} else if (innerNode.type === "Reroute") {
|
||||||
const rerouteLinks = this.groupData.linksFrom[old.node.index];
|
const rerouteLinks = this.groupData.linksFrom[old.node.index];
|
||||||
if (rerouteLinks) {
|
if (rerouteLinks) {
|
||||||
for (const [_, , targetNodeId, targetSlot] of rerouteLinks["0"]) {
|
for (const [_2, , targetNodeId, targetSlot] of rerouteLinks["0"]) {
|
||||||
const node = this.innerNodes[targetNodeId];
|
const node = this.innerNodes[targetNodeId];
|
||||||
const input = node.inputs[targetSlot];
|
const input = node.inputs[targetSlot];
|
||||||
if (input.widget) {
|
if (input.widget) {
|
||||||
@ -3599,7 +3609,7 @@ function addNodesToGroup(group, nodes = []) {
|
|||||||
var node;
|
var node;
|
||||||
x1 = y1 = x2 = y2 = -1;
|
x1 = y1 = x2 = y2 = -1;
|
||||||
nx1 = ny1 = nx2 = ny2 = -1;
|
nx1 = ny1 = nx2 = ny2 = -1;
|
||||||
for (var n of [group._nodes, nodes]) {
|
for (var n of [group.nodes, nodes]) {
|
||||||
for (var i in n) {
|
for (var i in n) {
|
||||||
node = n[i];
|
node = n[i];
|
||||||
nx1 = node.pos[0];
|
nx1 = node.pos[0];
|
||||||
@ -3659,7 +3669,7 @@ app.registerExtension({
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
group.recomputeInsideNodes();
|
group.recomputeInsideNodes();
|
||||||
const nodesInGroup = group._nodes;
|
const nodesInGroup = group.nodes;
|
||||||
options.push({
|
options.push({
|
||||||
content: "Add Selected Nodes To Group",
|
content: "Add Selected Nodes To Group",
|
||||||
disabled: !Object.keys(app.canvas.selected_nodes || {}).length,
|
disabled: !Object.keys(app.canvas.selected_nodes || {}).length,
|
||||||
@ -4002,6 +4012,16 @@ function prepare_mask(image, maskCanvas, maskCtx, maskColor) {
|
|||||||
maskCtx.putImageData(maskData, 0, 0);
|
maskCtx.putImageData(maskData, 0, 0);
|
||||||
}
|
}
|
||||||
__name(prepare_mask, "prepare_mask");
|
__name(prepare_mask, "prepare_mask");
|
||||||
|
var PointerType = /* @__PURE__ */ ((PointerType2) => {
|
||||||
|
PointerType2["Arc"] = "arc";
|
||||||
|
PointerType2["Rect"] = "rect";
|
||||||
|
return PointerType2;
|
||||||
|
})(PointerType || {});
|
||||||
|
var CompositionOperation = /* @__PURE__ */ ((CompositionOperation2) => {
|
||||||
|
CompositionOperation2["SourceOver"] = "source-over";
|
||||||
|
CompositionOperation2["DestinationOut"] = "destination-out";
|
||||||
|
return CompositionOperation2;
|
||||||
|
})(CompositionOperation || {});
|
||||||
class MaskEditorDialog extends ComfyDialog {
|
class MaskEditorDialog extends ComfyDialog {
|
||||||
static {
|
static {
|
||||||
__name(this, "MaskEditorDialog");
|
__name(this, "MaskEditorDialog");
|
||||||
@ -4030,6 +4050,8 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
mousedown_pan_x;
|
mousedown_pan_x;
|
||||||
mousedown_pan_y;
|
mousedown_pan_y;
|
||||||
last_pressure;
|
last_pressure;
|
||||||
|
pointer_type;
|
||||||
|
brush_pointer_type_select;
|
||||||
static getInstance() {
|
static getInstance() {
|
||||||
if (!MaskEditorDialog.instance) {
|
if (!MaskEditorDialog.instance) {
|
||||||
MaskEditorDialog.instance = new MaskEditorDialog();
|
MaskEditorDialog.instance = new MaskEditorDialog();
|
||||||
@ -4077,7 +4099,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
divElement.style.borderColor = "var(--border-color)";
|
divElement.style.borderColor = "var(--border-color)";
|
||||||
divElement.style.borderStyle = "solid";
|
divElement.style.borderStyle = "solid";
|
||||||
divElement.style.fontSize = "15px";
|
divElement.style.fontSize = "15px";
|
||||||
divElement.style.height = "21px";
|
divElement.style.height = "25px";
|
||||||
divElement.style.padding = "1px 6px";
|
divElement.style.padding = "1px 6px";
|
||||||
divElement.style.display = "flex";
|
divElement.style.display = "flex";
|
||||||
divElement.style.position = "relative";
|
divElement.style.position = "relative";
|
||||||
@ -4107,7 +4129,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
divElement.style.borderColor = "var(--border-color)";
|
divElement.style.borderColor = "var(--border-color)";
|
||||||
divElement.style.borderStyle = "solid";
|
divElement.style.borderStyle = "solid";
|
||||||
divElement.style.fontSize = "15px";
|
divElement.style.fontSize = "15px";
|
||||||
divElement.style.height = "21px";
|
divElement.style.height = "25px";
|
||||||
divElement.style.padding = "1px 6px";
|
divElement.style.padding = "1px 6px";
|
||||||
divElement.style.display = "flex";
|
divElement.style.display = "flex";
|
||||||
divElement.style.position = "relative";
|
divElement.style.position = "relative";
|
||||||
@ -4126,8 +4148,63 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
self.opacity_slider_input.addEventListener("input", callback);
|
self.opacity_slider_input.addEventListener("input", callback);
|
||||||
return divElement;
|
return divElement;
|
||||||
}
|
}
|
||||||
|
createPointerTypeSelect(self) {
|
||||||
|
const divElement = document.createElement("div");
|
||||||
|
divElement.id = "maskeditor-pointer-type";
|
||||||
|
divElement.style.cssFloat = "left";
|
||||||
|
divElement.style.fontFamily = "sans-serif";
|
||||||
|
divElement.style.marginRight = "4px";
|
||||||
|
divElement.style.color = "var(--input-text)";
|
||||||
|
divElement.style.backgroundColor = "var(--comfy-input-bg)";
|
||||||
|
divElement.style.borderRadius = "8px";
|
||||||
|
divElement.style.borderColor = "var(--border-color)";
|
||||||
|
divElement.style.borderStyle = "solid";
|
||||||
|
divElement.style.fontSize = "15px";
|
||||||
|
divElement.style.height = "25px";
|
||||||
|
divElement.style.padding = "1px 6px";
|
||||||
|
divElement.style.display = "flex";
|
||||||
|
divElement.style.position = "relative";
|
||||||
|
divElement.style.top = "2px";
|
||||||
|
divElement.style.pointerEvents = "auto";
|
||||||
|
const labelElement = document.createElement("label");
|
||||||
|
labelElement.textContent = "Pointer Type:";
|
||||||
|
const selectElement = document.createElement("select");
|
||||||
|
selectElement.style.borderRadius = "0";
|
||||||
|
selectElement.style.borderColor = "transparent";
|
||||||
|
selectElement.style.borderStyle = "unset";
|
||||||
|
selectElement.style.fontSize = "0.9em";
|
||||||
|
const optionArc = document.createElement("option");
|
||||||
|
optionArc.value = "arc";
|
||||||
|
optionArc.text = "Circle";
|
||||||
|
optionArc.selected = true;
|
||||||
|
const optionRect = document.createElement("option");
|
||||||
|
optionRect.value = "rect";
|
||||||
|
optionRect.text = "Square";
|
||||||
|
selectElement.appendChild(optionArc);
|
||||||
|
selectElement.appendChild(optionRect);
|
||||||
|
selectElement.addEventListener("change", (event) => {
|
||||||
|
const target = event.target;
|
||||||
|
self.pointer_type = target.value;
|
||||||
|
this.setBrushBorderRadius(self);
|
||||||
|
});
|
||||||
|
divElement.appendChild(labelElement);
|
||||||
|
divElement.appendChild(selectElement);
|
||||||
|
return divElement;
|
||||||
|
}
|
||||||
|
setBrushBorderRadius(self) {
|
||||||
|
if (self.pointer_type === "rect") {
|
||||||
|
this.brush.style.borderRadius = "0%";
|
||||||
|
this.brush.style.MozBorderRadius = "0%";
|
||||||
|
this.brush.style.WebkitBorderRadius = "0%";
|
||||||
|
} else {
|
||||||
|
this.brush.style.borderRadius = "50%";
|
||||||
|
this.brush.style.MozBorderRadius = "50%";
|
||||||
|
this.brush.style.WebkitBorderRadius = "50%";
|
||||||
|
}
|
||||||
|
}
|
||||||
setlayout(imgCanvas, maskCanvas) {
|
setlayout(imgCanvas, maskCanvas) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
self.pointer_type = "arc";
|
||||||
var bottom_panel = document.createElement("div");
|
var bottom_panel = document.createElement("div");
|
||||||
bottom_panel.style.position = "absolute";
|
bottom_panel.style.position = "absolute";
|
||||||
bottom_panel.style.bottom = "0px";
|
bottom_panel.style.bottom = "0px";
|
||||||
@ -4140,13 +4217,11 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
brush.style.backgroundColor = "transparent";
|
brush.style.backgroundColor = "transparent";
|
||||||
brush.style.outline = "1px dashed black";
|
brush.style.outline = "1px dashed black";
|
||||||
brush.style.boxShadow = "0 0 0 1px white";
|
brush.style.boxShadow = "0 0 0 1px white";
|
||||||
brush.style.borderRadius = "50%";
|
|
||||||
brush.style.MozBorderRadius = "50%";
|
|
||||||
brush.style.WebkitBorderRadius = "50%";
|
|
||||||
brush.style.position = "absolute";
|
brush.style.position = "absolute";
|
||||||
brush.style.zIndex = "8889";
|
brush.style.zIndex = "8889";
|
||||||
brush.style.pointerEvents = "none";
|
brush.style.pointerEvents = "none";
|
||||||
this.brush = brush;
|
this.brush = brush;
|
||||||
|
this.setBrushBorderRadius(self);
|
||||||
this.element.appendChild(imgCanvas);
|
this.element.appendChild(imgCanvas);
|
||||||
this.element.appendChild(maskCanvas);
|
this.element.appendChild(maskCanvas);
|
||||||
this.element.appendChild(bottom_panel);
|
this.element.appendChild(bottom_panel);
|
||||||
@ -4177,6 +4252,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
this.brush_pointer_type_select = this.createPointerTypeSelect(self);
|
||||||
this.colorButton = this.createLeftButton(this.getColorButtonText(), () => {
|
this.colorButton = this.createLeftButton(this.getColorButtonText(), () => {
|
||||||
if (self.brush_color_mode === "black") {
|
if (self.brush_color_mode === "black") {
|
||||||
self.brush_color_mode = "white";
|
self.brush_color_mode = "white";
|
||||||
@ -4203,6 +4279,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
bottom_panel.appendChild(cancelButton);
|
bottom_panel.appendChild(cancelButton);
|
||||||
bottom_panel.appendChild(this.brush_size_slider);
|
bottom_panel.appendChild(this.brush_size_slider);
|
||||||
bottom_panel.appendChild(this.brush_opacity_slider);
|
bottom_panel.appendChild(this.brush_opacity_slider);
|
||||||
|
bottom_panel.appendChild(this.brush_pointer_type_select);
|
||||||
bottom_panel.appendChild(this.colorButton);
|
bottom_panel.appendChild(this.colorButton);
|
||||||
imgCanvas.style.position = "absolute";
|
imgCanvas.style.position = "absolute";
|
||||||
maskCanvas.style.position = "absolute";
|
maskCanvas.style.position = "absolute";
|
||||||
@ -4568,19 +4645,22 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
}
|
}
|
||||||
if (diff > 20 && !this.drawing_mode)
|
if (diff > 20 && !this.drawing_mode)
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
self.maskCtx.beginPath();
|
self.init_shape(
|
||||||
self.maskCtx.fillStyle = this.getMaskFillStyle();
|
self,
|
||||||
self.maskCtx.globalCompositeOperation = "source-over";
|
"source-over"
|
||||||
self.maskCtx.arc(x, y, brush_size, 0, Math.PI * 2, false);
|
/* SourceOver */
|
||||||
self.maskCtx.fill();
|
);
|
||||||
|
self.draw_shape(self, x, y, brush_size);
|
||||||
self.lastx = x;
|
self.lastx = x;
|
||||||
self.lasty = y;
|
self.lasty = y;
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
self.maskCtx.beginPath();
|
self.init_shape(
|
||||||
self.maskCtx.fillStyle = this.getMaskFillStyle();
|
self,
|
||||||
self.maskCtx.globalCompositeOperation = "source-over";
|
"source-over"
|
||||||
|
/* SourceOver */
|
||||||
|
);
|
||||||
var dx = x - self.lastx;
|
var dx = x - self.lastx;
|
||||||
var dy = y - self.lasty;
|
var dy = y - self.lasty;
|
||||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||||
@ -4589,8 +4669,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
for (var i = 0; i < distance; i += 5) {
|
for (var i = 0; i < distance; i += 5) {
|
||||||
var px = self.lastx + directionX * i;
|
var px = self.lastx + directionX * i;
|
||||||
var py = self.lasty + directionY * i;
|
var py = self.lasty + directionY * i;
|
||||||
self.maskCtx.arc(px, py, brush_size, 0, Math.PI * 2, false);
|
self.draw_shape(self, px, py, brush_size);
|
||||||
self.maskCtx.fill();
|
|
||||||
}
|
}
|
||||||
self.lastx = x;
|
self.lastx = x;
|
||||||
self.lasty = y;
|
self.lasty = y;
|
||||||
@ -4611,17 +4690,22 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
}
|
}
|
||||||
if (diff > 20 && !this.drawing_mode)
|
if (diff > 20 && !this.drawing_mode)
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
self.maskCtx.beginPath();
|
self.init_shape(
|
||||||
self.maskCtx.globalCompositeOperation = "destination-out";
|
self,
|
||||||
self.maskCtx.arc(x2, y2, brush_size, 0, Math.PI * 2, false);
|
"destination-out"
|
||||||
self.maskCtx.fill();
|
/* DestinationOut */
|
||||||
|
);
|
||||||
|
self.draw_shape(self, x2, y2, brush_size);
|
||||||
self.lastx = x2;
|
self.lastx = x2;
|
||||||
self.lasty = y2;
|
self.lasty = y2;
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
self.maskCtx.beginPath();
|
self.init_shape(
|
||||||
self.maskCtx.globalCompositeOperation = "destination-out";
|
self,
|
||||||
|
"destination-out"
|
||||||
|
/* DestinationOut */
|
||||||
|
);
|
||||||
var dx = x2 - self.lastx;
|
var dx = x2 - self.lastx;
|
||||||
var dy = y2 - self.lasty;
|
var dy = y2 - self.lasty;
|
||||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||||
@ -4630,8 +4714,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
for (var i = 0; i < distance; i += 5) {
|
for (var i = 0; i < distance; i += 5) {
|
||||||
var px = self.lastx + directionX * i;
|
var px = self.lastx + directionX * i;
|
||||||
var py = self.lasty + directionY * i;
|
var py = self.lasty + directionY * i;
|
||||||
self.maskCtx.arc(px, py, brush_size, 0, Math.PI * 2, false);
|
self.draw_shape(self, px, py, brush_size);
|
||||||
self.maskCtx.fill();
|
|
||||||
}
|
}
|
||||||
self.lastx = x2;
|
self.lastx = x2;
|
||||||
self.lasty = y2;
|
self.lasty = y2;
|
||||||
@ -4665,20 +4748,47 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
const maskRect = self.maskCanvas.getBoundingClientRect();
|
const maskRect = self.maskCanvas.getBoundingClientRect();
|
||||||
const x = (event.offsetX || event.targetTouches[0].clientX - maskRect.left) / self.zoom_ratio;
|
const x = (event.offsetX || event.targetTouches[0].clientX - maskRect.left) / self.zoom_ratio;
|
||||||
const y = (event.offsetY || event.targetTouches[0].clientY - maskRect.top) / self.zoom_ratio;
|
const y = (event.offsetY || event.targetTouches[0].clientY - maskRect.top) / self.zoom_ratio;
|
||||||
self.maskCtx.beginPath();
|
|
||||||
if (!event.altKey && event.button == 0) {
|
if (!event.altKey && event.button == 0) {
|
||||||
self.maskCtx.fillStyle = this.getMaskFillStyle();
|
self.init_shape(
|
||||||
self.maskCtx.globalCompositeOperation = "source-over";
|
self,
|
||||||
|
"source-over"
|
||||||
|
/* SourceOver */
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
self.maskCtx.globalCompositeOperation = "destination-out";
|
self.init_shape(
|
||||||
|
self,
|
||||||
|
"destination-out"
|
||||||
|
/* DestinationOut */
|
||||||
|
);
|
||||||
}
|
}
|
||||||
self.maskCtx.arc(x, y, brush_size, 0, Math.PI * 2, false);
|
self.draw_shape(self, x, y, brush_size);
|
||||||
self.maskCtx.fill();
|
|
||||||
self.lastx = x;
|
self.lastx = x;
|
||||||
self.lasty = y;
|
self.lasty = y;
|
||||||
self.lasttime = performance.now();
|
self.lasttime = performance.now();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
init_shape(self, compositionOperation) {
|
||||||
|
self.maskCtx.beginPath();
|
||||||
|
if (compositionOperation == "source-over") {
|
||||||
|
self.maskCtx.fillStyle = this.getMaskFillStyle();
|
||||||
|
self.maskCtx.globalCompositeOperation = "source-over";
|
||||||
|
} else if (compositionOperation == "destination-out") {
|
||||||
|
self.maskCtx.globalCompositeOperation = "destination-out";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
draw_shape(self, x, y, brush_size) {
|
||||||
|
if (self.pointer_type === "rect") {
|
||||||
|
self.maskCtx.rect(
|
||||||
|
x - brush_size,
|
||||||
|
y - brush_size,
|
||||||
|
brush_size * 2,
|
||||||
|
brush_size * 2
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
self.maskCtx.arc(x, y, brush_size, 0, Math.PI * 2, false);
|
||||||
|
}
|
||||||
|
self.maskCtx.fill();
|
||||||
|
}
|
||||||
async save() {
|
async save() {
|
||||||
const backupCanvas = document.createElement("canvas");
|
const backupCanvas = document.createElement("canvas");
|
||||||
const backupCtx = backupCanvas.getContext("2d", {
|
const backupCtx = backupCanvas.getContext("2d", {
|
||||||
@ -5264,7 +5374,7 @@ app.registerExtension({
|
|||||||
updateNodes.push(node);
|
updateNodes.push(node);
|
||||||
} else {
|
} else {
|
||||||
const nodeOutType = node.inputs && node.inputs[link?.target_slot] && node.inputs[link.target_slot].type ? node.inputs[link.target_slot].type : null;
|
const nodeOutType = node.inputs && node.inputs[link?.target_slot] && node.inputs[link.target_slot].type ? node.inputs[link.target_slot].type : null;
|
||||||
if (inputType && inputType !== "*" && nodeOutType !== inputType) {
|
if (inputType && !LiteGraph.isValidConnection(inputType, nodeOutType)) {
|
||||||
node.disconnectInput(link.target_slot);
|
node.disconnectInput(link.target_slot);
|
||||||
} else {
|
} else {
|
||||||
outputType = nodeOutType;
|
outputType = nodeOutType;
|
||||||
@ -5300,6 +5410,7 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
if (!targetWidget) {
|
if (!targetWidget) {
|
||||||
targetWidget = targetNode.widgets?.find(
|
targetWidget = targetNode.widgets?.find(
|
||||||
|
// @ts-expect-error fix widget types
|
||||||
(w) => w.name === targetInput.widget.name
|
(w) => w.name === targetInput.widget.name
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -5342,7 +5453,7 @@ app.registerExtension({
|
|||||||
};
|
};
|
||||||
this.isVirtualNode = true;
|
this.isVirtualNode = true;
|
||||||
}
|
}
|
||||||
getExtraMenuOptions(_, options) {
|
getExtraMenuOptions(_2, options) {
|
||||||
options.unshift(
|
options.unshift(
|
||||||
{
|
{
|
||||||
content: (this.properties.showOutputText ? "Hide" : "Show") + " Type",
|
content: (this.properties.showOutputText ? "Hide" : "Show") + " Type",
|
||||||
@ -5564,8 +5675,7 @@ app.registerExtension({
|
|||||||
slot_types_default_in: {},
|
slot_types_default_in: {},
|
||||||
async beforeRegisterNodeDef(nodeType, nodeData, app2) {
|
async beforeRegisterNodeDef(nodeType, nodeData, app2) {
|
||||||
var nodeId = nodeData.name;
|
var nodeId = nodeData.name;
|
||||||
var inputs = [];
|
const inputs = nodeData["input"]["required"];
|
||||||
inputs = nodeData["input"]["required"];
|
|
||||||
for (const inputKey in inputs) {
|
for (const inputKey in inputs) {
|
||||||
var input = inputs[inputKey];
|
var input = inputs[inputKey];
|
||||||
if (typeof input[0] !== "string") continue;
|
if (typeof input[0] !== "string") continue;
|
||||||
@ -5637,7 +5747,7 @@ app.registerExtension({
|
|||||||
tooltip: "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid.",
|
tooltip: "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid.",
|
||||||
defaultValue: LiteGraph.CANVAS_GRID_SIZE,
|
defaultValue: LiteGraph.CANVAS_GRID_SIZE,
|
||||||
onChange(value) {
|
onChange(value) {
|
||||||
LiteGraph.CANVAS_GRID_SIZE = +value;
|
LiteGraph.CANVAS_GRID_SIZE = +value || 10;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const onNodeMoved = app.canvas.onNodeMoved;
|
const onNodeMoved = app.canvas.onNodeMoved;
|
||||||
@ -5697,7 +5807,7 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
if (app.canvas.last_mouse_dragging === false && app.shiftDown) {
|
if (app.canvas.last_mouse_dragging === false && app.shiftDown) {
|
||||||
this.recomputeInsideNodes();
|
this.recomputeInsideNodes();
|
||||||
for (const node of this._nodes) {
|
for (const node of this.nodes) {
|
||||||
node.alignToGrid();
|
node.alignToGrid();
|
||||||
}
|
}
|
||||||
LGraphNode.prototype.alignToGrid.apply(this);
|
LGraphNode.prototype.alignToGrid.apply(this);
|
||||||
@ -5730,7 +5840,7 @@ app.registerExtension({
|
|||||||
LGraphCanvas.onGroupAdd = function() {
|
LGraphCanvas.onGroupAdd = function() {
|
||||||
const v = onGroupAdd.apply(app.canvas, arguments);
|
const v = onGroupAdd.apply(app.canvas, arguments);
|
||||||
if (app.shiftDown) {
|
if (app.shiftDown) {
|
||||||
const lastGroup = app.graph._groups[app.graph._groups.length - 1];
|
const lastGroup = app.graph.groups[app.graph.groups.length - 1];
|
||||||
if (lastGroup) {
|
if (lastGroup) {
|
||||||
roundVectorToGrid(lastGroup.pos);
|
roundVectorToGrid(lastGroup.pos);
|
||||||
roundVectorToGrid(lastGroup.size);
|
roundVectorToGrid(lastGroup.size);
|
||||||
@ -6026,4 +6136,108 @@ app.registerExtension({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//# sourceMappingURL=index-CrROdkG4.js.map
|
function getNodeSource(node) {
|
||||||
|
const nodeDef = node.constructor.nodeData;
|
||||||
|
if (!nodeDef) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const nodeDefStore = useNodeDefStore();
|
||||||
|
return nodeDefStore.nodeDefsByName[nodeDef.name]?.nodeSource ?? null;
|
||||||
|
}
|
||||||
|
__name(getNodeSource, "getNodeSource");
|
||||||
|
function isCoreNode(node) {
|
||||||
|
return getNodeSource(node)?.type === NodeSourceType.Core;
|
||||||
|
}
|
||||||
|
__name(isCoreNode, "isCoreNode");
|
||||||
|
function badgeTextVisible(node, badgeMode) {
|
||||||
|
return badgeMode === NodeBadgeMode.None || isCoreNode(node) && badgeMode === NodeBadgeMode.HideBuiltIn;
|
||||||
|
}
|
||||||
|
__name(badgeTextVisible, "badgeTextVisible");
|
||||||
|
function getNodeIdBadgeText(node, nodeIdBadgeMode) {
|
||||||
|
return badgeTextVisible(node, nodeIdBadgeMode) ? "" : `#${node.id}`;
|
||||||
|
}
|
||||||
|
__name(getNodeIdBadgeText, "getNodeIdBadgeText");
|
||||||
|
function getNodeSourceBadgeText(node, nodeSourceBadgeMode) {
|
||||||
|
const nodeSource = getNodeSource(node);
|
||||||
|
return badgeTextVisible(node, nodeSourceBadgeMode) ? "" : nodeSource?.badgeText ?? "";
|
||||||
|
}
|
||||||
|
__name(getNodeSourceBadgeText, "getNodeSourceBadgeText");
|
||||||
|
function getNodeLifeCycleBadgeText(node, nodeLifeCycleBadgeMode) {
|
||||||
|
let text = "";
|
||||||
|
const nodeDef = node.constructor.nodeData;
|
||||||
|
if (!nodeDef) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (nodeDef.deprecated) {
|
||||||
|
text = "[DEPR]";
|
||||||
|
}
|
||||||
|
if (nodeDef.experimental) {
|
||||||
|
text = "[BETA]";
|
||||||
|
}
|
||||||
|
return badgeTextVisible(node, nodeLifeCycleBadgeMode) ? "" : text;
|
||||||
|
}
|
||||||
|
__name(getNodeLifeCycleBadgeText, "getNodeLifeCycleBadgeText");
|
||||||
|
class NodeBadgeExtension {
|
||||||
|
static {
|
||||||
|
__name(this, "NodeBadgeExtension");
|
||||||
|
}
|
||||||
|
constructor(nodeIdBadgeMode = null, nodeSourceBadgeMode = null, nodeLifeCycleBadgeMode = null, colorPalette = null) {
|
||||||
|
this.nodeIdBadgeMode = nodeIdBadgeMode;
|
||||||
|
this.nodeSourceBadgeMode = nodeSourceBadgeMode;
|
||||||
|
this.nodeLifeCycleBadgeMode = nodeLifeCycleBadgeMode;
|
||||||
|
this.colorPalette = colorPalette;
|
||||||
|
}
|
||||||
|
name = "Comfy.NodeBadge";
|
||||||
|
init(app2) {
|
||||||
|
const settingStore = useSettingStore();
|
||||||
|
this.nodeSourceBadgeMode = computed(
|
||||||
|
() => settingStore.get("Comfy.NodeBadge.NodeSourceBadgeMode")
|
||||||
|
);
|
||||||
|
this.nodeIdBadgeMode = computed(
|
||||||
|
() => settingStore.get("Comfy.NodeBadge.NodeIdBadgeMode")
|
||||||
|
);
|
||||||
|
this.nodeLifeCycleBadgeMode = computed(
|
||||||
|
() => settingStore.get(
|
||||||
|
"Comfy.NodeBadge.NodeLifeCycleBadgeMode"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
this.colorPalette = computed(
|
||||||
|
() => getColorPalette(settingStore.get("Comfy.ColorPalette"))
|
||||||
|
);
|
||||||
|
watch(this.nodeSourceBadgeMode, () => {
|
||||||
|
app2.graph.setDirtyCanvas(true, true);
|
||||||
|
});
|
||||||
|
watch(this.nodeIdBadgeMode, () => {
|
||||||
|
app2.graph.setDirtyCanvas(true, true);
|
||||||
|
});
|
||||||
|
watch(this.nodeLifeCycleBadgeMode, () => {
|
||||||
|
app2.graph.setDirtyCanvas(true, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
nodeCreated(node, app2) {
|
||||||
|
node.badgePosition = BadgePosition.TopRight;
|
||||||
|
node.badge_enabled = true;
|
||||||
|
const badge = computed(
|
||||||
|
() => new LGraphBadge$1({
|
||||||
|
text: _.truncate(
|
||||||
|
[
|
||||||
|
getNodeIdBadgeText(node, this.nodeIdBadgeMode.value),
|
||||||
|
getNodeLifeCycleBadgeText(
|
||||||
|
node,
|
||||||
|
this.nodeLifeCycleBadgeMode.value
|
||||||
|
),
|
||||||
|
getNodeSourceBadgeText(node, this.nodeSourceBadgeMode.value)
|
||||||
|
].filter((s) => s.length > 0).join(" "),
|
||||||
|
{
|
||||||
|
length: 31
|
||||||
|
}
|
||||||
|
),
|
||||||
|
fgColor: this.colorPalette.value.colors.litegraph_base?.BADGE_FG_COLOR || defaultColorPalette.colors.litegraph_base.BADGE_FG_COLOR,
|
||||||
|
bgColor: this.colorPalette.value.colors.litegraph_base?.BADGE_BG_COLOR || defaultColorPalette.colors.litegraph_base.BADGE_BG_COLOR
|
||||||
|
})
|
||||||
|
);
|
||||||
|
node.badges.push(() => badge.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
app.registerExtension(new NodeBadgeExtension());
|
||||||
|
//# sourceMappingURL=index-BDBCRrlL.js.map
|
||||||
1
web/assets/index-BDBCRrlL.js.map
generated
vendored
Normal file
1
web/assets/index-BDBCRrlL.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/assets/index-CrROdkG4.js.map
generated
vendored
1
web/assets/index-CrROdkG4.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
web/assets/index-Dfv2aLsq.js.map
generated
vendored
1
web/assets/index-Dfv2aLsq.js.map
generated
vendored
File diff suppressed because one or more lines are too long
82289
web/assets/index-Dfv2aLsq.js → web/assets/index-Drc_oD2f.js
generated
vendored
82289
web/assets/index-Dfv2aLsq.js → web/assets/index-Drc_oD2f.js
generated
vendored
File diff suppressed because one or more lines are too long
1
web/assets/index-Drc_oD2f.js.map
generated
vendored
Normal file
1
web/assets/index-Drc_oD2f.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2602
web/assets/sorted-custom-node-map.json
generated
vendored
Normal file
2602
web/assets/sorted-custom-node-map.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
web/assets/userSelection-DSpF-zVD.js → web/assets/userSelection-BM5u5JIA.js
generated
vendored
4
web/assets/userSelection-DSpF-zVD.js → web/assets/userSelection-BM5u5JIA.js
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
var __defProp = Object.defineProperty;
|
var __defProp = Object.defineProperty;
|
||||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||||
import { j as createSpinner, h as api, $ as $el } from "./index-Dfv2aLsq.js";
|
import { aY as createSpinner, aT as api, aN as $el } from "./index-Drc_oD2f.js";
|
||||||
class UserSelectionScreen {
|
class UserSelectionScreen {
|
||||||
static {
|
static {
|
||||||
__name(this, "UserSelectionScreen");
|
__name(this, "UserSelectionScreen");
|
||||||
@ -117,4 +117,4 @@ window.comfyAPI.userSelection.UserSelectionScreen = UserSelectionScreen;
|
|||||||
export {
|
export {
|
||||||
UserSelectionScreen
|
UserSelectionScreen
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=userSelection-DSpF-zVD.js.map
|
//# sourceMappingURL=userSelection-BM5u5JIA.js.map
|
||||||
2
web/assets/userSelection-DSpF-zVD.js.map → web/assets/userSelection-BM5u5JIA.js.map
generated
vendored
2
web/assets/userSelection-DSpF-zVD.js.map → web/assets/userSelection-BM5u5JIA.js.map
generated
vendored
File diff suppressed because one or more lines are too long
BIN
web/dist.zip
vendored
BIN
web/dist.zip
vendored
Binary file not shown.
3
web/extensions/core/colorPalette.js
vendored
Normal file
3
web/extensions/core/colorPalette.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// Shim for extensions/core/colorPalette.ts
|
||||||
|
export const defaultColorPalette = window.comfyAPI.colorPalette.defaultColorPalette;
|
||||||
|
export const getColorPalette = window.comfyAPI.colorPalette.getColorPalette;
|
||||||
94
web/index.html
vendored
94
web/index.html
vendored
@ -1,50 +1,50 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>ComfyUI</title>
|
<title>ComfyUI</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||||
<!-- Browser Test Fonts -->
|
<!-- Browser Test Fonts -->
|
||||||
<!-- <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
|
<!-- <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
font-family: 'Roboto Mono', 'Noto Color Emoji';
|
font-family: 'Roboto Mono', 'Noto Color Emoji';
|
||||||
}
|
}
|
||||||
</style> -->
|
</style> -->
|
||||||
<link rel="stylesheet" type="text/css" href="user.css" />
|
<link rel="stylesheet" type="text/css" href="user.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="materialdesignicons.min.css" />
|
<link rel="stylesheet" type="text/css" href="materialdesignicons.min.css" />
|
||||||
<script type="module" crossorigin src="./assets/index-Dfv2aLsq.js"></script>
|
<script type="module" crossorigin src="./assets/index-Drc_oD2f.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-W4jP-SrU.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-8NH3XvqK.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="litegraph">
|
<body class="litegraph">
|
||||||
<div id="vue-app"></div>
|
<div id="vue-app"></div>
|
||||||
<div id="comfy-user-selection" class="comfy-user-selection" style="display: none;">
|
<div id="comfy-user-selection" class="comfy-user-selection" style="display: none;">
|
||||||
<main class="comfy-user-selection-inner">
|
<main class="comfy-user-selection-inner">
|
||||||
<h1>ComfyUI</h1>
|
<h1>ComfyUI</h1>
|
||||||
<form>
|
<form>
|
||||||
<section>
|
<section>
|
||||||
<label>New user:
|
<label>New user:
|
||||||
<input placeholder="Enter a username" />
|
<input placeholder="Enter a username" />
|
||||||
</label>
|
</label>
|
||||||
</section>
|
</section>
|
||||||
<div class="comfy-user-existing">
|
<div class="comfy-user-existing">
|
||||||
<span class="or-separator">OR</span>
|
<span class="or-separator">OR</span>
|
||||||
<section>
|
<section>
|
||||||
<label>
|
<label>
|
||||||
Existing user:
|
Existing user:
|
||||||
<select>
|
<select>
|
||||||
<option hidden disabled selected value> Select a user </option>
|
<option hidden disabled selected value> Select a user </option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<span class="comfy-user-error"> </span>
|
<span class="comfy-user-error"> </span>
|
||||||
<button class="comfy-btn comfy-user-button-next">Next</button>
|
<button class="comfy-btn comfy-user-button-next">Next</button>
|
||||||
</footer>
|
</footer>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
1
web/scripts/workflows.js
vendored
1
web/scripts/workflows.js
vendored
@ -1,4 +1,3 @@
|
|||||||
// Shim for scripts/workflows.ts
|
// Shim for scripts/workflows.ts
|
||||||
export const trimJsonExt = window.comfyAPI.workflows.trimJsonExt;
|
|
||||||
export const ComfyWorkflowManager = window.comfyAPI.workflows.ComfyWorkflowManager;
|
export const ComfyWorkflowManager = window.comfyAPI.workflows.ComfyWorkflowManager;
|
||||||
export const ComfyWorkflow = window.comfyAPI.workflows.ComfyWorkflow;
|
export const ComfyWorkflow = window.comfyAPI.workflows.ComfyWorkflow;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user