[pull] master from Comfy-Org:master by pull[bot] · Pull Request #1093 · code/app-python-comfyui · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
13 changes: 13 additions & 0 deletions comfy/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ def model_lora_keys_unet(model, key_map={}):
key_map["lycoris_{}".format(key_lora.replace(".", "_"))] = k #SimpleTuner lycoris format
key_map["transformer.{}".format(key_lora)] = k #SimpleTuner regular format

if isinstance(model, comfy.model_base.HiDreamO1):
for k in sdk:
if k.startswith("diffusion_model."):
if k.endswith(".weight"):
key_lora = k[len("diffusion_model."):-len(".weight")]
key_map["model.{}".format(key_lora)] = k

if isinstance(model, comfy.model_base.ACEStep):
for k in sdk:
if k.startswith("diffusion_model.") and k.endswith(".weight"): #Official ACE step lora format
Expand Down Expand Up @@ -374,6 +381,12 @@ def model_lora_keys_unet(model, key_map={}):
key_lora = k[len("diffusion_model."):-len(".weight")]
key_map["{}".format(key_lora)] = k

if isinstance(model, comfy.model_base.MiniMaxH3):
for k in sdk:
if k.startswith("diffusion_model.") and k.endswith(".weight"):
key_lora = k[len("diffusion_model."):-len(".weight")]
key_map[key_lora] = k

return key_map


