Remove obsolete frontend extensions

This commit is contained in:
Jedrzej Kosinski
2026-07-17 16:11:14 -07:00
parent d8d163cd90
commit 2dc014a33e
23 changed files with 19 additions and 901 deletions
+1 -2
View File
@@ -10,8 +10,7 @@ from .animatediff.dinklink import init_dinklink
if len(get_available_motion_models()) == 0:
logger.error(f"No motion models found. Please download one and place in: {folder_paths.get_folder_paths(Folders.ANIMATEDIFF_MODELS)}")
WEB_DIRECTORY = "./web"
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
documentation.format_descriptions(NODE_CLASS_MAPPINGS)
init_dinklink()
+14 -38
View File
@@ -1,41 +1,25 @@
from typing import Union
from .logger import logger
def image(src):
return f'<img src={src} style="width: 0px; min-width: 100%">'
def video(src):
return f'<video src={src} autoplay muted loop controls controlslist="nodownload noremoteplayback noplaybackrate" style="width: 0px; min-width: 100%" class="VHS_loopedvideo">'
def short_desc(desc):
return f'<div id=VHS_shortdesc style="font-size: .8em">{desc}</div>'
return str(desc)
def coll(text: str):
return f"{text}_collapsed"
return text
descriptions = {
}
descriptions = {}
sizes = ['1.4','1.2','1']
def as_html(entry, depth=0):
def as_markdown(entry, depth=0):
if isinstance(entry, dict):
size = 0.8 if depth < 2 else 1
html = ''
for k in entry:
if k == "collapsed":
sections = []
for name, value in entry.items():
if name == "collapsed":
continue
collapse_single = k.endswith("_collapsed")
if collapse_single:
name = k[:-len("_collapsed")]
else:
name = k
collapse_flag = ' VHS_precollapse' if entry.get("collapsed", False) or collapse_single else ''
html += f'<div vhs_title=\"{name}\" style=\"display: flex; font-size: {size}em\" class=\"VHS_collapse{collapse_flag}\"><div style=\"color: #AAA; height: 1.5em;\">[<span style=\"font-family: monospace\">-</span>]</div><div style=\"width: 100%\">{name}: {as_html(entry[k], depth=depth+1)}</div></div>'
return html
heading = "#" * min(depth + 2, 6)
rendered = as_markdown(value, depth=depth + 1)
sections.append(f"{heading} {name}\n\n{rendered}" if rendered else f"{heading} {name}")
return "\n\n".join(sections)
if isinstance(entry, list):
html = ''
for i in entry:
html += f'<div>{as_html(i, depth=depth)}</div>'
return html
return "\n\n".join(as_markdown(item, depth=depth) for item in entry)
return str(entry)
@@ -44,16 +28,8 @@ def register_description(node_id: str, desc: Union[list, dict]):
def format_descriptions(nodes):
for k in descriptions:
if k.endswith("_collapsed"):
k = k[:-len("_collapsed")]
nodes[k].DESCRIPTION = as_html(descriptions[k])
# undocumented_nodes = []
# for k in nodes:
# if not hasattr(nodes[k], "DESCRIPTION"):
# undocumented_nodes.append(k)
# if len(undocumented_nodes) > 0:
# logger.info(f"Undocumented nodes: {undocumented_nodes}")
for node_id, description in descriptions.items():
nodes[node_id].DESCRIPTION = as_markdown(description)
class DocHelper:
-30
View File
@@ -10,9 +10,6 @@ class AnimateDiffSettingsNode:
"pe_adjust": ("PE_ADJUST",),
"weight_adjust": ("WEIGHT_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("AD_SETTINGS",)
@@ -38,9 +35,6 @@ class ManualAdjustPENode:
"optional": {
"prev_pe_adjust": ("PE_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("PE_ADJUST",)
@@ -72,9 +66,6 @@ class SweetspotStretchPENode:
"optional": {
"prev_pe_adjust": ("PE_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("PE_ADJUST",)
@@ -102,9 +93,6 @@ class FullStretchPENode:
"optional": {
"prev_pe_adjust": ("PE_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("PE_ADJUST",)
@@ -132,9 +120,6 @@ class WeightAdjustAllAddNode:
"optional": {
"prev_weight_adjust": ("WEIGHT_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("WEIGHT_ADJUST",)
@@ -164,9 +149,6 @@ class WeightAdjustAllMultNode:
"optional": {
"prev_weight_adjust": ("WEIGHT_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("WEIGHT_ADJUST",)
@@ -198,9 +180,6 @@ class WeightAdjustIndivAddNode:
"optional": {
"prev_weight_adjust": ("WEIGHT_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("WEIGHT_ADJUST",)
@@ -234,9 +213,6 @@ class WeightAdjustIndivMultNode:
"optional": {
"prev_weight_adjust": ("WEIGHT_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("WEIGHT_ADJUST",)
@@ -275,9 +251,6 @@ class WeightAdjustIndivAttnAddNode:
"optional": {
"prev_weight_adjust": ("WEIGHT_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("WEIGHT_ADJUST",)
@@ -324,9 +297,6 @@ class WeightAdjustIndivAttnMultNode:
"optional": {
"prev_weight_adjust": ("WEIGHT_ADJUST",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("WEIGHT_ADJUST",)
+1 -4
View File
@@ -36,9 +36,6 @@ class ApplyAnimateLCMI2VModel:
"prev_m_models": ("M_MODELS",),
"per_block": ("PER_BLOCK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("M_MODELS",)
@@ -96,6 +93,7 @@ class LoadAnimateLCMI2VModelNode:
class LoadAnimateDiffAndInjectI2VNode:
EXPERIMENTAL = True
@classmethod
def INPUT_TYPES(s):
return {
@@ -105,7 +103,6 @@ class LoadAnimateDiffAndInjectI2VNode:
},
"optional": {
"ad_settings": ("AD_SETTINGS",),
"deprecation_warning": ("ADEWARN", {"text": "Experimental. Don't expect to work.", "warn_type": "experimental", "color": "#CFC"}),
}
}
-6
View File
@@ -301,9 +301,6 @@ class CameraCtrlADKeyframeNode:
"inherit_missing": ("BOOLEAN", {"default": True}, ),
"guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("AD_KEYFRAMES", )
@@ -403,9 +400,6 @@ class CameraCtrlPoseBasic:
"optional": {
"prev_poses": ("CAMERACTRL_POSES",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CAMERACTRL_POSES",)
-87
View File
@@ -45,11 +45,7 @@ class CreateLoraHookKeyframeInterpolationDEPR:
},
"optional": {
"prev_hook_kf": ("HOOK_KEYFRAMES",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
DEPRECATED = True
@@ -98,11 +94,7 @@ class PairedConditioningSetMaskHookedDEPR:
"opt_mask": ("MASK", ),
"opt_lora_hook": ("HOOKS",),
"opt_timesteps": ("TIMESTEPS_RANGE",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONDITIONING", "CONDITIONING")
@@ -133,11 +125,7 @@ class ConditioningSetMaskHookedDEPR:
"opt_mask": ("MASK", ),
"opt_lora_hook": ("HOOKS",),
"opt_timesteps": ("TIMESTEPS_RANGE",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONDITIONING",)
@@ -170,11 +158,7 @@ class PairedConditioningSetMaskAndCombineHookedDEPR:
"opt_mask": ("MASK", ),
"opt_lora_hook": ("HOOKS",),
"opt_timesteps": ("TIMESTEPS_RANGE",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONDITIONING", "CONDITIONING")
@@ -206,11 +190,7 @@ class ConditioningSetMaskAndCombineHookedDEPR:
"opt_mask": ("MASK", ),
"opt_lora_hook": ("HOOKS",),
"opt_timesteps": ("TIMESTEPS_RANGE",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONDITIONING",)
@@ -239,11 +219,7 @@ class PairedConditioningSetUnmaskedAndCombineHookedDEPR:
},
"optional": {
"opt_lora_hook": ("HOOKS",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONDITIONING", "CONDITIONING")
@@ -269,11 +245,7 @@ class ConditioningSetUnmaskedAndCombineHookedDEPR:
},
"optional": {
"opt_lora_hook": ("HOOKS",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONDITIONING",)
@@ -298,9 +270,6 @@ class PairedConditioningCombineDEPR:
"positive_B": ("CONDITIONING",),
"negative_B": ("CONDITIONING",),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
}
}
RETURN_TYPES = ("CONDITIONING", "CONDITIONING")
@@ -322,9 +291,6 @@ class ConditioningCombineDEPR:
"cond_A": ("CONDITIONING",),
"cond_B": ("CONDITIONING",),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
}
}
RETURN_TYPES = ("CONDITIONING",)
@@ -352,12 +318,6 @@ class ConditioningTimestepsNodeDEPR:
"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})
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("TIMESTEPS_RANGE",)
@@ -377,12 +337,6 @@ class SetLoraHookKeyframesDEPR:
"lora_hook": ("HOOKS",),
"hook_kf": ("HOOK_KEYFRAMES",),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("HOOKS",)
@@ -407,11 +361,7 @@ class CreateLoraHookKeyframeDEPR:
},
"optional": {
"prev_hook_kf": ("HOOK_KEYFRAMES",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("HOOK_KEYFRAMES",)
@@ -443,7 +393,6 @@ class CreateLoraHookKeyframeFromStrengthListDEPR:
},
"optional": {
"prev_hook_kf": ("HOOK_KEYFRAMES",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
}
}
@@ -501,9 +450,6 @@ class MaskableLoraLoaderDEPR:
"strength_model": ("FLOAT", {"default": 1.0, "min": -20.0, "max": 20.0, "step": 0.01}),
"strength_clip": ("FLOAT", {"default": 1.0, "min": -20.0, "max": 20.0, "step": 0.01}),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
}
}
RETURN_TYPES = ("MODEL", "CLIP", "HOOKS")
@@ -543,9 +489,6 @@ class MaskableLoraLoaderModelOnlyDEPR(MaskableLoraLoaderDEPR):
"lora_name": (folder_paths.get_filename_list("loras"), ),
"strength_model": ("FLOAT", {"default": 1.0, "min": -20.0, "max": 20.0, "step": 0.01}),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
}
}
RETURN_TYPES = ("MODEL", "HOOKS")
@@ -570,9 +513,6 @@ class MaskableSDModelLoaderDEPR(comfy_extras.nodes_hooks.CreateHookModelAsLora):
"strength_model": ("FLOAT", {"default": 1.0, "min": -20.0, "max": 20.0, "step": 0.01}),
"strength_clip": ("FLOAT", {"default": 1.0, "min": -20.0, "max": 20.0, "step": 0.01}),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
}
}
RETURN_TYPES = ("MODEL", "CLIP", "HOOKS")
@@ -594,9 +534,6 @@ class MaskableSDModelLoaderModelOnlyDEPR(MaskableSDModelLoaderDEPR):
"ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
"strength_model": ("FLOAT", {"default": 1.0, "min": -20.0, "max": 20.0, "step": 0.01}),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
}
}
RETURN_TYPES = ("MODEL", "HOOKS")
@@ -625,12 +562,6 @@ class SetModelLoraHookDEPR:
"conditioning": ("CONDITIONING",),
"lora_hook": ("HOOKS",),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONDITIONING",)
@@ -650,12 +581,6 @@ class SetClipLoraHookDEPR:
"clip": ("CLIP",),
"lora_hook": ("HOOKS",),
},
"optional": {
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CLIP",)
@@ -677,11 +602,7 @@ class CombineLoraHooksDEPR:
"optional": {
"lora_hook_A": ("HOOKS",),
"lora_hook_B": ("HOOKS",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("HOOKS",)
@@ -705,11 +626,7 @@ class CombineLoraHookFourOptionalDEPR:
"lora_hook_B": ("HOOKS",),
"lora_hook_C": ("HOOKS",),
"lora_hook_D": ("HOOKS",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("HOOKS",)
@@ -739,11 +656,7 @@ class CombineLoraHookEightOptionalDEPR:
"lora_hook_F": ("HOOKS",),
"lora_hook_G": ("HOOKS",),
"lora_hook_H": ("HOOKS",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated - use native ComfyUI nodes instead."}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("HOOKS",)
+1 -4
View File
@@ -66,6 +66,7 @@ class LoopedUniformContextOptionsNode:
# This Legacy version exists to maintain compatiblity with old workflows
class LegacyLoopedUniformContextOptionsNode:
DEPRECATED = True
@classmethod
def INPUT_TYPES(s):
return {
@@ -84,7 +85,6 @@ class LegacyLoopedUniformContextOptionsNode:
"guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
"prev_context": ("CONTEXT_OPTIONS",),
"view_opts": ("VIEW_OPTS",),
"deprecation_warning": ("ADEWARN", {"text": ""}),
}
}
@@ -237,9 +237,6 @@ class ViewAsContextOptionsNode:
"guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
"prev_context": ("CONTEXT_OPTIONS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXT_OPTIONS",)
-42
View File
@@ -21,9 +21,6 @@ class SetContextExtrasOnContextOptions:
"optional": {
"context_extras": ("CONTEXT_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXT_OPTIONS",)
@@ -54,9 +51,6 @@ class ContextExtras_NaiveReuse:
"end_percent": ("FLOAT", {"default": 0.15, "min": 0.0, "max": 1.0, "step": 0.001}),
"weighted_mean": ("FLOAT", {"default": 0.95, "min": 0.0, "max": 1.0, "step": 0.001}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXT_EXTRAS",)
@@ -89,9 +83,6 @@ class NaiveReuse_KeyframeMultivalNode:
"guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
"inherit_missing": ("BOOLEAN", {"default": True}, ),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NAIVEREUSE_KEYFRAME",)
@@ -128,9 +119,6 @@ class NaiveReuse_KeyframeInterpolationNode:
"prev_kf": ("NAIVEREUSE_KEYFRAME",),
"mult_multival": ("MULTIVAL",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NAIVEREUSE_KEYFRAME",)
@@ -178,9 +166,6 @@ class NaiveReuse_KeyframeFromListNode:
"prev_kf": ("NAIVEREUSE_KEYFRAME",),
"mult_multival": ("MULTIVAL",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NAIVEREUSE_KEYFRAME",)
@@ -235,9 +220,6 @@ class ContextExtras_ContextRef:
"start_percent": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
"end_percent": ("FLOAT", {"default": 0.25, "min": 0.0, "max": 1.0, "step": 0.001}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXT_EXTRAS",)
@@ -279,9 +261,6 @@ class ContextRef_KeyframeMultivalNode:
"guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
"inherit_missing": ("BOOLEAN", {"default": True}, ),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_KEYFRAME",)
@@ -321,9 +300,6 @@ class ContextRef_KeyframeInterpolationNode:
"mode_replace": ("CONTEXTREF_MODE",),
"tune_replace": ("CONTEXTREF_TUNE",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_KEYFRAME",)
@@ -372,9 +348,6 @@ class ContextRef_KeyframeFromListNode:
"mode_replace": ("CONTEXTREF_MODE",),
"tune_replace": ("CONTEXTREF_TUNE",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_KEYFRAME",)
@@ -416,9 +389,6 @@ class ContextRef_ModeFirst:
return {
"required": {
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_MODE",)
@@ -439,9 +409,6 @@ class ContextRef_ModeSliding:
"optional": {
"sliding_width": ("INT", {"default": 2, "min": 2, "max": BIGMAX, "step": 1}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_MODE",)
@@ -463,9 +430,6 @@ class ContextRef_ModeIndexes:
"switch_on_idxs": ("STRING", {"default": ""}),
"always_include_0": ("BOOLEAN", {"default": True},),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_MODE",)
@@ -494,9 +458,6 @@ class ContextRef_TuneAttnAdain:
"adain_ref_weight": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
"adain_strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_TUNE",)
@@ -522,9 +483,6 @@ class ContextRef_TuneAttn:
"attn_ref_weight": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
"attn_strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CONTEXTREF_TUNE",)
+1 -9
View File
@@ -34,7 +34,6 @@ class AnimateDiffLoaderDEPR:
"unlimited_area_hack": ("BOOLEAN", {"default": False},),
"beta_schedule": (BetaSchedules.get_alias_list_with_first_element(BetaSchedules.SQRT_LINEAR),),
},
"optional": {"deprecation_warning": ("ADEWARN", {"text": "Deprecated"})},
}
RETURN_TYPES = ("MODEL", "LATENT")
@@ -95,7 +94,6 @@ class AnimateDiffLoaderAdvancedDEPR:
"closed_loop": ("BOOLEAN", {"default": False},),
"beta_schedule": (BetaSchedules.get_alias_list_with_first_element(BetaSchedules.SQRT_LINEAR),),
},
"optional": {"deprecation_warning": ("ADEWARN", {"text": "Deprecated"})},
}
RETURN_TYPES = ("MODEL", "LATENT")
@@ -171,7 +169,6 @@ class LegacyAnimateDiffLoaderWithContextDEPR:
"motion_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "step": 0.001}),
"apply_v2_models_properly": ("BOOLEAN", {"default": True}),
"ad_keyframes": ("AD_KEYFRAMES",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated; use AnimateDiff Loader instead."}),
}
}
@@ -269,7 +266,6 @@ class AnimateDiffCombineDEPR:
"pingpong": ("BOOLEAN", {"default": False}),
"save_image": ("BOOLEAN", {"default": True}),
},
"optional": {"deprecation_warning": ("ADEWARN", {"text": "Deprecated. Use VHS Video Combine"})},
"hidden": {
"prompt": "PROMPT",
"extra_pnginfo": "EXTRA_PNGINFO",
@@ -380,7 +376,7 @@ class AnimateDiffCombineDEPR:
"format": format,
}
]
return {"ui": {"gifs": previews}}
return {"ui": {"images": previews, "animated": (True,)}}
@@ -394,7 +390,6 @@ class AnimateDiffModelSettingsDEPR:
},
"optional": {
"mask_motion_scale": ("MASK",),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated"}),
}
}
@@ -424,7 +419,6 @@ class AnimateDiffModelSettingsSimpleDEPR:
"mask_motion_scale": ("MASK",),
"min_motion_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "step": 0.001}),
"max_motion_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "step": 0.001}),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated"}),
}
}
@@ -464,7 +458,6 @@ class AnimateDiffModelSettingsAdvancedDEPR:
"mask_motion_scale": ("MASK",),
"min_motion_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "step": 0.001}),
"max_motion_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "step": 0.001}),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated"}),
}
}
@@ -520,7 +513,6 @@ class AnimateDiffModelSettingsAdvancedAttnStrengthsDEPR:
"mask_motion_scale": ("MASK",),
"min_motion_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "step": 0.001}),
"max_motion_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "step": 0.001}),
"deprecation_warning": ("ADEWARN", {"text": "Deprecated"}),
}
}
-3
View File
@@ -36,9 +36,6 @@ class ApplyAnimateDiffFancyVideo:
"prev_m_models": ("M_MODELS",),
"per_block": ("PER_BLOCK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("M_MODELS",)
-12
View File
@@ -101,9 +101,6 @@ class ApplyAnimateDiffModelNode:
"prev_m_models": ("M_MODELS",),
"per_block": ("PER_BLOCK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("M_MODELS",)
@@ -156,9 +153,6 @@ class ApplyAnimateDiffModelBasicNode:
"ad_keyframes": ("AD_KEYFRAMES",),
"per_block": ("PER_BLOCK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("M_MODELS",)
@@ -185,9 +179,6 @@ class LoadAnimateDiffModelNode:
"optional": {
"ad_settings": ("AD_SETTINGS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 50}),
}
}
RETURN_TYPES = ("MOTION_MODEL_ADE",)
@@ -216,9 +207,6 @@ class ADKeyframeNode:
"inherit_missing": ("BOOLEAN", {"default": True}, ),
"guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("AD_KEYFRAMES", )
-3
View File
@@ -20,9 +20,6 @@ class AnimateDiffLoraLoader:
"optional": {
"prev_motion_lora": ("MOTION_LORA",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 30}),
}
}
RETURN_TYPES = ("MOTION_LORA",)
-3
View File
@@ -114,9 +114,6 @@ class ApplyAnimateDiffMotionCtrlModel:
"prev_m_models": ("M_MODELS",),
"per_block": ("PER_BLOCK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("M_MODELS",)
-18
View File
@@ -23,9 +23,6 @@ class MultivalDynamicNode:
"optional": {
"mask_optional": ("MASK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("MULTIVAL",)
@@ -48,9 +45,6 @@ class MultivalScaledMaskNode:
"optional": {
"scaling": (ScaleType.LIST,),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("MULTIVAL",)
@@ -96,9 +90,6 @@ class MultivalDynamicFloatInputNode:
"optional": {
"mask_optional": ("MASK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("MULTIVAL",)
@@ -119,9 +110,6 @@ class MultivalDynamicFloatsNode:
"optional": {
"mask_optional": ("MASK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("MULTIVAL",)
@@ -139,9 +127,6 @@ class MultivalFloatNode:
"required": {
"float_val": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.001},),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("MULTIVAL",)
@@ -159,9 +144,6 @@ class MultivalConvertToMaskNode:
"required": {
"multival": ("MULTIVAL",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("MASK",)
-11
View File
@@ -39,9 +39,6 @@ class ADBlockComboNode:
"effect": ("MULTIVAL",),
"scale": ("MULTIVAL",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("AD_BLOCK",)
@@ -68,7 +65,6 @@ class ADBlockIndivNode:
"effect": ("MULTIVAL",),
"scale_0": ("MULTIVAL",),
"scale_1": ("MULTIVAL",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
@@ -97,7 +93,6 @@ class PerBlockHighLevelNode:
"down": ("AD_BLOCK",),
"mid": ("AD_BLOCK",),
"up": ("AD_BLOCK",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
@@ -141,7 +136,6 @@ class PerBlock_SD15_MidLevelNode:
"up_1": ("AD_BLOCK",),
"up_2": ("AD_BLOCK",),
"up_3": ("AD_BLOCK",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
@@ -209,7 +203,6 @@ class PerBlock_SD15_LowLevelNode:
"up_3__0": ("AD_BLOCK",),
"up_3__1": ("AD_BLOCK",),
"up_3__2": ("AD_BLOCK",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
@@ -282,7 +275,6 @@ class PerBlock_SD15_FromFloatsNode:
"optional": {
"effect_21_floats": ("FLOATS",),
"scale_21_floats": ("FLOATS",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
@@ -336,7 +328,6 @@ class PerBlock_SDXL_MidLevelNode:
"up_0": ("AD_BLOCK",),
"up_1": ("AD_BLOCK",),
"up_2": ("AD_BLOCK",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
@@ -395,7 +386,6 @@ class PerBlock_SDXL_LowLevelNode:
"up_2__0": ("AD_BLOCK",),
"up_2__1": ("AD_BLOCK",),
"up_2__2": ("AD_BLOCK",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
@@ -458,7 +448,6 @@ class PerBlock_SDXL_FromFloatsNode:
"optional": {
"effect_16_floats": ("FLOATS",),
"scale_16_floats": ("FLOATS",),
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
+1 -10
View File
@@ -127,9 +127,6 @@ class ApplyAnimateDiffPIAModel:
"prev_m_models": ("M_MODELS",),
"per_block": ("PER_BLOCK",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("M_MODELS",)
@@ -161,6 +158,7 @@ class ApplyAnimateDiffPIAModel:
class LoadAnimateDiffAndInjectPIANode:
EXPERIMENTAL = True
@classmethod
def INPUT_TYPES(s):
return {
@@ -170,7 +168,6 @@ class LoadAnimateDiffAndInjectPIANode:
},
"optional": {
"ad_settings": ("AD_SETTINGS",),
"deprecation_warning": ("ADEWARN", {"text": "Experimental. Don't expect to work.", "warn_type": "experimental", "color": "#CFC"}),
}
}
@@ -205,9 +202,6 @@ class PIA_ADKeyframeNode:
"inherit_missing": ("BOOLEAN", {"default": True}, ),
"guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("AD_KEYFRAMES", )
@@ -260,9 +254,6 @@ class InputPIA_PaperPresetsNode:
"print_values": ("BOOLEAN", {"default": False},),
#"effect_multival": ("MULTIVAL",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("PIA_INPUT",)
-54
View File
@@ -36,9 +36,6 @@ class SampleSettingsNode:
"ancestral_opts": ("ANCESTRAL_OPTS",),
#"noise_calib": ("NOISE_CALIBRATION",), # TODO: bring back once NoiseCalibration is working
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("SAMPLE_SETTINGS",)
@@ -71,9 +68,6 @@ class AncestralOptionsNode:
"optional": {
"seed_override": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "forceInput": True}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("ANCESTRAL_OPTS",)
@@ -101,9 +95,6 @@ class NoiseLayerReplaceNode:
"mask_optional": ("MASK",),
"seed_override": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "forceInput": True}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NOISE_LAYERS",)
@@ -139,9 +130,6 @@ class NoiseLayerAddNode:
"mask_optional": ("MASK",),
"seed_override": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "forceInput": True}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NOISE_LAYERS",)
@@ -180,9 +168,6 @@ class NoiseLayerAddWeightedNode:
"mask_optional": ("MASK",),
"seed_override": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "forceInput": True}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NOISE_LAYERS",)
@@ -220,9 +205,6 @@ class NoiseLayerNormalizedSumNode:
"mask_optional": ("MASK",),
"seed_override": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "forceInput": True}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NOISE_LAYERS",)
@@ -284,9 +266,6 @@ class FreeInitOptionsNode:
"iter_batch_offset": ("INT", {"default": 0, "min": 0, "max": BIGMAX}),
"iter_seed_offset": ("INT", {"default": 1, "min": BIGMIN, "max": BIGMAX}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("ITERATION_OPTS",)
@@ -311,9 +290,6 @@ class NoiseCalibrationNode:
"calib_iterations": ("INT", {"default": 1, "min": 1, "step": 1}),
"thresh_freq": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.001}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("NOISE_CALIBRATION",)
@@ -336,9 +312,6 @@ class CustomCFGNode:
"optional": {
"cfg_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CUSTOM_CFG",)
@@ -362,9 +335,6 @@ class CustomCFGSimpleNode:
"optional": {
"cfg_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CUSTOM_CFG",)
@@ -388,9 +358,6 @@ class CustomCFGKeyframeNode:
"prev_custom_cfg": ("CUSTOM_CFG",),
"cfg_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CUSTOM_CFG",)
@@ -420,9 +387,6 @@ class CustomCFGKeyframeSimpleNode:
"prev_custom_cfg": ("CUSTOM_CFG",),
"cfg_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 10}),
}
}
RETURN_TYPES = ("CUSTOM_CFG",)
@@ -452,9 +416,6 @@ class CustomCFGKeyframeInterpolationNode:
"prev_custom_cfg": ("CUSTOM_CFG",),
"cfg_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CUSTOM_CFG",)
@@ -541,9 +502,6 @@ class CFGExtrasPAGNode:
"optional": {
"prev_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CFG_EXTRAS",)
@@ -575,9 +533,6 @@ class CFGExtrasPAGSimpleNode:
"optional": {
"prev_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("CFG_EXTRAS",)
@@ -630,9 +585,6 @@ class CFGExtrasRescaleCFGSimpleNode:
"optional": {
"prev_extras": ("CFG_EXTRAS",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 10}),
}
}
RETURN_TYPES = ("CFG_EXTRAS",)
@@ -662,9 +614,6 @@ class NoisedImageInjectionNode:
"strength_multival": ("MULTIVAL", ),
"prev_image_inject": ("IMAGE_INJECT", ),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("IMAGE_INJECT",)
@@ -694,9 +643,6 @@ class NoisedImageInjectOptionsNode:
"composite_x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
"composite_y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("IMAGE_INJECT_OPTIONS",)
-12
View File
@@ -154,9 +154,6 @@ class ValueSchedulingLatentsNode:
"optional": {
"print_schedule": ("BOOLEAN", {"default": False}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("FLOAT", "FLOATS", "INT", "INTS")
@@ -193,9 +190,6 @@ class ValueSchedulingNode:
"print_schedule": ("BOOLEAN", {"default": False}),
"max_length": ("INT", {"default": 0, "min": 0, "max": BIGMAX, "step": 1}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("FLOAT", "FLOATS", "INT", "INTS")
@@ -232,9 +226,6 @@ class AddValuesReplaceNode:
"optional": {
"prev_replace": ("VALUES_REPLACE",),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("VALUES_REPLACE",)
@@ -269,9 +260,6 @@ class FloatToFloatsNode:
"required": {
"FLOAT": ("FLOAT", {"default": 39, "forceInput": True}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("FLOATS",)
-15
View File
@@ -46,9 +46,6 @@ class RawSigmaScheduleNode:
"lcm_original_timesteps": ("INT", {"default": 50, "min": 1, "max": 1000}),
"zsnr": ("BOOLEAN", {"default": False}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("SIGMA_SCHEDULE",)
@@ -83,9 +80,6 @@ class WeightedAverageSigmaScheduleNode:
"schedule_B": ("SIGMA_SCHEDULE",),
"weight_A": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.001}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("SIGMA_SCHEDULE",)
@@ -111,9 +105,6 @@ class InterpolatedWeightedAverageSigmaScheduleNode:
"weight_A_End": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.001}),
"interpolation": (InterpolationMethod._LIST,),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("SIGMA_SCHEDULE",)
@@ -142,9 +133,6 @@ class SplitAndCombineSigmaScheduleNode:
"schedule_End": ("SIGMA_SCHEDULE",),
"idx_split_percent": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.001})
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("SIGMA_SCHEDULE",)
@@ -171,9 +159,6 @@ class SigmaScheduleToSigmasNode:
"steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
"denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
},
"hidden": {
"autosize": ("ADEAUTOSIZE", {"padding": 0}),
}
}
RETURN_TYPES = ("SIGMAS",)
-53
View File
@@ -1,53 +0,0 @@
import { app } from '../../../scripts/app.js'
function addResizeHook(node, padding, useOldMin=false) {
let origOnCreated = node.onNodeCreated
node.onNodeCreated = function() {
let r = origOnCreated?.apply(this, arguments)
let size = this.computeSize();
size[0] += padding || 0;
if (useOldMin) {
//equal to LiteGraph.NODE_WIDTH*1.5*1.5
size[0] = Math.max(size[0], 315)
}
this.setSize(size);
return r
}
}
app.registerExtension({
name: "AnimateDiffEvolved.autosize",
async beforeRegisterNodeDef(nodeType, nodeData, app) {
//since python_module is based off folder path,
//it could be changed by users and should only be used as fallback
if (nodeData?.name?.startsWith("ADE_")
|| nodeData.python_module == 'custom_nodes.ComfyUI-AnimateDiff-Evolved') {
if (nodeData?.input?.hidden?.autosize) {
addResizeHook(nodeType.prototype, nodeData.input.hidden.autosize[1]?.padding)
} else if (!nodeData?.input?.optional?.autosize) {
addResizeHook(nodeType.prototype, 0, true)
}
}
},
async getCustomWidgets() {
return {
ADEAUTOSIZE(node, inputName, inputData) {
let w = {
name : inputName,
type : "ADE.AUTOSIZE",
value : "",
options : {"serialize": false},
computeSize : function(width) {
return [0, -4];
}
}
if (!node.widgets) {
node.widgets = []
}
node.widgets.push(w)
addResizeHook(node, inputData[1].padding);
return w;
}
}
}
});
-51
View File
@@ -1,51 +0,0 @@
import { app } from '../../../scripts/app.js'
const deprecate_nodes = {
name: 'AnimateDiff.deprecate_nodes',
async getCustomWidgets() {
return {
ADEWARN(node, inputName, inputData) {
let w = {
name : inputName,
type : "ADE.WARN",
value : "",
draw : function(ctx, node, widget_width, y, H) {
var show_text = app.canvas.ds.scale > 0.5;
var margin = 15;
var text_color = inputData[1]['color'] || "#FCC"
ctx.textAlign = "center";
if (show_text) {
if(!this.disabled)
ctx.stroke();
ctx.save();
ctx.beginPath();
ctx.rect(margin, y, widget_width - margin * 2, H);
ctx.clip();
ctx.fillStyle = text_color;
let disp_text = inputData[1]['text']
ctx.fillText(disp_text, widget_width/2, y + H * 0.7);
ctx.restore();
}
},
options : {"serialize": false},
computeSize : function(width) {
if (inputData[1]['text']) {
return [width, 20]
}
return [0, -4]
}
}
if (!node.widgets) {
node.widgets = []
}
node.widgets.push(w)
return w
}
}
}
}
app.registerExtension(deprecate_nodes)
-292
View File
@@ -1,292 +0,0 @@
import { app } from '../../../scripts/app.js'
function chainCallback(object, property, callback) {
if (object == undefined) {
//This should not happen.
console.error("Tried to add callback to non-existant object")
return;
}
if (property in object && object[property]) {
const callback_orig = object[property]
object[property] = function () {
const r = callback_orig.apply(this, arguments);
callback.apply(this, arguments);
return r
};
} else {
object[property] = callback;
}
}
var helpDOM;
function initHelpDOM() {
let parentDOM = document.createElement("div");
document.body.appendChild(parentDOM)
parentDOM.appendChild(helpDOM)
helpDOM.className = "litegraph";
let scrollbarStyle = document.createElement('style');
parentDOM.className = "VHS_floatinghelp"
scrollbarStyle.innerHTML = `
.VHS_floatinghelp {
scrollbar-width: 6px;
scrollbar-color: #0003 #0000;
&::-webkit-scrollbar {
background: transparent;
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #0005;
border-radius: 20px
}
&::-webkit-scrollbar-button {
display: none;
}
}
.VHS_loopedvideo::-webkit-media-controls-mute-button {
display:none;
}
.VHS_loopedvideo::-webkit-media-controls-fullscreen-button {
display:none;
}
`
parentDOM.appendChild(scrollbarStyle)
chainCallback(app.canvas, "onDrawForeground", function (ctx, visible_rect){
let n = helpDOM.node
if (!n || !n?.graph) {
parentDOM.style['left'] = '-5000px'
return
}
//draw : function(ctx, node, widgetWidth, widgetY, height) {
//update widget position, even if off screen
const transform = ctx.getTransform();
const scale = app.canvas.ds.scale;//gets the litegraph zoom
//calculate coordinates with account for browser zoom
const bcr = app.canvas.canvas.getBoundingClientRect()
const x = transform.e*scale/transform.a + bcr.x;
const y = transform.f*scale/transform.a + bcr.y;
//TODO: text reflows at low zoom. investigate alternatives
Object.assign(parentDOM.style, {
left: (x+(n.pos[0] + n.size[0]+15)*scale) + "px",
top: (y+(n.pos[1]-LiteGraph.NODE_TITLE_HEIGHT)*scale) + "px",
width: "400px",
minHeight: "100px",
maxHeight: "600px",
overflowY: 'scroll',
transformOrigin: '0 0',
transform: 'scale(' + scale + ',' + scale +')',
fontSize: '18px',
backgroundColor: LiteGraph.NODE_DEFAULT_BGCOLOR,
boxShadow: '0 0 10px black',
borderRadius: '4px',
padding: '3px',
zIndex: 3,
position: "absolute",
display: 'inline',
});
});
function setCollapse(el, doCollapse) {
if (doCollapse) {
el.children[0].children[0].innerHTML = '+'
Object.assign(el.children[1].style, {
color: '#CCC',
overflowX: 'hidden',
width: '0px',
minWidth: 'calc(100% - 20px)',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
})
for (let child of el.children[1].children) {
if (child.style.display != 'none'){
child.origDisplay = child.style.display
}
child.style.display = 'none'
}
} else {
el.children[0].children[0].innerHTML = '-'
Object.assign(el.children[1].style, {
color: '',
overflowX: '',
width: '100%',
minWidth: '',
textOverflow: '',
whiteSpace: '',
})
for (let child of el.children[1].children) {
child.style.display = child.origDisplay
}
}
}
helpDOM.collapseOnClick = function() {
let doCollapse = this.children[0].innerHTML == '-'
setCollapse(this.parentElement, doCollapse)
}
helpDOM.selectHelp = function(name, value) {
//attempt to navigate to name in help
function collapseUnlessMatch(items,t) {
var match = items.querySelector('[vhs_title="' + t + '"]')
if (!match) {
for (let i of items.children) {
if (i.innerHTML.slice(0,t.length+5).includes(t)) {
match = i
break
}
}
}
if (!match) {
return null
}
//For longer documentation items with fewer collapsable elements,
//scroll to make sure the entirety of the selected item is visible
//This has the unfortunate side effect of trying to scroll the main
//window if the documentation windows is forcibly offscreen,
//but it's easy to simply scroll the main window back and seems to
//have no visual side effects
match.scrollIntoView(false)
window.scrollTo(0,0)
for (let i of items.querySelectorAll('.VHS_collapse')) {
if (i.contains(match)) {
setCollapse(i, false)
} else {
setCollapse(i, true)
}
}
return match
}
let target = collapseUnlessMatch(helpDOM, name)
if (target && value) {
collapseUnlessMatch(target, value)
}
}
helpDOM.addHelp = function(node, nodeType, description) {
if (!description) {
return
}
//Pad computed size for the clickable question mark
let originalComputeSize = node.computeSize
node.computeSize = function() {
let size = originalComputeSize.apply(this, arguments)
if (!this.title) {
return size
}
let title_width = this.title.length * 0.6 * LiteGraph.NODE_TEXT_SIZE
size[0] = Math.max(size[0], title_width + LiteGraph.NODE_TITLE_HEIGHT)
return size
}
node.description = description
chainCallback(node, "onDrawForeground", function (ctx) {
//draw question mark
ctx.save()
ctx.font = 'bold 20px Arial'
ctx.fillText("?", this.size[0]-17, -8)
ctx.restore()
})
chainCallback(node, "onMouseDown", function (e, pos, canvas) {
//On click would be preferred, but this'll be good enough
if (pos[1] < 0 && pos[0] + LiteGraph.NODE_TITLE_HEIGHT > this.size[0]) {
//corner question mark clicked
if (helpDOM.node == this) {
helpDOM.node = undefined
} else {
helpDOM.node = this;
helpDOM.innerHTML = this.description || "no help provided ".repeat(20)
for (let e of helpDOM.querySelectorAll('.VHS_collapse')) {
e.children[0].onclick = helpDOM.collapseOnClick
e.children[0].style.cursor = 'pointer'
}
for (let e of helpDOM.querySelectorAll('.VHS_precollapse')) {
setCollapse(e, true)
}
}
return true
}
})
let timeout = null
chainCallback(node, "onMouseMove", function (e, pos, canvas) {
if (timeout) {
clearTimeout(timeout)
timeout = null
}
if (helpDOM.node != this) {
return
}
timeout = setTimeout(() => {
let n = this
if (pos[0] > 0 && pos[0] < n.size[0]
&& pos[1] > 0 && pos[1] < n.size[1]) {
//TODO: provide help specific to element clicked
let inputRows = Math.max(n.inputs.length, n.outputs.length)
if (pos[1] < LiteGraph.NODE_SLOT_HEIGHT * inputRows) {
let row = Math.floor((pos[1] - 7) / LiteGraph.NODE_SLOT_HEIGHT)
if (pos[0] < n.size[0]/2) {
if (row < n.inputs.length) {
helpDOM.selectHelp(n.inputs[row].name)
}
} else {
if (row < n.outputs.length) {
helpDOM.selectHelp(n.outputs[row].name)
}
}
} else {
//probably widget, but widgets have variable height.
let basey = LiteGraph.NODE_SLOT_HEIGHT * inputRows + 6
for (let w of n.widgets) {
if (w.y) {
basey = w.y
}
let wheight = LiteGraph.NODE_WIDGET_HEIGHT+4
if (w.computeSize) {
wheight = w.computeSize(n.size[0])[1]
}
if (pos[1] < basey + wheight) {
helpDOM.selectHelp(w.name, w.value)
break
}
basey += wheight
}
}
}
}, 500)
})
chainCallback(node, "onMouseLeave", function (e, pos, canvas) {
if (timeout) {
clearTimeout(timeout)
timeout = null
}
});
}
}
app.registerExtension({
name: "AnimateDiffEvolved.documentation",
async init() {
if (app.VHSHelp) {
helpDOM = app.VHSHelp
} else {
helpDOM = document.createElement("div");
initHelpDOM()
app.VHSHelp = helpDOM
}
},
async beforeRegisterNodeDef(nodeType, nodeData, app) {
// NOTE: May need manual adjusting for the few non-namespaced nodes
if(nodeData?.name?.startsWith("ADE_") && nodeData.description) {
let description = nodeData.description
let el = document.createElement("div")
el.innerHTML = description
if (!el.children.length) {
//Is plaintext. Do minor convenience formatting
let chunks = description.split('\n')
nodeData.description = chunks[0]
description = chunks.join('<br>')
} else {
nodeData.description = el.querySelector('#VHS_shortdesc')?.innerHTML || el.children[1]?.firstChild?.innerHTML
}
chainCallback(nodeType.prototype, "onNodeCreated", function () {
helpDOM.addHelp(this, nodeType, description)
})
}
},
});
-142
View File
@@ -1,142 +0,0 @@
import { app } from '../../../scripts/app.js'
import { api } from '../../../scripts/api.js'
function offsetDOMWidget(
widget,
ctx,
node,
widgetWidth,
widgetY,
height
) {
const margin = 10
const elRect = ctx.canvas.getBoundingClientRect()
const transform = new DOMMatrix()
.scaleSelf(
elRect.width / ctx.canvas.width,
elRect.height / ctx.canvas.height
)
.multiplySelf(ctx.getTransform())
.translateSelf(0, widgetY + margin)
const scale = new DOMMatrix().scaleSelf(transform.a, transform.d)
Object.assign(widget.inputEl.style, {
transformOrigin: '0 0',
transform: scale,
left: `${transform.e}px`,
top: `${transform.d + transform.f}px`,
width: `${widgetWidth}px`,
height: `${(height || widget.parent?.inputHeight || 32) - margin}px`,
position: 'absolute',
background: !node.color ? '' : node.color,
color: !node.color ? '' : 'white',
zIndex: 5, //app.graph._nodes.indexOf(node),
})
}
export const hasWidgets = (node) => {
if (!node.widgets || !node.widgets?.[Symbol.iterator]) {
return false
}
return true
}
export const cleanupNode = (node) => {
if (!hasWidgets(node)) {
return
}
for (const w of node.widgets) {
if (w.canvas) {
w.canvas.remove()
}
if (w.inputEl) {
w.inputEl.remove()
}
// calls the widget remove callback
w.onRemoved?.()
}
}
const CreatePreviewElement = (name, val, format) => {
const [type] = format.split('/')
const w = {
name,
type,
value: val,
draw: function (ctx, node, widgetWidth, widgetY, height) {
const [cw, ch] = this.computeSize(widgetWidth)
offsetDOMWidget(this, ctx, node, widgetWidth, widgetY, ch)
},
computeSize: function (_) {
const ratio = this.inputRatio || 1
const width = Math.max(220, this.parent.size[0])
return [width, (width / ratio + 10)]
},
onRemoved: function () {
if (this.inputEl) {
this.inputEl.remove()
}
},
}
w.inputEl = document.createElement(type === 'video' ? 'video' : 'img')
w.inputEl.src = w.value
if (type === 'video') {
w.inputEl.setAttribute('type', 'video/webm');
w.inputEl.autoplay = true
w.inputEl.loop = true
w.inputEl.controls = false;
}
w.inputEl.onload = function () {
w.inputRatio = w.inputEl.naturalWidth / w.inputEl.naturalHeight
}
document.body.appendChild(w.inputEl)
return w
}
const gif_preview = {
name: 'AnimateDiff.gif_preview',
async beforeRegisterNodeDef(nodeType, nodeData, app) {
switch (nodeData.name) {
case 'ADE_AnimateDiffCombine':{
const onExecuted = nodeType.prototype.onExecuted
nodeType.prototype.onExecuted = function (message) {
const prefix = 'ad_gif_preview_'
const r = onExecuted ? onExecuted.apply(this, message) : undefined
if (this.widgets) {
const pos = this.widgets.findIndex((w) => w.name === `${prefix}_0`)
if (pos !== -1) {
for (let i = pos; i < this.widgets.length; i++) {
this.widgets[i].onRemoved?.()
}
this.widgets.length = pos
}
if (message?.gifs) {
message.gifs.forEach((params, i) => {
const previewUrl = api.apiURL(
'/view?' + new URLSearchParams(params).toString()
)
const w = this.addCustomWidget(
CreatePreviewElement(`${prefix}_${i}`, previewUrl, params.format || 'image/gif')
)
w.parent = this
})
}
const onRemoved = this.onRemoved
this.onRemoved = () => {
cleanupNode(this)
return onRemoved?.()
}
}
this.setSize([this.size[0], this.computeSize([this.size[0], this.size[1]])[1]])
return r
}
break
}
}
}
}
app.registerExtension(gif_preview)