Expand Down
1 change: 1 addition & 0 deletions comfy_api_nodes/nodes_sora.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def define_schema(cls):
node_id="OpenAIVideoSora2",
display_name="OpenAI Sora - Video (DEPRECATED)",
category="partner/video/Sora",
is_deprecated=True,
description=(
"OpenAI video and audio generation.\n\n"
"DEPRECATION NOTICE: OpenAI will stop serving the Sora v2 API in September 2026. "
Expand Down
2 changes: 1 addition & 1 deletion comfy_extras/nodes_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class PreviewAudio(IO.ComfyNode):
def define_schema(cls):
return IO.Schema(
node_id="PreviewAudio",
search_aliases=["play audio"],
search_aliases=["preview", "preview audio", "play audio"],
display_name="Preview Audio",
category="audio",
description="Preview the audio without saving it to the ComfyUI output directory.",
Expand Down
22 changes: 12 additions & 10 deletions comfy_extras/nodes_load_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ class Preview3D(IO.ComfyNode):
def define_schema(cls):
return IO.Schema(
node_id="Preview3D",
search_aliases=["view mesh", "3d viewer"],
display_name="Preview 3D & Animation",
display_name="Preview 3D & Animation (DEPRECATED)",
category="3d",
description="Preview a 3D model file without saving it to the ComfyUI output directory.",
is_experimental=True,
is_output_node=True,
is_deprecated=True, # This node is superseded by the Preview 3D (Advanced) node
inputs=[
IO.MultiType.Input(
IO.String.Input("model_file", default="", multiline=False),
Expand Down Expand Up @@ -135,7 +135,7 @@ def define_schema(cls):
return IO.Schema(
node_id="Preview3DAdvanced",
display_name="Preview 3D (Advanced)",
search_aliases=["preview 3d", "3d viewer", "view mesh", "frame 3d", "3d camera output"],
search_aliases=["preview", "preview 3d", "3d viewer", "view mesh", "frame 3d", "3d camera output"],
category="3d",
description="Preview a 3D model file without saving it to the ComfyUI output directory.",
is_experimental=True,
Expand Down Expand Up @@ -200,17 +200,18 @@ def define_schema(cls):
is_experimental=True,
is_output_node=True,
search_aliases=[
"view splat",
"view gaussian",
"view gaussian splat",
"preview",
"preview splat",
"preview gaussian",
"preview gaussian splat",
"view 3dgs",
"preview 3dgs",
"preview ply",
"preview spz",
"preview splat",
"preview ksplat",
"view splat",
"view gaussian",
"view gaussian splat",
"view 3dgs",
],
inputs=[
IO.MultiType.Input(
Expand Down Expand Up @@ -270,11 +271,12 @@ def define_schema(cls):
is_experimental=True,
is_output_node=True,
search_aliases=[
"view point cloud",
"view pointcloud",
"preview",
"preview point cloud",
"preview pointcloud",
"preview ply",
"view point cloud",
"view pointcloud",
],
inputs=[
IO.MultiType.Input(
Expand Down
2 changes: 1 addition & 1 deletion comfy_extras/nodes_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class MaskPreview(IO.ComfyNode):
def define_schema(cls):
return IO.Schema(
node_id="MaskPreview",
search_aliases=["show mask", "view mask", "inspect mask", "debug mask"],
search_aliases=["preview", "preview mask", "show mask", "view mask", "inspect mask", "debug mask"],
display_name="Preview Mask",
category="image/mask",
description="Preview the masks without saving them to the ComfyUI output directory.",
Expand Down
5 changes: 1 addition & 4 deletions comfy_extras/nodes_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ def define_schema(cls) -> io.Schema:
node_id="ComfyMathExpression",
display_name="Math Expression",
category="utilities",
search_aliases=[
"expression", "formula", "calculate", "calculator",
"eval", "math",
],
search_aliases=["math", "expression", "formula", "calculate", "calculator", "eval"],
inputs=[
io.String.Input("expression", default="a + b", multiline=True),
io.Autogrow.Input("values", template=autogrow),
Expand Down
25 changes: 15 additions & 10 deletions comfy_extras/nodes_minimax_h3.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ def define_schema(cls):
category="model/conditioning/minimax",
inputs=[
io.Clip.Input("clip"),
io.Vae.Input("vae"),
io.Vae.Input("audio_vae"),
io.Vae.Input("vae", optional=True, tooltip="Video VAE. Without it reference images/videos only condition the text encoder."),
io.Vae.Input("audio_vae", optional=True, tooltip="Audio VAE. Without it reference audio only conditions the text encoder."),
io.String.Input("prompt", multiline=True, dynamic_prompts=True),
io.Int.Input("width", default=1344, min=32, max=nodes.MAX_RESOLUTION, step=32),
io.Int.Input("height", default=768, min=32, max=nodes.MAX_RESOLUTION, step=32),
Expand Down Expand Up @@ -285,7 +285,7 @@ def define_schema(cls):
)

@classmethod
def execute(cls, clip, vae, audio_vae, prompt, width, height, length, ref_image_size="match",
def execute(cls, clip, prompt, width, height, length, ref_image_size="match", vae=None, audio_vae=None,
ref_images=None, ref_videos=None, ref_video_audios=None, ref_audios=None) -> io.NodeOutput:
latent, frame_count = _empty_av_latent(width, height, length)

Expand All @@ -304,9 +304,10 @@ def execute(cls, clip, vae, audio_vae, prompt, width, height, length, ref_image_
tw = max(CANVAS_MULTIPLE, round(w * scale / CANVAS_MULTIPLE) * CANVAS_MULTIPLE)
th = max(CANVAS_MULTIPLE, round(h * scale / CANVAS_MULTIPLE) * CANVAS_MULTIPLE)
resized = _resize(img[:1], tw, th, "disabled")
z = vae.encode(resized)
ref_items.append({"type": "image", "data": resized})
ref_blocks.append({"kind": "image", "latent_h": th // 16, "latent_w": tw // 16, "latent": z})
if vae is not None:
z = vae.encode(resized)
ref_blocks.append({"kind": "image", "latent_h": th // 16, "latent_w": tw // 16, "latent": z})

ref_video_audios = ref_video_audios or {}
for name, video_frames in (ref_videos or {}).items():
Expand All @@ -328,27 +329,31 @@ def execute(cls, clip, vae, audio_vae, prompt, width, height, length, ref_image_
while n % 17 != 5:
n -= 1
frames = frames[:n]
z = vae.encode(frames)
audio_latent, ref_audio_t = (None, 0)
if soundtrack is not None:
audio_latent, ref_audio_t = _encode_ref_audio(audio_vae, soundtrack)
# the soundtrack gets its own <Audio j> label, emitted before <Video k>
ref_items.append({"type": "audio"})
# Qwen sees the video at 2 fps with timestamps
sample_idx = list(range(0, frames.shape[0], FPS // 2))
qwen_frames = frames[sample_idx]
ref_items.append({"type": "video", "data": qwen_frames,
"timestamps": [i / 2.0 for i in range(len(sample_idx))]})
if vae is None:
continue
z = vae.encode(frames)
audio_latent, ref_audio_t = (None, 0)
if soundtrack is not None and audio_vae is not None:
audio_latent, ref_audio_t = _encode_ref_audio(audio_vae, soundtrack)
ref_blocks.append({"kind": "video_audio" if ref_audio_t else "video",
"latent_t": z.shape[2], "latent_h": ch // 16, "latent_w": cw // 16,
"ref_audio_t": ref_audio_t, "latent": z, "audio_latent": audio_latent})

for audio in (ref_audios or {}).values():
if audio is None:
continue
audio_latent, ref_audio_t = _encode_ref_audio(audio_vae, audio)
ref_items.append({"type": "audio"})
ref_blocks.append({"kind": "audio", "ref_audio_t": ref_audio_t, "audio_latent": audio_latent})
if audio_vae is not None:
audio_latent, ref_audio_t = _encode_ref_audio(audio_vae, audio)
ref_blocks.append({"kind": "audio", "ref_audio_t": ref_audio_t, "audio_latent": audio_latent})

tokens = clip.tokenize(prompt, minimax_ref_items=ref_items)
cond = clip.encode_from_tokens_scheduled(tokens)
Expand Down
2 changes: 1 addition & 1 deletion comfy_extras/nodes_preview_any.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def INPUT_TYPES(cls):
OUTPUT_NODE = True

CATEGORY = "utilities"
SEARCH_ALIASES = ["show output", "inspect", "debug", "print value", "show text"]
SEARCH_ALIASES = ["preview", "preview text", "show output", "inspect", "debug", "print value", "show text"]
DESCRIPTION = "Preview any input value as text."

def main(self, source=None):
Expand Down
2 changes: 1 addition & 1 deletion comfy_extras/nodes_primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StringMultiline(io.ComfyNode):
def define_schema(cls):
return io.Schema(
node_id="PrimitiveStringMultiline",
search_aliases=["text", "string", "text multiline", "string multiline", "text box", "prompt"],
search_aliases=["text", "string", "text box", "prompt"],
display_name="Text (Multiline)",
category="utilities/primitive",
essentials_category="Basics",
Expand Down
3 changes: 2 additions & 1 deletion nodes.py
Loading