feat(HEL-892): document multi-segment director workflow

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-11-01 12:04:37 +08:00
co-authored by multica-agent
parent 3dfb4df7b1
commit 388915b1c5
124 changed files with 147092 additions and 1 deletions
@@ -0,0 +1,6 @@
tree c98185bd79c7df3e44d6762e392d2c8073e19978
parent 06f08ff869238b89ddfcb63757b65825f928a93d
author fen-release[bot] <fen-release[bot]@users.noreply.github.com> 1786995082 +0000
committer fen-release[bot] <fen-release[bot]@users.noreply.github.com> 1786995082 +0000
ComfyUI v0.33.2
@@ -0,0 +1,2 @@
From https://github.com/Comfy-Org/ComfyUI
* tag v0.33.2 -> FETCH_HEAD
@@ -0,0 +1,2 @@
From https://github.com/Comfy-Org/ComfyUI
* tag v0.33.2 -> FETCH_HEAD
@@ -0,0 +1,5 @@
{
"object": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tag": "v0.33.2"
}
@@ -0,0 +1,6 @@
tree c98185bd79c7df3e44d6762e392d2c8073e19978
parent 06f08ff869238b89ddfcb63757b65825f928a93d
author fen-release[bot] <fen-release[bot]@users.noreply.github.com> 1786995082 +0000
committer fen-release[bot] <fen-release[bot]@users.noreply.github.com> 1786995082 +0000
ComfyUI v0.33.2
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
from ._io import * # noqa: F403
@@ -0,0 +1,48 @@
import json
from comfy.comfy_types.node_typing import IO
import torch
# Preview Any - original implement from
# https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py
# upstream requested in https://github.com/Kosinkadink/rfcs/blob/main/rfcs/0000-corenodes.md#preview-nodes
class PreviewAny():
@classmethod
def INPUT_TYPES(cls):
return {
"required": {"source": (IO.ANY, {})},
}
RETURN_TYPES = (IO.STRING,)
FUNCTION = "main"
OUTPUT_NODE = True
CATEGORY = "utilities"
SEARCH_ALIASES = ["show output", "inspect", "debug", "print value", "show text"]
DESCRIPTION = "Preview any input value as text."
def main(self, source=None):
torch.set_printoptions(edgeitems=6)
value = 'None'
if isinstance(source, str):
value = source
elif isinstance(source, (int, float, bool)):
value = str(source)
elif source is not None:
try:
value = json.dumps(source, indent=4, ensure_ascii=False)
except Exception:
try:
value = str(source)
except Exception:
value = 'source exists, but could not be serialized.'
torch.set_printoptions()
return {"ui": {"text": (value,)}, "result": (value,)}
NODE_CLASS_MAPPINGS = {
"PreviewAny": PreviewAny,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"PreviewAny": "Preview as Text",
}
@@ -0,0 +1,113 @@
import logging
from spandrel import ModelLoader, ImageModelDescriptor
from comfy import model_management
import torch
import comfy.utils
import folder_paths
from typing_extensions import override
from comfy_api.latest import ComfyExtension, io
import comfy.model_management
import comfy.model_patcher
try:
from spandrel_extra_arches import EXTRA_REGISTRY
from spandrel import MAIN_REGISTRY
MAIN_REGISTRY.add(*EXTRA_REGISTRY)
logging.info("Successfully imported spandrel_extra_arches: support for non commercial upscale models.")
except:
pass
class UpscaleModelLoader(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="UpscaleModelLoader",
display_name="Load Upscale Model",
category="model/loaders",
inputs=[
io.Combo.Input("model_name", options=folder_paths.get_filename_list("upscale_models")),
],
outputs=[
io.UpscaleModel.Output(),
],
)
@classmethod
def execute(cls, model_name) -> io.NodeOutput:
model_path = folder_paths.get_full_path_or_raise("upscale_models", model_name)
sd = comfy.utils.load_torch_file(model_path, safe_load=True)
if "module.layers.0.residual_group.blocks.0.norm1.weight" in sd:
sd = comfy.utils.state_dict_prefix_replace(sd, {"module.":""})
out = ModelLoader().load_from_state_dict(sd).eval()
if not isinstance(out, ImageModelDescriptor):
raise Exception("Upscale model must be a single-image model.")
out.patcher = comfy.model_patcher.CoreModelPatcher(out.model, load_device=model_management.get_torch_device(), offload_device=model_management.unet_offload_device())
return io.NodeOutput(out)
load_model = execute # TODO: remove
class ImageUpscaleWithModel(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="ImageUpscaleWithModel",
display_name="Upscale Image (using Model)",
category="image/upscaling",
search_aliases=["upscale", "upscaler", "upsc", "enlarge image", "super resolution", "hires", "superres", "increase resolution"],
inputs=[
io.UpscaleModel.Input("upscale_model"),
io.Image.Input("image"),
],
outputs=[
io.Image.Output(),
],
)
@classmethod
def execute(cls, upscale_model, image) -> io.NodeOutput:
device = upscale_model.patcher.load_device
memory_required = (512 * 512 * 3) * image.element_size() * max(upscale_model.scale, 1.0) * 384.0 #The 384.0 is an estimate of how much some of these models take, TODO: make it more accurate
memory_required += image.nelement() * image.element_size()
model_management.load_models_gpu([upscale_model.patcher], memory_required=memory_required, force_full_load=True)
in_img = image.movedim(-1,-3).to(device)
tile = 512
overlap = 32
output_device = comfy.model_management.intermediate_device()
oom = True
while oom:
try:
steps = in_img.shape[0] * comfy.utils.get_tiled_scale_steps(in_img.shape[3], in_img.shape[2], tile_x=tile, tile_y=tile, overlap=overlap)
pbar = comfy.utils.ProgressBar(steps)
s = comfy.utils.tiled_scale(in_img, lambda a: upscale_model(a.float()), tile_x=tile, tile_y=tile, overlap=overlap, upscale_amount=upscale_model.scale, pbar=pbar, output_device=output_device)
oom = False
except Exception as e:
model_management.raise_non_oom(e)
tile //= 2
if tile < 128:
raise e
s = torch.clamp(s.movedim(-3,-1), min=0, max=1.0).to(comfy.model_management.intermediate_dtype())
return io.NodeOutput(s)
upscale = execute # TODO: remove
class UpscaleModelExtension(ComfyExtension):
@override
async def get_node_list(self) -> list[type[io.ComfyNode]]:
return [
UpscaleModelLoader,
ImageUpscaleWithModel,
]
async def comfy_entrypoint() -> UpscaleModelExtension:
return UpscaleModelExtension()
@@ -0,0 +1,320 @@
import os
import av
import torch
import folder_paths
import json
from typing import Optional
from typing_extensions import override
from fractions import Fraction
from comfy_api.latest import ComfyExtension, io, ui, Input, InputImpl, Types
from comfy.cli_args import args
class SaveWEBM(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="SaveWEBM",
search_aliases=["export webm"],
display_name="Save WEBM",
category="video",
is_experimental=True,
inputs=[
io.Image.Input("images", tooltip="RGBA images are saved with their alpha channel as transparency (vp9 codec only)."),
io.String.Input("filename_prefix", default="ComfyUI"),
io.Combo.Input("codec", options=["vp9", "av1"]),
io.Float.Input("fps", default=24.0, min=0.01, max=1000.0, step=0.01),
io.Float.Input("crf", default=32.0, min=0, max=63.0, step=1, tooltip="Higher crf means lower quality with a smaller file size, lower crf means higher quality higher filesize."),
],
hidden=[io.Hidden.prompt, io.Hidden.extra_pnginfo],
is_output_node=True,
outputs=[io.Image.Output(display_name="images")]
)
@classmethod
def execute(cls, images, codec, fps, filename_prefix, crf) -> io.NodeOutput:
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(
filename_prefix, folder_paths.get_output_directory(), images[0].shape[1], images[0].shape[0]
)
file = f"{filename}_{counter:05}_.webm"
container = av.open(os.path.join(full_output_folder, file), mode="w")
if cls.hidden.prompt is not None:
container.metadata["prompt"] = json.dumps(cls.hidden.prompt)
if cls.hidden.extra_pnginfo is not None:
for x in cls.hidden.extra_pnginfo:
container.metadata[x] = json.dumps(cls.hidden.extra_pnginfo[x])
# Save transparency when the images carry an alpha channel (RGBA) and the codec supports it.
# vp9 -> yuva420p; other codecs have no usable alpha path, so the alpha is ignored.
save_alpha = images.shape[-1] == 4 and codec == "vp9"
codec_map = {"vp9": "libvpx-vp9", "av1": "libsvtav1"}
stream = container.add_stream(codec_map[codec], rate=Fraction(round(fps * 1000), 1000))
stream.width = images.shape[-2]
stream.height = images.shape[-3]
stream.pix_fmt = "yuva420p" if save_alpha else ("yuv420p10le" if codec == "av1" else "yuv420p")
stream.bit_rate = 0
stream.options = {'crf': str(crf)}
if codec == "av1":
stream.options["preset"] = "6"
for frame in images:
if save_alpha:
frame = av.VideoFrame.from_ndarray(torch.clamp(frame[..., :4] * 255, min=0, max=255).to(device=torch.device("cpu"), dtype=torch.uint8).numpy(), format="rgba")
else:
frame = av.VideoFrame.from_ndarray(torch.clamp(frame[..., :3] * 255, min=0, max=255).to(device=torch.device("cpu"), dtype=torch.uint8).numpy(), format="rgb24")
for packet in stream.encode(frame):
container.mux(packet)
container.mux(stream.encode())
container.close()
return io.NodeOutput(images, ui=ui.PreviewVideo([ui.SavedResult(file, subfolder, io.FolderType.output)]))
class SaveVideo(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="SaveVideo",
search_aliases=["export video"],
display_name="Save Video",
category="video",
essentials_category="Basics",
description="Saves the input videos to your ComfyUI output directory.",
inputs=[
io.Video.Input("video", tooltip="The video to save."),
io.String.Input("filename_prefix", default="video/ComfyUI", tooltip="The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."),
io.Combo.Input("format", options=Types.VideoContainer.as_input(), default="auto", tooltip="The format to save the video as."),
io.DynamicCombo.Input(
"codec",
options=[
io.DynamicCombo.Option("auto", []),
io.DynamicCombo.Option(
"h264",
[
io.DynamicCombo.Input(
"encoding",
display_name="encoding mode",
options=[
io.DynamicCombo.Option("auto", []),
io.DynamicCombo.Option(
"re-encode",
[io.Float.Input("crf", default=23.0, min=0.0, max=51.0, step=1.0, tooltip="Lower values produce higher quality and larger files.")],
),
],
optional=True,
tooltip="Automatic preserves compatible H.264 streams. Re-encode applies a custom CRF.",
),
],
),
],
tooltip="The codec to use for the video.",
),
],
hidden=[io.Hidden.prompt, io.Hidden.extra_pnginfo],
is_output_node=True,
outputs=[io.Video.Output("video")],
)
@classmethod
def execute(cls, video: Input.Video, filename_prefix, format: str, codec: io.DynamicCombo.Type) -> io.NodeOutput:
codec_name = codec["codec"]
encoding = codec.get("encoding") or {}
width, height = video.get_dimensions()
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(
filename_prefix,
folder_paths.get_output_directory(),
width,
height
)
saved_metadata = None
if not args.disable_metadata:
metadata = {}
if cls.hidden.extra_pnginfo is not None:
metadata.update(cls.hidden.extra_pnginfo)
if cls.hidden.prompt is not None:
metadata["prompt"] = cls.hidden.prompt
if len(metadata) > 0:
saved_metadata = metadata
file = f"{filename}_{counter:05}_.{Types.VideoContainer.get_extension(format)}"
video.save_to(
os.path.join(full_output_folder, file),
format=Types.VideoContainer(format),
codec=codec_name,
metadata=saved_metadata,
crf=encoding.get("crf"),
)
return io.NodeOutput(video, ui=ui.PreviewVideo([ui.SavedResult(file, subfolder, io.FolderType.output)]))
class CreateVideo(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="CreateVideo",
search_aliases=["images to video"],
display_name="Create Video",
category="video",
essentials_category="Video Tools",
description="Create a video from images.",
inputs=[
io.Image.Input("images", tooltip="The images to create a video from."),
io.Float.Input("fps", default=30.0, min=1.0, max=120.0, step=1.0),
io.Audio.Input("audio", optional=True, tooltip="The audio to add to the video."),
io.Int.Input(
"bit_depth",
min=8,
max=10,
default=8,
step=2,
tooltip="Bit depth of the created video. 10-bit keeps smoother gradients with less"
" banding, but some players and downstream nodes may not support it.",
optional=True,
display_mode=io.NumberDisplay.number,
),
],
outputs=[
io.Video.Output(),
],
)
@classmethod
def execute(
cls, images: Input.Image, fps: float, audio: Optional[Input.Audio] = None, bit_depth: int = 8,
) -> io.NodeOutput:
return io.NodeOutput(
InputImpl.VideoFromComponents(
Types.VideoComponents(images=images, audio=audio, frame_rate=Fraction(fps)),
bit_depth=bit_depth,
)
)
class GetVideoComponents(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="GetVideoComponents",
search_aliases=["extract frames", "split video", "video to images", "demux"],
display_name="Get Video Components",
category="video",
description="Extracts all components from a video: frames, audio, framerate, and bit depth.",
inputs=[
io.Video.Input("video", tooltip="The video to extract components from."),
],
outputs=[
io.Image.Output(display_name="images"),
io.Audio.Output(display_name="audio"),
io.Float.Output(display_name="fps"),
io.Int.Output(display_name="bit_depth"),
],
)
@classmethod
def execute(cls, video: Input.Video) -> io.NodeOutput:
components = video.get_components()
return io.NodeOutput(components.images, components.audio, float(components.frame_rate), video.get_bit_depth())
class LoadVideo(io.ComfyNode):
@classmethod
def define_schema(cls):
input_dir = folder_paths.get_input_directory()
files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
files = folder_paths.filter_files_content_types(files, ["video"])
return io.Schema(
node_id="LoadVideo",
search_aliases=["import video", "open video", "video file"],
display_name="Load Video",
category="video",
essentials_category="Basics",
inputs=[
io.Combo.Input("file", options=sorted(files), upload=io.UploadType.video),
],
outputs=[
io.Video.Output(),
],
)
@classmethod
def execute(cls, file) -> io.NodeOutput:
video_path = folder_paths.get_annotated_filepath(file)
return io.NodeOutput(InputImpl.VideoFromFile(video_path))
@classmethod
def fingerprint_inputs(s, file):
video_path = folder_paths.get_annotated_filepath(file)
mod_time = os.path.getmtime(video_path)
# Instead of hashing the file, we can just use the modification time to avoid
# rehashing large files.
return mod_time
@classmethod
def validate_inputs(s, file):
if not folder_paths.exists_annotated_filepath(file):
return "Invalid video file: {}".format(file)
return True
class VideoSlice(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="Video Slice",
display_name="Trim Video",
search_aliases=["trim video duration", "skip first frames", "frame load cap", "start time"],
category="video",
essentials_category="Video Tools",
inputs=[
io.Video.Input("video"),
io.Float.Input(
"start_time",
default=0.0,
max=1e5,
min=-1e5,
step=0.001,
tooltip="Start time in seconds",
),
io.Float.Input(
"duration",
default=0.0,
min=0.0,
step=0.001,
tooltip="Duration in seconds, or 0 for unlimited duration",
),
io.Boolean.Input(
"strict_duration",
default=False,
tooltip="If True, when the specified duration is not possible, an error will be raised.",
),
],
outputs=[
io.Video.Output(),
],
)
@classmethod
def execute(cls, video: io.Video.Type, start_time: float, duration: float, strict_duration: bool) -> io.NodeOutput:
trimmed = video.as_trimmed(start_time, duration, strict_duration=strict_duration)
if trimmed is not None:
return io.NodeOutput(trimmed)
raise ValueError(
f"Failed to slice video:\nSource duration: {video.get_duration()}\nStart time: {start_time}\nTarget duration: {duration}"
)
class VideoExtension(ComfyExtension):
@override
async def get_node_list(self) -> list[type[io.ComfyNode]]:
return [
SaveWEBM,
SaveVideo,
CreateVideo,
GetVideoComponents,
LoadVideo,
VideoSlice,
]
async def comfy_entrypoint() -> VideoExtension:
return VideoExtension()
@@ -0,0 +1,6 @@
tree f84b37182549cf760e146f94bc6a38b0395b004e
parent ef0d752e5ee41d6f40c685ecd729e53d18c0f075
author comfyanonymous <comfyanonymous@protonmail.com> 1787695106 -0400
committer comfyanonymous <comfyanonymous@protonmail.com> 1787695106 -0400
ComfyUI v0.34.0
@@ -0,0 +1,2 @@
From https://github.com/Comfy-Org/ComfyUI
* tag v0.34.0 -> FETCH_HEAD
@@ -0,0 +1,2 @@
From https://github.com/Comfy-Org/ComfyUI
* tag v0.34.0 -> FETCH_HEAD
@@ -0,0 +1,5 @@
{
"object": "12d5279438bfefc058a269eae805ceab6047777f",
"commit": "12d5279438bfefc058a269eae805ceab6047777f",
"tag": "v0.34.0"
}
@@ -0,0 +1,6 @@
tree f84b37182549cf760e146f94bc6a38b0395b004e
parent ef0d752e5ee41d6f40c685ecd729e53d18c0f075
author comfyanonymous <comfyanonymous@protonmail.com> 1787695106 -0400
committer comfyanonymous <comfyanonymous@protonmail.com> 1787695106 -0400
ComfyUI v0.34.0
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,414 @@
import logging
import comfy.sd
import comfy.model_sampling
import comfy.latent_formats
import comfy.ldm.modules.attention
import nodes
import torch
import node_helpers
class LCM(comfy.model_sampling.EPS):
def calculate_denoised(self, sigma, model_output, model_input):
timestep = self.timestep(sigma).view(sigma.shape[:1] + (1,) * (model_output.ndim - 1))
sigma = sigma.view(sigma.shape[:1] + (1,) * (model_output.ndim - 1))
x0 = model_input - model_output * sigma
sigma_data = 0.5
scaled_timestep = timestep * 10.0 #timestep_scaling
c_skip = sigma_data**2 / (scaled_timestep**2 + sigma_data**2)
c_out = scaled_timestep / (scaled_timestep**2 + sigma_data**2) ** 0.5
return c_out * x0 + c_skip * model_input
class ModelSamplingDiscreteDistilled(comfy.model_sampling.ModelSamplingDiscrete):
original_timesteps = 50
def __init__(self, model_config=None, zsnr=None):
super().__init__(model_config, zsnr=zsnr)
self.skip_steps = self.num_timesteps // self.original_timesteps
sigmas_valid = torch.zeros((self.original_timesteps), dtype=torch.float32)
for x in range(self.original_timesteps):
sigmas_valid[self.original_timesteps - 1 - x] = self.sigmas[self.num_timesteps - 1 - x * self.skip_steps]
self.set_sigmas(sigmas_valid)
def timestep(self, sigma):
log_sigma = sigma.log()
dists = log_sigma.to(self.log_sigmas.device) - self.log_sigmas[:, None]
return (dists.abs().argmin(dim=0).view(sigma.shape) * self.skip_steps + (self.skip_steps - 1)).to(sigma.device)
def sigma(self, timestep):
t = torch.clamp(((timestep.float().to(self.log_sigmas.device) - (self.skip_steps - 1)) / self.skip_steps).float(), min=0, max=(len(self.sigmas) - 1))
low_idx = t.floor().long()
high_idx = t.ceil().long()
w = t.frac()
log_sigma = (1 - w) * self.log_sigmas[low_idx] + w * self.log_sigmas[high_idx]
return log_sigma.exp().to(timestep.device)
class ModelSamplingDiscrete:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"sampling": (["eps", "v_prediction", "lcm", "x0", "img_to_img", "img_to_img_flow"],),
"zsnr": ("BOOLEAN", {"default": False, "advanced": True}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch"
def patch(self, model, sampling, zsnr):
m = model.clone()
sampling_base = comfy.model_sampling.ModelSamplingDiscrete
if sampling == "eps":
sampling_type = comfy.model_sampling.EPS
elif sampling == "v_prediction":
sampling_type = comfy.model_sampling.V_PREDICTION
elif sampling == "lcm":
sampling_type = LCM
sampling_base = ModelSamplingDiscreteDistilled
elif sampling == "x0":
sampling_type = comfy.model_sampling.X0
elif sampling == "img_to_img":
sampling_type = comfy.model_sampling.IMG_TO_IMG
elif sampling == "img_to_img_flow":
sampling_type = comfy.model_sampling.IMG_TO_IMG_FLOW
class ModelSamplingAdvanced(sampling_base, sampling_type):
pass
model_sampling = ModelSamplingAdvanced(model.model.model_config, zsnr=zsnr)
m.add_object_patch("model_sampling", model_sampling)
return (m, )
class ModelSamplingStableCascade:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"shift": ("FLOAT", {"default": 2.0, "min": 0.0, "max": 100.0, "step":0.01}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch/stable cascade"
def patch(self, model, shift):
m = model.clone()
sampling_base = comfy.model_sampling.StableCascadeSampling
sampling_type = comfy.model_sampling.EPS
class ModelSamplingAdvanced(sampling_base, sampling_type):
pass
model_sampling = ModelSamplingAdvanced(model.model.model_config)
model_sampling.set_parameters(shift)
m.add_object_patch("model_sampling", model_sampling)
return (m, )
class ModelSamplingSD3:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"shift": ("FLOAT", {"default": 3.0, "min": 0.0, "max": 100.0, "step":0.01}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch/stable diffusion"
def patch(self, model, shift, multiplier=1000):
m = model.clone()
sampling_base = comfy.model_sampling.ModelSamplingDiscreteFlow
sampling_type = comfy.model_sampling.CONST
class ModelSamplingAdvanced(sampling_base, sampling_type):
pass
original = m.get_model_object("model_sampling")
model_sampling = ModelSamplingAdvanced(model.model.model_config)
model_sampling.set_parameters(shift=shift, multiplier=multiplier)
if hasattr(original, "noise_scale"):
model_sampling.set_noise_scale(original.noise_scale)
m.add_object_patch("model_sampling", model_sampling)
return (m, )
class ModelSamplingAuraFlow(ModelSamplingSD3):
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"shift": ("FLOAT", {"default": 1.73, "min": 0.0, "max": 100.0, "step":0.01}),
}}
FUNCTION = "patch_aura"
CATEGORY = "model/patch"
def patch_aura(self, model, shift):
return self.patch(model, shift, multiplier=1.0)
class ModelSamplingFlux:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"max_shift": ("FLOAT", {"default": 1.15, "min": 0.0, "max": 100.0, "step":0.01, "advanced": True}),
"base_shift": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 100.0, "step":0.01, "advanced": True}),
"width": ("INT", {"default": 1024, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 8}),
"height": ("INT", {"default": 1024, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 8}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch/flux"
def patch(self, model, max_shift, base_shift, width, height):
m = model.clone()
x1 = 256
x2 = 4096
mm = (max_shift - base_shift) / (x2 - x1)
b = base_shift - mm * x1
shift = (width * height / (8 * 8 * 2 * 2)) * mm + b
sampling_base = comfy.model_sampling.ModelSamplingFlux
sampling_type = comfy.model_sampling.CONST
class ModelSamplingAdvanced(sampling_base, sampling_type):
pass
model_sampling = ModelSamplingAdvanced(model.model.model_config)
model_sampling.set_parameters(shift=shift)
m.add_object_patch("model_sampling", model_sampling)
return (m, )
class ModelSamplingContinuousEDM:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"sampling": (["v_prediction", "edm", "edm_playground_v2.5", "eps", "cosmos_rflow"],),
"sigma_max": ("FLOAT", {"default": 120.0, "min": 0.0, "max": 1000.0, "step":0.001, "round": False, "advanced": True}),
"sigma_min": ("FLOAT", {"default": 0.002, "min": 0.0, "max": 1000.0, "step":0.001, "round": False, "advanced": True}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch"
def patch(self, model, sampling, sigma_max, sigma_min):
m = model.clone()
sampling_base = comfy.model_sampling.ModelSamplingContinuousEDM
latent_format = None
sigma_data = 1.0
if sampling == "eps":
sampling_type = comfy.model_sampling.EPS
elif sampling == "edm":
sampling_type = comfy.model_sampling.EDM
sigma_data = 0.5
elif sampling == "v_prediction":
sampling_type = comfy.model_sampling.V_PREDICTION
elif sampling == "edm_playground_v2.5":
sampling_type = comfy.model_sampling.EDM
sigma_data = 0.5
latent_format = comfy.latent_formats.SDXL_Playground_2_5()
elif sampling == "cosmos_rflow":
sampling_type = comfy.model_sampling.COSMOS_RFLOW
sampling_base = comfy.model_sampling.ModelSamplingCosmosRFlow
class ModelSamplingAdvanced(sampling_base, sampling_type):
pass
model_sampling = ModelSamplingAdvanced(model.model.model_config)
model_sampling.set_parameters(sigma_min, sigma_max, sigma_data)
m.add_object_patch("model_sampling", model_sampling)
if latent_format is not None:
m.add_object_patch("latent_format", latent_format)
return (m, )
class ModelSamplingContinuousV:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"sampling": (["v_prediction"],),
"sigma_max": ("FLOAT", {"default": 500.0, "min": 0.0, "max": 1000.0, "step":0.001, "round": False, "advanced": True}),
"sigma_min": ("FLOAT", {"default": 0.03, "min": 0.0, "max": 1000.0, "step":0.001, "round": False, "advanced": True}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch"
def patch(self, model, sampling, sigma_max, sigma_min):
m = model.clone()
sigma_data = 1.0
if sampling == "v_prediction":
sampling_type = comfy.model_sampling.V_PREDICTION
class ModelSamplingAdvanced(comfy.model_sampling.ModelSamplingContinuousV, sampling_type):
pass
model_sampling = ModelSamplingAdvanced(model.model.model_config)
model_sampling.set_parameters(sigma_min, sigma_max, sigma_data)
m.add_object_patch("model_sampling", model_sampling)
return (m, )
class RescaleCFG:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"multiplier": ("FLOAT", {"default": 0.7, "min": 0.0, "max": 1.0, "step": 0.01}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch"
def patch(self, model, multiplier):
model_sampling = model.get_model_object("model_sampling")
is_flow = isinstance(model_sampling, comfy.model_sampling.CONST)
def rescale_cfg(args):
x_orig = args["input"]
cond_scale = args["cond_scale"]
if is_flow:
# Flow-matching models: cond_denoised/uncond_denoised are x_0 estimates,
# so the eps↔v conversion below would be wrong. Rescale directly in x_0 space.
x_0_cond = args["cond_denoised"]
x_0_uncond = args["uncond_denoised"]
x_0_cfg = x_0_uncond + cond_scale * (x_0_cond - x_0_uncond)
dims = tuple(range(1, x_0_cond.ndim))
ro_pos = x_0_cond.std(dim=dims, keepdim=True)
ro_cfg = x_0_cfg.std(dim=dims, keepdim=True).clamp(min=1e-8)
x_0_rescaled = x_0_cfg * (ro_pos / ro_cfg)
x_0_final = multiplier * x_0_rescaled + (1.0 - multiplier) * x_0_cfg
return x_orig - x_0_final
cond = args["cond"]
uncond = args["uncond"]
sigma = args["sigma"]
sigma = sigma.view(sigma.shape[:1] + (1,) * (cond.ndim - 1))
#rescale cfg has to be done on v-pred model output
x = x_orig / (sigma * sigma + 1.0)
cond = ((x - (x_orig - cond)) * (sigma ** 2 + 1.0) ** 0.5) / (sigma)
uncond = ((x - (x_orig - uncond)) * (sigma ** 2 + 1.0) ** 0.5) / (sigma)
#rescalecfg
x_cfg = uncond + cond_scale * (cond - uncond)
ro_pos = torch.std(cond, dim=(1,2,3), keepdim=True)
ro_cfg = torch.std(x_cfg, dim=(1,2,3), keepdim=True)
x_rescaled = x_cfg * (ro_pos / ro_cfg)
x_final = multiplier * x_rescaled + (1.0 - multiplier) * x_cfg
return x_orig - (x - x_final * sigma / (sigma * sigma + 1.0) ** 0.5)
m = model.clone()
m.set_model_sampler_cfg_function(rescale_cfg)
return (m, )
class ModelNoiseScale:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"noise_scale": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 64.0, "step": 0.01,
"tooltip": "Absolute training noise scale. For example HiDream-O1 base: 8.0, dev: 7.5."}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch"
def patch(self, model, noise_scale):
m = model.clone()
original = m.get_model_object("model_sampling")
ms = type(original)(m.model.model_config)
ms.set_parameters(shift=original.shift, multiplier=original.multiplier)
ms.set_noise_scale(noise_scale)
m.add_object_patch("model_sampling", ms)
return (m, )
class ModelComputeDtype:
SEARCH_ALIASES = ["model precision", "change dtype"]
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"dtype": (["default", "fp32", "fp16", "bf16"], {"advanced": True}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "advanced/debug"
def patch(self, model, dtype):
m = model.clone()
m.set_model_compute_dtype(node_helpers.string_to_torch_dtype(dtype))
return (m, )
class ModelAttentionBackend:
@classmethod
def INPUT_TYPES(s):
backends = ["pytorch attention"]
if comfy.ldm.modules.attention.COMFY_KITCHEN_INT8_ATTENTION_IS_AVAILABLE:
backends.append("comfy kitchen attention")
return {"required": {"model": ("MODEL",),
"attention": (backends,),
}}
@classmethod
def VALIDATE_INPUTS(s, attention):
return True
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
CATEGORY = "model/patch"
def patch(self, model, attention):
attention_name = {
"comfy kitchen attention": "comfy_kitchen_int8",
"pytorch attention": "pytorch",
}.get(attention)
attention_function = comfy.ldm.modules.attention.get_attention_function(attention_name, None)
if attention_function is None:
logging.warning("Attention backend '%s' is unavailable; using PyTorch attention.", attention)
attention_function = comfy.ldm.modules.attention.get_attention_function("pytorch")
m = model.clone()
m.set_model_optimized_attention(attention_function)
return (m, )
NODE_CLASS_MAPPINGS = {
"ModelSamplingDiscrete": ModelSamplingDiscrete,
"ModelSamplingContinuousEDM": ModelSamplingContinuousEDM,
"ModelSamplingContinuousV": ModelSamplingContinuousV,
"ModelSamplingStableCascade": ModelSamplingStableCascade,
"ModelSamplingSD3": ModelSamplingSD3,
"ModelSamplingAuraFlow": ModelSamplingAuraFlow,
"ModelSamplingFlux": ModelSamplingFlux,
"ModelNoiseScale": ModelNoiseScale,
"RescaleCFG": RescaleCFG,
"ModelComputeDtype": ModelComputeDtype,
"ModelAttentionBackend": ModelAttentionBackend,
}
@@ -0,0 +1,6 @@
tree 31655be0b414a37e23e142247f5e0b1abf5b6b1a
parent 7154dc2b9b6c136bfcca01bed1052b939a1d027c
author 18660801526 <18660801526@163.com> 1787101782 +0800
committer 18660801526 <18660801526@163.com> 1787101782 +0800
docs: 致谢 Comfyui_Minimax_h3_latent_Upscaler
@@ -0,0 +1,2 @@
From https://github.com/AIMixer/ComfyUI_MiniMaxH3_Director
* branch 6ff79b4aa15d56055cfa61d915889867027c9ab1 -> FETCH_HEAD
@@ -0,0 +1,7 @@
{
"url": "https://api.comfy.org/nodes/comfyui-minimaxh3-director",
"status": 404,
"recorded_at": "2026-11-01T03:51:35.775899+00:00",
"candidate_slug": true,
"not_absence_proof": true
}
@@ -0,0 +1 @@
{"error":"","message":"Node not found"}
@@ -0,0 +1,5 @@
{
"object": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1"
}
@@ -0,0 +1,6 @@
tree 31655be0b414a37e23e142247f5e0b1abf5b6b1a
parent 7154dc2b9b6c136bfcca01bed1052b939a1d027c
author 18660801526 <18660801526@163.com> 1787101782 +0800
committer 18660801526 <18660801526@163.com> 1787101782 +0800
docs: 致谢 Comfyui_Minimax_h3_latent_Upscaler
@@ -0,0 +1,444 @@
{
"sha": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"truncated": false,
"tree": [
{
"path": ".gitignore",
"mode": "100644",
"type": "blob",
"sha": "df5e3e9653548f1ea5785d2d86109fd65acec2f0"
},
{
"path": "LICENSE",
"mode": "100644",
"type": "blob",
"sha": "56fd57f1eafe4e49920443b8465cd019803012f0"
},
{
"path": "README.md",
"mode": "100644",
"type": "blob",
"sha": "cab8559bf447c6abca64b630898018a3206eac74"
},
{
"path": "README_EN.md",
"mode": "100644",
"type": "blob",
"sha": "f055934aac406e810942a7b792e1241b540934bf"
},
{
"path": "README_ZH.md",
"mode": "100644",
"type": "blob",
"sha": "07c665fa49990615425d7ffbd40841603096f43d"
},
{
"path": "__init__.py",
"mode": "100644",
"type": "blob",
"sha": "e6dedcad084f6e726eddce0866c9a89ee96d7052"
},
{
"path": "director/__init__.py",
"mode": "100644",
"type": "blob",
"sha": "28dcd07a265eccb0c8b88cda9d799eaac6c61c36"
},
{
"path": "director/audio_export.py",
"mode": "100644",
"type": "blob",
"sha": "2082a137cbe8c6ea5e3c9ad1f79d052004d17ee3"
},
{
"path": "director/core_sampling.py",
"mode": "100644",
"type": "blob",
"sha": "9b906a540d74ff107808e74d0e4da5b36334f7e3"
},
{
"path": "director/core_text_encode.py",
"mode": "100644",
"type": "blob",
"sha": "77e36bda87345ec38e1e8c3dcdb7bc16bc36d053"
},
{
"path": "director/executor_core.py",
"mode": "100644",
"type": "blob",
"sha": "6aa31826fb3c66da6ae0866d765c4f51c60db616"
},
{
"path": "director/external_groups.py",
"mode": "100644",
"type": "blob",
"sha": "0495981e5033374d3043c854c5cdcf691d54f243"
},
{
"path": "director/fl2v_timeline.py",
"mode": "100644",
"type": "blob",
"sha": "b448ad771c88a03daac5e4d74c16e8a98d270173"
},
{
"path": "director/frame_align.py",
"mode": "100644",
"type": "blob",
"sha": "4d2ba872676746e108903e4300dd55e0a5db1340"
},
{
"path": "director/gen_timeline.py",
"mode": "100644",
"type": "blob",
"sha": "f8a3133503e55f7f7568bda52031dc6354e9b0a4"
},
{
"path": "director/h3_context_patches.py",
"mode": "100644",
"type": "blob",
"sha": "c6ef9eb53871a2954f1830d6fa41e22ba1f08cd1"
},
{
"path": "director/h3_latent_upscale.py",
"mode": "100644",
"type": "blob",
"sha": "d06f357659e46df0124f91317f9aa32a5989a08b"
},
{
"path": "director/h3_motion_context.py",
"mode": "100644",
"type": "blob",
"sha": "0418b3d46c6ed4e665111ed6eff798d1266901cd"
},
{
"path": "director/http_routes.py",
"mode": "100644",
"type": "blob",
"sha": "367ee0ad0d56628f12b6b89e3112273a091f8e39"
},
{
"path": "director/plan.py",
"mode": "100644",
"type": "blob",
"sha": "2638aca5a2d57ce5c580e80cebcf56d8f4b498a3"
},
{
"path": "director/progress.py",
"mode": "100644",
"type": "blob",
"sha": "b0a0084fbc9defda556067053fb4ed8d528c3aff"
},
{
"path": "director/prompt_enhance_media.py",
"mode": "100644",
"type": "blob",
"sha": "ac31adb110c9eb129f4b5550fe8f728941599cca"
},
{
"path": "director/prompt_enhance_routes.py",
"mode": "100644",
"type": "blob",
"sha": "078771064ddbf19e97910f6bdc7be3e4de408062"
},
{
"path": "director/prompt_enhance_runtime.py",
"mode": "100644",
"type": "blob",
"sha": "ab072306a18f835be4cb69f67f122e5df4050d73"
},
{
"path": "director/refine_pack.py",
"mode": "100644",
"type": "blob",
"sha": "a486f91ecfb5be65cebe5307ffc699d1e43c1168"
},
{
"path": "director/refine_sampling.py",
"mode": "100644",
"type": "blob",
"sha": "58dbcd8719e95c64cdb8fa0a6ce2d3a08b457ec4"
},
{
"path": "director/segment_cache.py",
"mode": "100644",
"type": "blob",
"sha": "d20677c4069bc3166185b2e21e7af010c9e64c99"
},
{
"path": "director/segment_continuity.py",
"mode": "100644",
"type": "blob",
"sha": "5c1f0099e0de7b54b2b86d1c50910661fc0d39f2"
},
{
"path": "director/segment_mp4_export.py",
"mode": "100644",
"type": "blob",
"sha": "8485d588827b202d58d1f27b61e163364859c8a9"
},
{
"path": "director/segment_runtime.py",
"mode": "100644",
"type": "blob",
"sha": "e8d11af53468fb511c591d3e178ea27be873f4da"
},
{
"path": "director/tae_preview.py",
"mode": "100644",
"type": "blob",
"sha": "6e227d108cc09e38329ce7ce631cff3e1462b352"
},
{
"path": "director/vram_cleanup.py",
"mode": "100644",
"type": "blob",
"sha": "fc0090a78b14551ce073b9a96f57d35aba2662f6"
},
{
"path": "docs/screenshot.png",
"mode": "100644",
"type": "blob",
"sha": "d9c8084576ef65e9b89ef97ed5400805eaad18d0"
},
{
"path": "example_workflows/README.md",
"mode": "100644",
"type": "blob",
"sha": "81518298f8ea37e311d0665a71d4e3ff7cf938c9"
},
{
"path": "example_workflows/minimax_h3_director_external_groups_i2v.json",
"mode": "100644",
"type": "blob",
"sha": "c13ee02f30ee67f5412f31f10585a1e278e2a1d7"
},
{
"path": "example_workflows/minimax_h3_director_external_groups_r2v.json",
"mode": "100644",
"type": "blob",
"sha": "eb00a1b6e2351697e83e485a41c1c022d17fc28b"
},
{
"path": "example_workflows/minimax_h3_director_fl2v.json",
"mode": "100644",
"type": "blob",
"sha": "d26906f886ac3787ad19786f26a8d63d48b8c9a7"
},
{
"path": "example_workflows/minimax_h3_director_r2v.json",
"mode": "100644",
"type": "blob",
"sha": "2602200b1a8f0c99940553bbb0eb994fab967b5e"
},
{
"path": "example_workflows/minimax_h3_director_rv2v.json",
"mode": "100644",
"type": "blob",
"sha": "5a306f6722f7d7217ade8d72a4ca83c65d4d5341"
},
{
"path": "example_workflows/minimax_h3_director_t2v.json",
"mode": "100644",
"type": "blob",
"sha": "b5d4c2caaf0245731c2efba66164483333346636"
},
{
"path": "example_workflows/minimax_h3_director_v2v.json",
"mode": "100644",
"type": "blob",
"sha": "f944f47dfaf5d9467d19d68c6a414bc858dec704"
},
{
"path": "example_workflows/minimax_h3_director_\u4e8c\u91c7_\u52a0\u901f.json",
"mode": "100644",
"type": "blob",
"sha": "b714e1ea73c7af755c7f5c8ab82d4a8ff4f7da5d"
},
{
"path": "example_workflows/minimax_h3_director_\u52a0\u901f\u7248.json",
"mode": "100644",
"type": "blob",
"sha": "b4f4a509e6e7be08ec4e8882aa364ad0cd620a71"
},
{
"path": "lib/__init__.py",
"mode": "100644",
"type": "blob",
"sha": "3fb281e84c9aa5f1874fd9aaea6fc9d32a8598c4"
},
{
"path": "lib/audio_io.py",
"mode": "100644",
"type": "blob",
"sha": "d3b73f22dd06746f79599a5c500f9f2df9550c23"
},
{
"path": "lib/image_prep.py",
"mode": "100644",
"type": "blob",
"sha": "8f3b1290ad4a6396d7cafaaed67dfc2d260ac650"
},
{
"path": "lib/official_pe_templates.py",
"mode": "100644",
"type": "blob",
"sha": "b3a25f63db6710b24fbbdccdd2d73d62ea509d68"
},
{
"path": "lib/prompt_enhance_templates.py",
"mode": "100644",
"type": "blob",
"sha": "0fa079cd6bba908b1d5a9da5b298fb1bb04d3a49"
},
{
"path": "lib/prompt_enhancer.py",
"mode": "100644",
"type": "blob",
"sha": "852fb8ee0ee348b4ee6dbb65e456d5836a170455"
},
{
"path": "lib/ref_audios.py",
"mode": "100644",
"type": "blob",
"sha": "f1ab8466b4b09cca40af086e92784b9b7723701b"
},
{
"path": "lib/ref_images.py",
"mode": "100644",
"type": "blob",
"sha": "ae1b176527df1c495b8d3da5755d4b26198876b3"
},
{
"path": "lib/ref_videos.py",
"mode": "100644",
"type": "blob",
"sha": "b431c1e70e16f694d1384f8b3a9bb5cf55522edb"
},
{
"path": "lib/shot_detect.py",
"mode": "100644",
"type": "blob",
"sha": "d6ff2a438741323140601d843335c2e179f18751"
},
{
"path": "lib/task_modes.py",
"mode": "100644",
"type": "blob",
"sha": "1aa3423e322ffbc733c97a8a1382e96fe7a339a6"
},
{
"path": "lib/task_prompts.py",
"mode": "100644",
"type": "blob",
"sha": "0f04fc5d42fb7682c379c61a98a40b87ad4bd15f"
},
{
"path": "lib/video_export.py",
"mode": "100644",
"type": "blob",
"sha": "77e98c04ebbafe58716694aac2357c78ab8df54b"
},
{
"path": "lib/video_io.py",
"mode": "100644",
"type": "blob",
"sha": "6a5c166f6ad404a7b18bb546a6e5b225b65eeabe"
},
{
"path": "nodes/__init__.py",
"mode": "100644",
"type": "blob",
"sha": "0c4a833a766c8a61cd204bd0d1cf7a55d22b4a89"
},
{
"path": "nodes/conditioning.py",
"mode": "100644",
"type": "blob",
"sha": "023be4d3aa268c534d8cc6ac2322daaaa044b31a"
},
{
"path": "nodes/director.py",
"mode": "100644",
"type": "blob",
"sha": "0f894b004fee8997b4fed98b83f07616188bfc14"
},
{
"path": "nodes/director_common.py",
"mode": "100644",
"type": "blob",
"sha": "8444bf4c9c559649af1c14278278c6968493fcab"
},
{
"path": "nodes/director_groups.py",
"mode": "100644",
"type": "blob",
"sha": "d87d8252c3cb323caceacc141bdbd9d4d252eeb7"
},
{
"path": "nodes/director_refine.py",
"mode": "100644",
"type": "blob",
"sha": "0f92428a073da9b7c022f98b64534cda60242af2"
},
{
"path": "pyproject.toml",
"mode": "100644",
"type": "blob",
"sha": "d62dfdbfc9cc0219db30005ed259c36618149a75"
},
{
"path": "requirements.txt",
"mode": "100644",
"type": "blob",
"sha": "ec483a2e893b726a6d71cf47b7daaa9686bdeafa"
},
{
"path": "web/js/minimax_fl2v.js",
"mode": "100644",
"type": "blob",
"sha": "b97bc7cdf257f57b975ec1284c2da5c6eb171ed0"
},
{
"path": "web/js/minimax_gen_timeline.js",
"mode": "100644",
"type": "blob",
"sha": "6f4cede8eeef67afc029b1e253ed97757ce42d2a"
},
{
"path": "web/js/minimax_i18n.js",
"mode": "100644",
"type": "blob",
"sha": "2b42124b6138fffa3c038898dabae01cab6e8755"
},
{
"path": "web/js/minimax_image_batch.js",
"mode": "100644",
"type": "blob",
"sha": "88df2be5df0c3607a67a5b80a1dac56196f3f491"
},
{
"path": "web/js/minimax_prompt_enhancer.js",
"mode": "100644",
"type": "blob",
"sha": "34dbb4ebb5105e6494641eb50bd0e42cc5085b3c"
},
{
"path": "web/js/minimax_prompt_mentions.js",
"mode": "100644",
"type": "blob",
"sha": "49c1a4fbdad704eaf0f773106f723831971c074f"
},
{
"path": "web/js/minimax_refine.js",
"mode": "100644",
"type": "blob",
"sha": "4690952699a7ad1c10fe7fedea9cb334b2b796b7"
},
{
"path": "web/js/minimax_timeline.js",
"mode": "100644",
"type": "blob",
"sha": "744661080d1a5f61f66aa56c244dbb3d53fb5683"
}
]
}
@@ -0,0 +1,190 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2026 ComfyUI-Bernini Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -0,0 +1,61 @@
"""ComfyUI MiniMax H3 Director — timeline plugin for MiniMax-H3 AV generation.
Based on ComfyUI official MiniMax H3 support (PR #15224 / #15228).
Licensed under the Apache License, Version 2.0. See LICENSE.
"""
from .nodes.conditioning import (
MiniMaxH3DirectorConditioning,
MiniMaxH3DirectorPlannerConditioning,
)
from .nodes.director import MiniMaxH3Director
from .nodes.director_refine import MiniMaxH3DirectorRefine
from .nodes.director_groups import (
MiniMaxH3DirectorGroupImageToVideo,
MiniMaxH3DirectorGroupReferenceToVideo,
MiniMaxH3DirectorGroupsCombine,
)
NODE_CLASS_MAPPINGS = {
"MiniMaxH3Director": MiniMaxH3Director,
"MiniMaxH3DirectorRefine": MiniMaxH3DirectorRefine,
# Legacy type id kept so older workflows still load.
"ComfyMiniMaxH3Director": MiniMaxH3Director,
"MiniMaxH3DirectorConditioning": MiniMaxH3DirectorConditioning,
"MiniMaxH3DirectorPlannerConditioning": MiniMaxH3DirectorPlannerConditioning,
"MiniMaxH3DirectorGroupImageToVideo": MiniMaxH3DirectorGroupImageToVideo,
"MiniMaxH3DirectorGroupReferenceToVideo": MiniMaxH3DirectorGroupReferenceToVideo,
# Must stay in NODE_CLASS_MAPPINGS: ComfyUI skips comfy_entrypoint when
# NODE_CLASS_MAPPINGS is present (if/elif in load_custom_node).
"MiniMaxH3DirectorGroupsCombine": MiniMaxH3DirectorGroupsCombine,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"MiniMaxH3Director": "MiniMaxH3Director",
"MiniMaxH3DirectorRefine": "MiniMax H3 Director Refine",
"ComfyMiniMaxH3Director": "MiniMaxH3Director",
"MiniMaxH3DirectorConditioning": "MiniMax H3 Director Conditioning",
"MiniMaxH3DirectorPlannerConditioning": "MiniMax H3 Director Planner Conditioning",
"MiniMaxH3DirectorGroupImageToVideo": "MiniMax H3 Director Group (Image to Video)",
"MiniMaxH3DirectorGroupReferenceToVideo": "MiniMax H3 Director Group (Reference to Video)",
"MiniMaxH3DirectorGroupsCombine": "MiniMax H3 Director Groups Combine",
}
WEB_DIRECTORY = "./web/js"
import logging
_log = logging.getLogger("ComfyUI-MiniMaxH3-Director")
try:
from .director.http_routes import register_routes as _register_director_routes
if not _register_director_routes():
_log.warning(
"MiniMax H3 Director HTTP routes deferred (PromptServer not ready). "
"Restart ComfyUI if /minimax/director/* returns 404."
)
except Exception as _director_routes_exc:
_log.warning("MiniMax H3 Director HTTP routes failed to load: %s", _director_routes_exc)
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
@@ -0,0 +1,414 @@
"""In-repo MiniMax H3 24-ch latent spatial upscaler (3D).
Inference-only port of the Apache-2.0 3D architecture from
LBH-123-AI/Comfyui_Minimax_h3_latent_Upscaler so Director Refine does not
depend on that custom node. Weights stay user-provided under
``ComfyUI/models/latent_upscale_models/``.
Only H×W are scaled; the time axis is preserved. Audio is not touched.
"""
from __future__ import annotations
import glob
import logging
import os
import re
import torch
import torch.nn as nn
import torch.nn.functional as F
log = logging.getLogger("ComfyUI-MiniMaxH3-Director.director.h3_latent_upscale")
LATENT_UPSCALE_FOLDER = "latent_upscale_models"
MISSING_MODEL_LABEL = "(将 3D 权重放入 models/latent_upscale_models)"
# Per-channel mean/std from LBH-123-AI H3 latent-upscaler training.
LATENTS_MEAN = [
0.858090341091156, -0.9606591463088989, 1.0661640167236328, -0.5090325474739075,
-0.2727581858634949, -1.3675414323806763, -0.2553254961967468, -0.26907554268836975,
-0.5376840829849243, -0.0464097298681736, 0.6657370328903198, 0.19690127670764923,
-0.5460608005523682, -0.4035342037677765, -0.23683024942874908, 0.25928452610969543,
-0.30133944749832153, 0.211341992020607, -1.1206848621368408, 0.3581933379173279,
-0.04225143790245056, 0.2604829967021942, 0.22864092886447906, 0.7056031823158264,
]
LATENTS_STD = [
1.2223774194717407, 1.2767263650894165, 1.6831774711608887, 1.7549455165863037,
1.5636216402053832, 2.194143533706665, 0.9653137922286987, 1.0569885969161987,
0.841948926448822, 0.7729952931404114, 1.8955937623977661, 0.946841835975647,
0.7996809482574463, 0.44988900423049927, 0.7197399735450743, 0.6936293244361877,
2.961095094680786, 2.7694199085235596, 3.0496184825897217, 2.1088054180145264,
3.276226282119751, 3.1627357006073, 2.2816812992095947, 2.6127843856811523,
]
_MODEL_CACHE: dict[str, nn.Module] = {}
def ensure_latent_upscale_folder() -> str | None:
try:
import folder_paths
if LATENT_UPSCALE_FOLDER not in folder_paths.folder_names_and_paths:
folder_paths.add_model_folder_path(
LATENT_UPSCALE_FOLDER,
os.path.join(folder_paths.models_dir, LATENT_UPSCALE_FOLDER),
)
paths = folder_paths.get_folder_paths(LATENT_UPSCALE_FOLDER)
return paths[0] if paths else None
except Exception:
return None
def list_h3_latent_upscale_models() -> list[str]:
root = ensure_latent_upscale_folder()
names: list[str] = []
if root:
try:
os.makedirs(root, exist_ok=True)
except OSError:
pass
for ext in ("*.safetensors", "*.pth"):
names.extend(os.path.basename(p) for p in glob.glob(os.path.join(root, ext)))
try:
import folder_paths
names.extend(folder_paths.get_filename_list(LATENT_UPSCALE_FOLDER) or [])
except Exception:
pass
out = sorted({n for n in names if n and not n.startswith("(")})
preferred = [n for n in out if "3d" in n.lower()]
return preferred or out or [MISSING_MODEL_LABEL]
def _norm_tensors(device, dtype):
mean = torch.tensor(LATENTS_MEAN, dtype=dtype, device=device).view(1, -1, 1, 1, 1)
std = torch.tensor(LATENTS_STD, dtype=dtype, device=device).view(1, -1, 1, 1, 1)
return mean, std
def _normalization(channels: int) -> nn.GroupNorm:
return nn.GroupNorm(32, channels)
def _zero_module(module: nn.Module) -> nn.Module:
for p in module.parameters():
p.detach().zero_()
return module
class ResBlockEmb3D(nn.Module):
def __init__(self, channels, emb_channels, dropout=0, out_channels=None):
super().__init__()
self.out_channels = out_channels or channels
self.in_layers = nn.Sequential(
_normalization(channels),
nn.SiLU(),
nn.Conv3d(channels, self.out_channels, 3, padding=1),
)
self.emb_layers = nn.Sequential(
nn.SiLU(),
nn.Linear(emb_channels, 2 * self.out_channels),
)
self.out_norm = _normalization(self.out_channels)
self.out_layers = nn.Sequential(
nn.SiLU(),
nn.Dropout(p=dropout),
_zero_module(nn.Conv3d(self.out_channels, self.out_channels, 3, padding=1)),
)
self.skip = (
nn.Conv3d(channels, self.out_channels, 1)
if self.out_channels != channels
else nn.Identity()
)
def forward(self, x, emb):
h = self.in_layers(x)
emb_out = self.emb_layers(emb).type(h.dtype)
while emb_out.ndim < h.ndim:
emb_out = emb_out[..., None]
scale, shift = torch.chunk(emb_out, 2, dim=1)
h = self.out_norm(h) * (1 + scale) + shift
h = self.out_layers(h)
return self.skip(x) + h
class TemporalConv(nn.Module):
def __init__(self, channels, kernel_size=5):
super().__init__()
padding = kernel_size // 2
self.norm = _normalization(channels)
self.dwconv = nn.Conv3d(
channels,
channels,
kernel_size=(kernel_size, 1, 1),
padding=(padding, 0, 0),
groups=channels,
)
self.pwconv = nn.Conv3d(channels, channels, kernel_size=1)
nn.init.zeros_(self.pwconv.weight)
nn.init.zeros_(self.pwconv.bias)
def forward(self, x):
h = self.norm(x)
h = F.silu(h)
h = self.dwconv(h)
h = self.pwconv(h)
return x + h
class LatentResizer3D(nn.Module):
def __init__(
self,
in_channels=24,
in_blocks=12,
out_blocks=12,
channels=512,
dropout=0.1,
temporal_every=2,
temporal_kernel=5,
):
super().__init__()
self.conv_in = nn.Conv3d(in_channels, channels, 3, padding=1)
embed_dim = 64
self.embed = nn.Sequential(
nn.Linear(1, embed_dim),
nn.SiLU(),
nn.Linear(embed_dim, embed_dim),
)
self.in_blocks = nn.ModuleList()
for b in range(in_blocks):
self.in_blocks.append(ResBlockEmb3D(channels, embed_dim, dropout))
if temporal_every > 0 and b % temporal_every == 0:
self.in_blocks.append(TemporalConv(channels, temporal_kernel))
self.out_blocks = nn.ModuleList()
for b in range(out_blocks):
self.out_blocks.append(ResBlockEmb3D(channels, embed_dim, dropout))
if temporal_every > 0 and b % temporal_every == 0:
self.out_blocks.append(TemporalConv(channels, temporal_kernel))
self.norm_out = _normalization(channels)
self.conv_out = nn.Conv3d(channels, in_channels, 3, padding=1)
def forward(self, x, scale: float, target_size: tuple[int, int, int]):
if tuple(target_size) == tuple(x.shape[-3:]):
return x
scale_emb = torch.tensor(
[float(scale) - 1.0], dtype=x.dtype, device=x.device
).unsqueeze(0)
emb = self.embed(scale_emb)
x = self.conv_in(x)
for block in self.in_blocks:
if isinstance(block, ResBlockEmb3D):
x = block(x, emb.expand(x.shape[0], -1))
else:
x = block(x)
x = F.interpolate(x, size=target_size, mode="trilinear", align_corners=False)
for block in self.out_blocks:
if isinstance(block, ResBlockEmb3D):
x = block(x, emb.expand(x.shape[0], -1))
else:
x = block(x)
x = self.norm_out(x)
x = F.silu(x)
return self.conv_out(x)
def _load_raw_sd(path: str) -> dict:
if path.endswith(".safetensors"):
from safetensors.torch import load_file
sd = load_file(path, device="cpu")
else:
sd = torch.load(path, map_location="cpu", weights_only=False)
if isinstance(sd, dict) and "model" in sd:
sd = sd["model"]
out = {}
for key, value in sd.items():
if getattr(value, "dtype", None) == torch.float8_e4m3fn:
value = value.to(torch.float16)
out[key] = value
return out
def _extract_upscaler_sd(sd: dict) -> dict:
if any(k.startswith("upscaler.") for k in sd):
return {k[len("upscaler.") :]: v for k, v in sd.items() if k.startswith("upscaler.")}
return sd
def _detect_arch(sd: dict) -> dict:
cfg = {
"in_channels": 24,
"in_blocks": 12,
"out_blocks": 12,
"channels": 512,
"dropout": 0.1,
"temporal_every": 2,
"temporal_kernel": 5,
}
if "conv_in.weight" in sd:
cfg["in_channels"] = int(sd["conv_in.weight"].shape[1])
cfg["channels"] = int(sd["conv_in.weight"].shape[0])
in_ids, out_ids = set(), set()
for key in sd:
m = re.match(r"in_blocks\.(\d+)\.in_layers\.", key)
if m:
in_ids.add(int(m.group(1)))
m = re.match(r"out_blocks\.(\d+)\.in_layers\.", key)
if m:
out_ids.add(int(m.group(1)))
if in_ids:
cfg["in_blocks"] = len(in_ids)
if out_ids:
cfg["out_blocks"] = len(out_ids)
has_temporal = any("dwconv.weight" in k for k in sd)
if has_temporal:
for key, value in sd.items():
if key.endswith("dwconv.weight"):
cfg["temporal_kernel"] = int(value.shape[2])
break
else:
cfg["temporal_every"] = 0
return cfg
def _resolve_model_path(name: str) -> str:
ensure_latent_upscale_folder()
import folder_paths
path = folder_paths.get_full_path(LATENT_UPSCALE_FOLDER, name)
if path:
return path
root = ensure_latent_upscale_folder()
if root:
candidate = os.path.join(root, name)
if os.path.isfile(candidate):
return candidate
raise FileNotFoundError(
f"H3 latent upscaler weights not found: {name}. "
f"Put the 3D safetensors in ComfyUI/models/{LATENT_UPSCALE_FOLDER}/"
)
def load_h3_latent_upscaler(name: str, device: torch.device, dtype: torch.dtype) -> nn.Module:
cache_key = f"{name}::{dtype}"
cached = _MODEL_CACHE.get(cache_key)
if cached is not None:
return cached.to(device=device, dtype=dtype)
path = _resolve_model_path(name)
raw = _load_raw_sd(path)
sd = _extract_upscaler_sd(raw)
if "resizer.conv_in.weight" in sd and "conv_in.weight" not in sd:
raise ValueError(
f"{name} looks like the 2D checkpoint. Director uses the 3D weights "
"(minimax_h3_latent_upscaler_3d_*.safetensors)."
)
cfg = _detect_arch(sd)
model = LatentResizer3D(**cfg)
model.load_state_dict(sd, strict=True)
model = model.to(device="cpu", dtype=dtype).eval()
_MODEL_CACHE[cache_key] = model
log.info(
"H3 latent upscaler loaded: %s (params=%s, C=%d)",
name,
f"{sum(p.numel() for p in model.parameters()):,}",
cfg["in_channels"],
)
return model.to(device=device, dtype=dtype)
def _as_bcthw(samples: torch.Tensor) -> tuple[torch.Tensor, str]:
"""Director video latents are [B,C,T,H,W] or [C,T,H,W] (same as video_from_latent)."""
if samples.ndim == 5:
return samples, "none"
if samples.ndim == 4:
return samples.unsqueeze(0), "batch"
raise ValueError(f"H3 latent upscale expected 4D/5D video latent, got {tuple(samples.shape)}")
def upscale_h3_video_latent(
video_latent: dict,
*,
target_width: int,
target_height: int,
source_width: int,
source_height: int,
model_name: str = "",
model=None,
) -> dict:
"""Spatially upscale MiniMax H3 video latent to a pixel canvas (×16 VAE)."""
if model is None and (not model_name or str(model_name).startswith("(")):
raise ValueError(
"未选择 H3 latent 放大模型。请在 Refine 的 latent_upscale_model 下拉框里选 3D 权重,"
f"并把 safetensors 放到 ComfyUI/models/{LATENT_UPSCALE_FOLDER}/"
)
samples = video_latent.get("samples") if isinstance(video_latent, dict) else video_latent
if not torch.is_tensor(samples):
raise ValueError("H3 latent upscale needs a video latent tensor.")
work, squeezed = _as_bcthw(samples)
lat_h, lat_w = int(work.shape[-2]), int(work.shape[-1])
src_h = max(1, int(source_height or 0))
src_w = max(1, int(source_width or 0))
ratio_h = src_h / float(lat_h)
ratio_w = src_w / float(lat_w)
dst_h = max(1, int(round(int(target_height) / ratio_h)))
dst_w = max(1, int(round(int(target_width) / ratio_w)))
t_size = int(work.shape[2])
if dst_h == lat_h and dst_w == lat_w:
return video_latent if isinstance(video_latent, dict) else {"samples": samples}
scale = max(
float(int(target_width)) / float(src_w),
float(int(target_height)) / float(src_h),
)
if scale < 0.999:
raise ValueError(
f"H3 latent upscale is enlarge-only (got {src_w}×{src_h} → "
f"{int(target_width)}×{int(target_height)})."
)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Official 3D node defaults to fp32; bf16 GroupNorm on this net can collapse
# to NaN/mud and decode as a brown static frame.
dtype = torch.float32
if model is not None:
net = model.model if hasattr(model, "model") and not hasattr(model, "conv_in") else model
model = net.to(device=device, dtype=dtype).eval()
else:
model = load_h3_latent_upscaler(model_name, device, dtype)
orig_dtype = work.dtype
mean, std = _norm_tensors(device, dtype)
x = work.to(device=device, dtype=dtype)
x = (x - mean) / std
try:
with torch.no_grad():
out = model(x, scale=scale, target_size=(t_size, dst_h, dst_w))
out = out * std + mean
out = out.to(device="cpu", dtype=orig_dtype).contiguous()
finally:
# Keep the 3D net off the GPU so MiniMaxH3 does not re-stage ~20GB.
model.to("cpu")
del x
if device.type == "cuda":
torch.cuda.empty_cache()
if squeezed == "batch" and out.shape[0] == 1:
out = out.squeeze(0)
packed = dict(video_latent) if isinstance(video_latent, dict) else {}
packed["samples"] = out
packed.pop("noise_mask", None)
log.info(
"H3 latent upscale: %s %d×%d latent %dx%d → %dx%d (pixel %d×%d → %d×%d, scale=%.2f)",
model_name,
src_w,
src_h,
lat_w,
lat_h,
dst_w,
dst_h,
src_w,
src_h,
int(target_width),
int(target_height),
scale,
)
return packed
@@ -0,0 +1,502 @@
"""External Refine pack for MiniMax H3 Director (graph-wired config).
Connect ``MiniMaxH3DirectorRefine.refine`` → ``MiniMaxH3Director.refine``.
Unconnected = current single-pass sampling.
"""
from __future__ import annotations
import math
from typing import Any
from ..lib.image_prep import MINIMAX_CANVAS_STRIDE, ensure_minimax_canvas
MMX_DIR_REFINE = "MMX_DIR_REFINE"
REFINE_MODES = ("refine", "upscale", "latent_upscale")
SEED_MODES = ("inherit", "offset")
UPSCALE_METHODS = ("lanczos", "nvidia_rtx_vsr", "h3_latent")
MAX_REFINE_PASSES = 9999
# 海螺参考生视频二采:ManualSigmas 4 个数 = euler 3 步。
HAILUO_REFINE_SIGMAS = (0.85, 0.7250, 0.4219, 0.0)
DEFAULT_REFINE_SIGMA_SAMPLER = "euler"
def parse_refine_sigmas(raw: Any, *, fallback: bool = False) -> tuple[float, ...]:
"""Parse ManualSigmas text or a BasicScheduler SIGMAS tensor."""
vals: list[float] = []
from_tensor = is_refine_sigmas_tensor(raw)
if from_tensor:
try:
vals = [float(x) for x in raw.detach().float().cpu().reshape(-1).tolist()]
except Exception:
vals = []
elif isinstance(raw, (list, tuple)):
for part in raw:
try:
vals.append(float(part))
except (TypeError, ValueError):
continue
else:
text = str(raw or "").replace(";", ",").replace("\n", ",")
for part in text.split(","):
token = str(part).strip()
if not token:
continue
try:
vals.append(float(token))
except (TypeError, ValueError):
continue
if len(vals) < 2:
if not fallback:
raise ValueError(
"Refine SIGMAS 至少需要 2 个数(步数 + 结尾 0)。"
"请检查 BasicScheduler 的 steps / denoise。"
)
return HAILUO_REFINE_SIGMAS
if abs(vals[-1]) > 1e-8:
vals.append(0.0)
return tuple(vals)
def is_refine_sigmas_tensor(raw: Any) -> bool:
return raw is not None and not isinstance(raw, (str, bytes, list, tuple)) and hasattr(raw, "reshape")
def refine_sigmas_override(pack: dict[str, Any] | None):
"""Wired BasicScheduler / ManualSigmas tensor. No text fallback."""
pack = pack or {}
tensor = pack.get("sigmas_tensor")
if tensor is None and is_refine_sigmas_tensor(pack.get("sigmas")):
tensor = pack.get("sigmas")
if tensor is None:
return None
return parse_refine_sigmas(tensor, fallback=False)
def resolve_latent_upscale_ref(raw: Any) -> tuple[Any, str]:
"""Return (loaded_module_or_None, filename)."""
if raw is None or raw is False:
return None, ""
if isinstance(raw, str):
name = raw.strip()
return None, "" if name.startswith("(") else name
if isinstance(raw, dict):
name = str(raw.get("name") or raw.get("model_name") or "").strip()
if name.startswith("("):
name = ""
return raw.get("model"), name
name = str(getattr(raw, "name", None) or getattr(raw, "_h3_name", None) or "").strip()
if hasattr(raw, "parameters") or hasattr(raw, "model"):
return raw, name or type(raw).__name__
return None, name
def refine_needs_canvas(pack: dict[str, Any] | None) -> bool:
mode = str((pack or {}).get("mode") or "").strip().lower()
return mode in {"upscale", "latent_upscale"}
def refine_uses_h3_latent(pack: dict[str, Any] | None) -> bool:
pack = pack or {}
mode = str(pack.get("mode") or "").strip().lower()
if mode == "latent_upscale":
return True
method = str(pack.get("upscale_method") or "").strip().lower()
return mode == "upscale" and method == "h3_latent"
def latent_upscale_model_name(pack: dict[str, Any] | None) -> str:
pack = pack or {}
_model, name = resolve_latent_upscale_ref(
pack.get("latent_upscale_ref")
if pack.get("latent_upscale_ref") is not None
else pack.get("latent_upscale_model")
)
if name:
return name
return str(pack.get("h3_latent_model") or "").strip()
FOLLOW_DIRECTOR_ASPECT = "跟随导演台"
CUSTOM_ASPECT_RATIO = "自定义"
DEFAULT_UPSCALE_MEGAPIXELS = 1.0
# Same labels/ratios as Director output bar / official ResolutionSelector.
RESOLUTION_ASPECTS = (
("1:1 (方形)", 1, 1),
("2:3 (竖版照片)", 2, 3),
("3:2 (横版照片)", 3, 2),
("3:4 (竖版标准)", 3, 4),
("4:3 (标准)", 4, 3),
("9:16 (竖屏)", 9, 16),
("16:9 (宽屏)", 16, 9),
("21:9 (超宽)", 21, 9),
)
ASPECT_RATIO_CHOICES = (
FOLLOW_DIRECTOR_ASPECT,
*[row[0] for row in RESOLUTION_ASPECTS],
CUSTOM_ASPECT_RATIO,
)
_ASPECT_ALIASES = {
"Follow Director": FOLLOW_DIRECTOR_ASPECT,
"follow": FOLLOW_DIRECTOR_ASPECT,
"Custom": CUSTOM_ASPECT_RATIO,
"自定义 (Custom)": CUSTOM_ASPECT_RATIO,
"1:1 (Square)": "1:1 (方形)",
"2:3 (Portrait Photo)": "2:3 (竖版照片)",
"3:2 (Photo)": "3:2 (横版照片)",
"3:4 (Portrait Standard)": "3:4 (竖版标准)",
"4:3 (Standard)": "4:3 (标准)",
"9:16 (Portrait Widescreen)": "9:16 (竖屏)",
"16:9 (Widescreen)": "16:9 (宽屏)",
"21:9 (Ultrawide)": "21:9 (超宽)",
}
def infer_upscale_target(base_w: int, base_h: int) -> tuple[int, int]:
"""Default 720p-class canvas from a 480p-class source (snap to H3 ×32)."""
w, h = int(base_w or 0), int(base_h or 0)
if w <= 0 or h <= 0:
return ensure_minimax_canvas(1280, 720)
if w >= h:
nh = 720
nw = max(32, round(w * nh / h))
return ensure_minimax_canvas(nw, nh)
nw = 720
nh = max(32, round(h * nw / w))
return ensure_minimax_canvas(nw, nh)
def normalize_aspect_ratio(aspect_ratio: str | None) -> str:
# Legacy workflows mapped old target_width=0 onto this combo.
if aspect_ratio in (None, "", 0, 0.0, "0", "0.0", False):
return FOLLOW_DIRECTOR_ASPECT
v = str(aspect_ratio).strip()
if not v or v in {"0", "0.0", "None", "null"}:
return FOLLOW_DIRECTOR_ASPECT
if v in _ASPECT_ALIASES:
return _ASPECT_ALIASES[v]
if v in ASPECT_RATIO_CHOICES:
return v
prefix = v.split(" ", 1)[0]
for label, _, _ in RESOLUTION_ASPECTS:
if label == prefix or label.startswith(f"{prefix} "):
return label
if v.startswith("自定义") or v.lower() == "custom":
return CUSTOM_ASPECT_RATIO
return FOLLOW_DIRECTOR_ASPECT
def is_follow_director_aspect(aspect_ratio: str | None) -> bool:
return normalize_aspect_ratio(aspect_ratio) == FOLLOW_DIRECTOR_ASPECT
def is_custom_aspect_ratio(aspect_ratio: str | None) -> bool:
return normalize_aspect_ratio(aspect_ratio) == CUSTOM_ASPECT_RATIO
def resolution_from_selector(
aspect_ratio: str,
megapixels: float,
multiple: int = MINIMAX_CANVAS_STRIDE,
) -> tuple[int, int] | None:
"""Director ResolutionSelector math: aspect + MP → W×H snapped to ×32."""
ar = normalize_aspect_ratio(aspect_ratio)
if ar in {FOLLOW_DIRECTOR_ASPECT, CUSTOM_ASPECT_RATIO}:
return None
row = next((r for r in RESOLUTION_ASPECTS if r[0] == ar), None)
if row is None:
return None
_, w_ratio, h_ratio = row
try:
mp = float(megapixels)
except (TypeError, ValueError):
mp = DEFAULT_UPSCALE_MEGAPIXELS
mp = min(16.0, max(0.1, mp))
mult = max(8, int(multiple or MINIMAX_CANVAS_STRIDE))
scale = math.sqrt((mp * 1024 * 1024) / (w_ratio * h_ratio))
width = int(round((w_ratio * scale) / mult) * mult)
height = int(round((h_ratio * scale) / mult) * mult)
return ensure_minimax_canvas(max(width, mult), max(height, mult))
def resolve_refine_target(
*,
aspect_ratio: str = FOLLOW_DIRECTOR_ASPECT,
megapixels: float = DEFAULT_UPSCALE_MEGAPIXELS,
width: int = 0,
height: int = 0,
target_width: int = 0,
target_height: int = 0,
) -> tuple[int, int]:
"""Return (0, 0) to follow Director canvas; otherwise an explicit ×32 canvas."""
ar = normalize_aspect_ratio(aspect_ratio)
legacy_w, legacy_h = int(target_width or 0), int(target_height or 0)
w, h = int(width or 0), int(height or 0)
if is_follow_director_aspect(ar):
if (legacy_w > 0 or legacy_h > 0) and w <= 0 and h <= 0:
return ensure_minimax_canvas(max(legacy_w, 32), max(legacy_h, 32))
return 0, 0
if is_custom_aspect_ratio(ar):
cw = w or legacy_w or 1280
ch = h or legacy_h or 720
return ensure_minimax_canvas(max(cw, 32), max(ch, 32))
resolved = resolution_from_selector(ar, megapixels)
if resolved is not None:
return resolved
return 0, 0
def pack_refine(
*,
mode: str = "refine",
passes: int = 1,
seed_mode: str = "inherit",
aspect_ratio: str = FOLLOW_DIRECTOR_ASPECT,
megapixels: float = DEFAULT_UPSCALE_MEGAPIXELS,
width: int = 0,
height: int = 0,
target_width: int = 0,
target_height: int = 0,
skip_fl2v: bool = True,
upscale_method: str = "h3_latent",
sample_model=None,
latent_upscale_model=None,
upscale_model=None,
sampler: str = "",
sigmas=None,
) -> dict[str, Any]:
mode = str(mode or "refine").strip().lower()
if mode not in REFINE_MODES:
mode = "refine"
seed_mode = str(seed_mode or "inherit").strip().lower()
if seed_mode not in SEED_MODES:
seed_mode = "inherit"
method = str(upscale_method or "h3_latent").strip().lower()
if method not in UPSCALE_METHODS:
method = "h3_latent"
sampler = str(sampler or DEFAULT_REFINE_SIGMA_SAMPLER).strip() or DEFAULT_REFINE_SIGMA_SAMPLER
sigma_tensor = sigmas if is_refine_sigmas_tensor(sigmas) else None
parsed = (
parse_refine_sigmas(sigma_tensor, fallback=False) if sigma_tensor is not None else ()
)
ar = normalize_aspect_ratio(aspect_ratio)
tw, th = resolve_refine_target(
aspect_ratio=ar,
megapixels=megapixels,
width=width,
height=height,
target_width=target_width,
target_height=target_height,
)
latent_mod, latent_name = resolve_latent_upscale_ref(latent_upscale_model)
return {
"enabled": True,
"mode": mode,
"passes": refine_passes_for({"passes": passes}),
"seed_mode": seed_mode,
"aspect_ratio": ar,
"megapixels": float(megapixels or DEFAULT_UPSCALE_MEGAPIXELS),
"target_width": tw,
"target_height": th,
"skip_fl2v": bool(skip_fl2v),
"upscale_method": method,
"upscale_model": upscale_model,
"has_upscale_model": upscale_model is not None,
"sample_model": sample_model,
"has_sample_model": sample_model is not None,
"latent_upscale_ref": latent_upscale_model,
"latent_upscale_module": latent_mod,
"latent_upscale_model": latent_name,
"h3_latent_model": latent_name,
"has_latent_upscale_model": latent_upscale_model is not None,
"sampler": sampler,
"sigmas": ",".join(f"{x:g}" for x in parsed),
"sigmas_parsed": parsed,
"sigmas_tensor": sigma_tensor,
"has_sigmas_tensor": sigma_tensor is not None,
}
def normalize_refine_pack(
raw,
*,
base_width: int = 0,
base_height: int = 0,
) -> dict[str, Any] | None:
"""Director execute: None if unconnected / invalid."""
if raw is None:
return None
if not isinstance(raw, dict):
return None
if raw.get("enabled") is False:
return None
mode = str(raw.get("mode") or "refine").strip().lower()
if mode not in REFINE_MODES:
mode = "refine"
ar = normalize_aspect_ratio(raw.get("aspect_ratio"))
tw, th = int(raw.get("target_width") or 0), int(raw.get("target_height") or 0)
if mode in {"upscale", "latent_upscale"} and (tw <= 0 or th <= 0):
if not is_follow_director_aspect(ar) and not is_custom_aspect_ratio(ar):
resolved = resolution_from_selector(ar, raw.get("megapixels") or DEFAULT_UPSCALE_MEGAPIXELS)
if resolved:
tw, th = resolved
if tw <= 0 or th <= 0:
tw, th = infer_upscale_target(base_width, base_height)
elif tw > 0 and th > 0:
tw, th = ensure_minimax_canvas(tw, th)
seed_mode = str(raw.get("seed_mode") or "inherit").strip().lower()
if seed_mode not in SEED_MODES:
seed_mode = "inherit"
method = str(raw.get("upscale_method") or "h3_latent").strip().lower()
if method not in UPSCALE_METHODS:
method = "h3_latent"
sampler = str(raw.get("sampler") or DEFAULT_REFINE_SIGMA_SAMPLER).strip() or DEFAULT_REFINE_SIGMA_SAMPLER
sigma_tensor = raw.get("sigmas_tensor")
raw_sigmas = raw.get("sigmas")
if sigma_tensor is None and is_refine_sigmas_tensor(raw_sigmas):
sigma_tensor = raw_sigmas
parsed = raw.get("sigmas_parsed") or ()
if sigma_tensor is not None:
parsed = parse_refine_sigmas(sigma_tensor, fallback=False)
elif parsed:
parsed = parse_refine_sigmas(parsed, fallback=False)
else:
parsed = ()
sample_model = raw.get("sample_model")
if sample_model is None:
sample_model = raw.get("model")
latent_raw = raw.get("latent_upscale_ref")
if latent_raw is None:
latent_raw = raw.get("latent_upscale_model")
latent_mod, latent_name = resolve_latent_upscale_ref(latent_raw)
if not latent_name:
latent_name = str(raw.get("h3_latent_model") or "").strip()
upscale = raw.get("upscale_model")
return {
"enabled": True,
"mode": mode,
"passes": refine_passes_for(raw),
"seed_mode": seed_mode,
"aspect_ratio": ar,
"megapixels": float(raw.get("megapixels") or DEFAULT_UPSCALE_MEGAPIXELS),
"target_width": tw,
"target_height": th,
"skip_fl2v": bool(raw.get("skip_fl2v", True)),
"upscale_method": method,
"upscale_model": upscale,
"has_upscale_model": upscale is not None,
"sample_model": sample_model,
"has_sample_model": sample_model is not None,
"latent_upscale_ref": latent_raw,
"latent_upscale_module": latent_mod,
"latent_upscale_model": latent_name,
"h3_latent_model": latent_name,
"has_latent_upscale_model": latent_raw is not None,
"sampler": sampler,
"sigmas": ",".join(f"{x:g}" for x in parsed),
"sigmas_parsed": parsed,
"sigmas_tensor": sigma_tensor,
"has_sigmas_tensor": sigma_tensor is not None,
}
def refine_will_sample(plan, seg) -> bool:
"""True when this segment will run a second sample / upscale pass."""
pack = getattr(plan, "refine", None)
if not isinstance(pack, dict) or not pack.get("enabled"):
return False
if pack.get("skip_fl2v", True) and getattr(seg, "task_key", "") == "fl2v":
return False
return True
def refine_passes_for(pack: dict[str, Any] | None) -> int:
try:
n = int((pack or {}).get("passes") or 1)
except (TypeError, ValueError):
n = 1
return max(1, min(MAX_REFINE_PASSES, n))
def refine_model_for(pack: dict[str, Any] | None, fallback):
"""Second-pass UNET. Unconnected Refine.refine_model → Director main model."""
custom = (pack or {}).get("sample_model")
if custom is None:
custom = (pack or {}).get("model")
return fallback if custom is None else custom
def refine_seed_for(pack: dict[str, Any], seed: int, pass_index: int = 0) -> int:
if pack.get("seed_mode") == "offset":
return int(seed) + 1 + int(max(0, pass_index))
return int(seed)
def refine_fingerprint(plan) -> dict[str, Any]:
pack = getattr(plan, "refine", None)
if not isinstance(pack, dict) or not pack.get("enabled"):
return {"refine": False}
return {
"refine": True,
"refine_mode": pack.get("mode") or "refine",
"refine_passes": refine_passes_for(pack),
"refine_seed_mode": pack.get("seed_mode") or "inherit",
"refine_target": f"{int(pack.get('target_width') or 0)}x{int(pack.get('target_height') or 0)}",
"refine_aspect": pack.get("aspect_ratio") or FOLLOW_DIRECTOR_ASPECT,
"refine_megapixels": round(float(pack.get("megapixels") or 0), 3),
"refine_upscale_method": pack.get("upscale_method") or "h3_latent",
"refine_upscale_model": bool(pack.get("has_upscale_model") or pack.get("upscale_model") is not None),
"refine_latent_upscale_model": latent_upscale_model_name(pack),
"refine_sampler": pack.get("sampler") or "",
"refine_sigmas": ",".join(f"{x:.4f}" for x in (pack.get("sigmas_parsed") or ()))
if pack.get("has_sigmas_tensor") or pack.get("sigmas_tensor") is not None
else (pack.get("sigmas") or ""),
"refine_sigmas_wired": bool(pack.get("has_sigmas_tensor") or pack.get("sigmas_tensor") is not None),
"refine_sample_model": bool(pack.get("has_sample_model") or pack.get("sample_model") is not None),
"refine_skip_fl2v": bool(pack.get("skip_fl2v", True)),
}
def refine_report_line(plan) -> str | None:
pack = getattr(plan, "refine", None)
if not isinstance(pack, dict) or not pack.get("enabled"):
return None
mode = pack.get("mode") or "refine"
extra = ""
if refine_needs_canvas(pack):
ar = pack.get("aspect_ratio") or FOLLOW_DIRECTOR_ASPECT
if refine_uses_h3_latent(pack):
how = latent_upscale_model_name(pack) or "h3_latent"
else:
method = pack.get("upscale_method") or "h3_latent"
if method == "nvidia_rtx_vsr":
how = "nvidia_rtx_vsr"
elif pack.get("has_upscale_model") or pack.get("upscale_model") is not None:
how = "upscale_model"
else:
how = "lanczos"
extra = (
f", {ar} → {int(pack.get('target_width') or 0)}×{int(pack.get('target_height') or 0)}"
f", {how}"
)
n_passes = refine_passes_for(pack)
pass_note = f", passes={n_passes}" if n_passes > 1 else ""
model_note = (
", 二采模型" if (pack.get("has_sample_model") or pack.get("sample_model") is not None) else ""
)
wired = bool(pack.get("has_sigmas_tensor") or pack.get("sigmas_tensor") is not None)
parsed = pack.get("sigmas_parsed") or ()
sampler = pack.get("sampler") or DEFAULT_REFINE_SIGMA_SAMPLER
n_steps = max(1, len(parsed) - 1) if parsed else 0
if mode == "latent_upscale":
return f"Refine: ON ({mode}{model_note}{extra})"
how = f"sigmas {sampler}" if wired else "sigmas 未接线"
step_note = f" {n_steps}-step" if n_steps else ""
return (
f"Refine: ON ({mode}, {how}{step_note}"
f"{pass_note}{model_note}{extra})"
)
@@ -0,0 +1,148 @@
"""Image and video preprocessing for Bernini semantic context streams."""
from __future__ import annotations
import torch
from comfy.utils import common_upscale
# MiniMax H3: VAE spatial ÷16, then 2×2 patchify → canvas must be multiples of 32.
MINIMAX_CANVAS_STRIDE = 32
def snap_dimension(value: int, stride: int = MINIMAX_CANVAS_STRIDE) -> int:
"""Round *value* to the nearest multiple of *stride*, keeping at least *stride*."""
return max(stride, round(value / stride) * stride)
def ensure_minimax_canvas(width: int, height: int) -> tuple[int, int]:
"""Snap width/height to MiniMax H3 canvas multiples (32)."""
return snap_dimension(int(width)), snap_dimension(int(height))
def assert_minimax_canvas(width: int, height: int) -> None:
"""Raise a clear error when W/H cannot be patchified by MiniMax H3."""
w, h = int(width), int(height)
if w > 0 and h > 0 and w % MINIMAX_CANVAS_STRIDE == 0 and h % MINIMAX_CANVAS_STRIDE == 0:
return
nw, nh = ensure_minimax_canvas(max(w, 1), max(h, 1))
raise ValueError(
f"输出分辨率 {w}×{h} 不是 32 的倍数(MiniMax H3 要求:VAE÷16 后再 2×2 patch)。"
f"请改为 {nw}×{nh},或在输出面板重新选择最长边/固定尺寸后重跑。"
"若同时安装了独立的 ComfyUI-H3-Motion-Context,请卸载或禁用后重启 ComfyUI(与 Director 内置连贯冲突)。"
)
def fit_long_edge(image: torch.Tensor, max_edge: int, stride: int = 32) -> torch.Tensor:
"""Long-edge fit with MiniMax H3 canvas snap (default stride 32).
H3 VAE is 16× spatially, then patchified 2×2 → effective 32×. Odd latent
widths (e.g. 496px → 31) crash ``patchify_video`` during sampling.
"""
rgb = image[:, :, :, :3]
height, width = rgb.shape[1], rgb.shape[2]
scale = min(max_edge / max(height, width), 1.0)
new_h = max(stride, round(height * scale / stride) * stride)
new_w = max(stride, round(width * scale / stride) * stride)
return common_upscale(
rgb.movedim(-1, 1), new_w, new_h, "area", "disabled"
).movedim(1, -1)
def fit_canvas(
frames: torch.Tensor,
width: int,
height: int,
upscale_mode: str = "area",
) -> torch.Tensor:
"""Resize video frames to a fixed canvas (width x height)."""
rgb = frames[..., :3]
return common_upscale(
rgb.movedim(-1, 1), width, height, upscale_mode, "center"
).movedim(1, -1)
def fit_video_long_edge(frames: torch.Tensor, max_edge: int, stride: int = 32) -> torch.Tensor:
"""Scale each frame so its long side is at most *max_edge*, preserving aspect ratio."""
if frames.shape[0] == 0:
return frames
chunks = [fit_long_edge(frames[i : i + 1], max_edge, stride=stride) for i in range(frames.shape[0])]
return torch.cat(chunks, dim=0)
def pad_frames_to_canvas(
frames: torch.Tensor,
width: int,
height: int,
*,
fill: float = 0.5,
) -> torch.Tensor:
"""Center-pad a frame sequence onto a fixed canvas (letterbox)."""
if frames.ndim != 4:
raise ValueError("frames must be [F, H, W, C]")
f, h, w, c = frames.shape
if h == height and w == width:
return frames
out = torch.full((f, height, width, c), fill, dtype=frames.dtype, device=frames.device)
y0 = max(0, (height - h) // 2)
x0 = max(0, (width - w) // 2)
copy_h = min(h, height - y0)
copy_w = min(w, width - x0)
out[:, y0 : y0 + copy_h, x0 : x0 + copy_w, :] = frames[:, :copy_h, :copy_w, :]
return out
def cat_frames_variable_size(clips: list[torch.Tensor], *, fill: float = 0.5) -> torch.Tensor:
"""Concatenate frame clips along time, padding spatial dims when aspect ratios differ."""
if not clips:
raise ValueError("No clips to concatenate.")
if len(clips) == 1:
return clips[0]
shapes = {(int(c.shape[1]), int(c.shape[2])) for c in clips}
if len(shapes) == 1:
return torch.cat(clips, dim=0)
max_h = max(c.shape[1] for c in clips)
max_w = max(c.shape[2] for c in clips)
padded = [pad_frames_to_canvas(c, max_w, max_h, fill=fill) for c in clips]
return torch.cat(padded, dim=0)
def resolve_output_dimensions(
source_w: int,
source_h: int,
*,
mode: str = "long_edge",
long_edge: int = 848,
fixed_width: int = 832,
fixed_height: int = 480,
stride: int = 32,
) -> tuple[int, int, int, str]:
"""Return (width, height, ref_max_size, mode) for MiniMax H3 Director output.
``stride`` defaults to 32 (H3 patch grid). Using 16 can yield e.g. 496×864
which encodes to an odd latent width and crashes ``patchify_video``.
"""
mode = (mode or "long_edge").lower()
if mode == "fixed":
w = snap_dimension(int(fixed_width), stride)
h = snap_dimension(int(fixed_height), stride)
return w, h, max(w, h), "fixed"
long_edge = max(stride, int(long_edge))
if source_w <= 0 or source_h <= 0:
w = snap_dimension(int(fixed_width), stride)
h = snap_dimension(int(fixed_height), stride)
return w, h, long_edge, "long_edge"
if max(source_w, source_h) <= long_edge:
return snap_dimension(source_w, stride), snap_dimension(source_h, stride), long_edge, "long_edge"
scale = long_edge / max(source_w, source_h)
w = snap_dimension(int(round(source_w * scale)), stride)
h = snap_dimension(int(round(source_h * scale)), stride)
return w, h, long_edge, "long_edge"
def normalize_to_vae_range(frames: torch.Tensor) -> torch.Tensor:
"""Map [0, 1] images to [-1, 1] for Wan-style VAE encoding."""
return frames * 2.0 - 1.0
@@ -0,0 +1,456 @@
"""Shared helpers for the MiniMax H3 Director timeline node."""
from __future__ import annotations
import json
import logging
import torch
from ..director.audio_export import (
AUDIO_MODE_GENERATE,
build_director_audio_outputs,
resolve_audio_mode,
source_audio_report_note,
)
from ..director.frame_align import pad_or_trim_frames
from ..director.gen_timeline import is_prompt_batch_timeline, is_video_batch_task_key
from ..director.plan import build_director_plan, count_all_timeline_segments, count_timeline_segments, plan_summary
from ..director.progress import report_director_planning
from ..lib.image_prep import fit_canvas, fit_video_long_edge
from ..lib.video_io import load_timeline_segment
from ..lib.task_prompts import task_type_combo_options
log = logging.getLogger("ComfyUI-MiniMaxH3-Director")
def timeline_required_inputs() -> dict:
"""Timeline + prompt widgets shared by Director nodes."""
combo_options, combo_meta = task_type_combo_options()
return {
"task_type": (combo_options, combo_meta),
"global_prompt": (
"STRING",
{
"default": "",
"multiline": True,
"tooltip": "Synced from in-node UI (global mode).",
},
),
"bd_grp_sample": ("BDGROUP", {"default": "采样设置"}),
"cfg": (
"FLOAT",
{"default": 1.0, "min": 0.0, "max": 30.0, "step": 0.01, "tooltip": "CFG for KSampler."},
),
"seed": (
"INT",
{
"default": 0,
"min": 0,
"max": 0xFFFFFFFFFFFFFFFF,
"control_after_generate": True,
"tooltip": "Random seed for sampling.",
},
),
"frame_rate": (
"FLOAT",
{"default": 24.0, "min": 1.0, "max": 240.0, "step": 0.01, "tooltip": "Timeline / output FPS (H3 trained at 24)."},
),
"width": ("INT", {"default": 864, "min": 32, "max": 8192, "step": 32}),
"height": ("INT", {"default": 480, "min": 32, "max": 8192, "step": 32}),
"ref_max_size": ("INT", {"default": 864, "min": 32, "max": 8192, "step": 32}),
"total_frames": (
"INT",
{
"default": 124,
"min": 5,
"max": 100000,
"tooltip": "Timeline total frames (fl2v = sum of shots). Per-shot generation still capped near 512.",
},
),
"timeline_data": (
"STRING",
{"default": "", "multiline": True, "tooltip": "Internal — video, segments, refs (populated by UI)."},
),
}
def director_perf_inputs() -> dict:
"""Performance widgets shared by Director nodes."""
return {
"bd_grp_perf": ("BDGROUP", {"default": "性能"}),
"clear_vram_between_segments": (
"BOOLEAN",
{
"default": True,
"tooltip": "段间清理显存:每段结束后卸载模型并清空 CUDA 缓存。",
},
),
"export_source_images": (
"BOOLEAN",
{
"default": False,
"tooltip": "输出 source_images(时间轴原片帧对比)。默认关以节省内存。",
},
),
}
def default_timeline_json(
*,
task_type: str,
global_prompt: str,
total_frames: int,
frame_rate: float,
width: int,
height: int,
ref_max_size: int,
) -> str:
return json.dumps(
{
"version": 4,
"editMode": "global",
"totalFrames": total_frames,
"frameRate": frame_rate,
"width": width,
"height": height,
"refMaxSize": ref_max_size,
"output": {
"mode": "fixed",
"longEdge": ref_max_size,
"width": width,
"height": height,
"maxExportFrames": 0,
"exportMode": "all",
"audioMode": "generate",
},
"videoClips": [],
"video": {
"fileName": "",
"videoFile": "",
"subfolder": "",
"type": "input",
"frames": [],
"frameMap": [],
},
"global": {"taskType": task_type, "prompt": global_prompt, "refs": [], "referenceVideo": {}, "continuousReference": False},
"segments": [
{
"id": "s0",
"start": 0,
"length": total_frames,
"prompt": "",
"taskType": "",
"refs": [],
"referenceVideo": {},
}
],
},
ensure_ascii=False,
)
def prepare_director_plan(
*,
timeline_data: str,
task_type: str,
global_prompt: str,
total_frames: int,
frame_rate: float,
width: int,
height: int,
ref_max_size: int,
unique_id: str | None,
i2v_groups=None,
r2v_groups=None,
refine=None,
):
from ..director.external_groups import (
build_plan_from_external_groups,
validate_external_group_inputs,
)
if not timeline_data or not timeline_data.strip():
timeline_data = default_timeline_json(
task_type=task_type,
global_prompt=global_prompt,
total_frames=total_frames,
frame_rate=frame_rate,
width=width,
height=height,
ref_max_size=ref_max_size,
)
task_key, ext_groups, family = validate_external_group_inputs(
task_type=task_type,
i2v_groups=i2v_groups,
r2v_groups=r2v_groups,
)
if ext_groups is not None and family is not None:
report_director_planning(
unique_id,
len(ext_groups),
timeline_segment_total=len(ext_groups),
)
plan = build_plan_from_external_groups(
ext_groups,
family=family,
timeline_data=timeline_data,
task_type=task_type,
global_prompt=global_prompt,
total_frames=total_frames,
frame_rate=frame_rate,
width=width,
height=height,
ref_max_size=ref_max_size,
)
plan = _attach_refine(plan, refine)
log.info(
"MiniMax H3 Director: external %s groups × %d (task=%s) | %s",
family,
len(ext_groups),
task_key,
plan_summary(plan).replace("\n", " | "),
)
return plan
report_director_planning(
unique_id,
count_timeline_segments(timeline_data),
timeline_segment_total=count_all_timeline_segments(timeline_data),
)
plan = build_director_plan(
timeline_data,
global_task_type=task_type,
global_prompt=global_prompt,
total_frames=total_frames,
frame_rate=frame_rate,
width=width,
height=height,
ref_max_size=ref_max_size,
)
plan = _attach_refine(plan, refine)
log.info(plan_summary(plan).replace("\n", " | "))
return plan
def _attach_refine(plan, refine):
from ..director.refine_pack import normalize_refine_pack
plan.refine = normalize_refine_pack(
refine,
base_width=int(getattr(plan, "width", 0) or 0),
base_height=int(getattr(plan, "height", 0) or 0),
)
return plan
def _fit_source_clip_to_plan(plan, raw_clip: torch.Tensor) -> torch.Tensor:
if plan.output_mode == "fixed":
return fit_canvas(raw_clip, plan.width, plan.height)
return fit_video_long_edge(raw_clip, plan.ref_max_size)
def build_source_images_output(
plan,
images_out: list[torch.Tensor],
*,
split_outputs: bool,
) -> list[torch.Tensor]:
if split_outputs:
chunks: list[torch.Tensor] = []
# images_out is run-order (选择运行), not full timeline order.
segs = plan.segments
run_idx = getattr(plan, "run_indices", None)
if run_idx is not None:
segs = [
plan.segments[i]
for i in sorted(run_idx)
if 0 <= i < len(plan.segments)
]
for seg, generated in zip(segs, images_out):
target_len = int(generated.shape[0])
raw = load_timeline_segment(plan.raw, seg.start_frame, seg.end_frame)
fitted = _fit_source_clip_to_plan(plan, raw)
chunks.append(pad_or_trim_frames(fitted, target_len).cpu().float())
return chunks
target_len = int(images_out[0].shape[0]) if images_out else int(plan.total_frames or 0)
raw = load_timeline_segment(plan.raw, 0, target_len)
fitted = _fit_source_clip_to_plan(plan, raw)
return [pad_or_trim_frames(fitted, target_len).cpu().float()]
def _empty_source_images_for(images_out: list[torch.Tensor]) -> list[torch.Tensor]:
if not images_out:
return [torch.full((1, 1, 1, 3), 0.5)]
placeholders: list[torch.Tensor] = []
for img in images_out:
if isinstance(img, torch.Tensor) and img.ndim == 4:
h, w, c = int(img.shape[1]), int(img.shape[2]), int(img.shape[3])
else:
h, w, c = 1, 1, 3
placeholders.append(torch.full((1, h, w, c), 0.5))
return placeholders
def _ensure_nonempty_image_batches(images_out: list[torch.Tensor], *, label: str) -> list[torch.Tensor]:
fixed: list[torch.Tensor] = []
for i, img in enumerate(images_out):
if not isinstance(img, torch.Tensor) or img.ndim != 4:
raise ValueError(f"Director {label}[{i}] is not a valid IMAGE tensor.")
if int(img.shape[0]) <= 0:
h, w, c = int(img.shape[1]), int(img.shape[2]), int(img.shape[3])
log.warning("Director %s[%d] has 0 frames; emitting 1-frame placeholder.", label, i)
fixed.append(torch.full((1, max(1, h), max(1, w), max(1, c)), 0.5))
else:
fixed.append(img)
return fixed
def _layout_image_batches(
plan,
combined,
segment_outputs,
*,
export_segments: bool,
is_batch: bool,
video_batch: bool,
) -> tuple[list[torch.Tensor], int]:
if export_segments or (is_batch and not video_batch):
images_out = segment_outputs
frame_count = sum(int(s.shape[0]) for s in segment_outputs)
return images_out, frame_count
combined = pad_or_trim_frames(combined, plan.total_frames).cpu().float()
return [combined], int(combined.shape[0])
def finalize_director_outputs(
plan,
combined,
segment_outputs,
report,
*,
export_source_images: bool = False,
segment_audios: list | None = None,
segment_frame_counts: list[int] | None = None,
pre_refine_combined=None,
pre_refine_segments: list | None = None,
):
is_batch = is_prompt_batch_timeline(plan.raw, plan.global_task_key)
export_segments = plan.export_mode == "segments"
video_batch = is_video_batch_task_key(plan.global_task_key)
split_layout = export_segments or (is_batch and not video_batch)
images_out, frame_count = _layout_image_batches(
plan,
combined,
segment_outputs,
export_segments=export_segments,
is_batch=is_batch,
video_batch=video_batch,
)
if export_segments and len(segment_outputs) > 1:
report = (
report
+ f"\n\nExport mode: segments — {len(segment_outputs)} clip(s) on images output."
)
if plan.run_indices is not None and split_layout:
report = (
report
+ f"\n\nPartial run: output contains {len(segment_outputs)} re-generated clip(s) only."
)
if not split_layout:
if video_batch and is_batch and len(segment_outputs) > 1:
report = report + f"\n\nExport mode: all — merged {frame_count} frame(s) on images output."
if plan.run_indices is not None and video_batch:
report = report + f"\n\nPartial run: re-generated {len(segment_outputs)} video group(s)."
pre_segs = pre_refine_segments if pre_refine_segments else segment_outputs
pre_comb = pre_refine_combined if pre_refine_combined is not None else combined
share_pre = pre_comb is combined and (
pre_segs is segment_outputs
or (
len(pre_segs) == len(segment_outputs)
and all(a is b for a, b in zip(pre_segs, segment_outputs))
)
)
if share_pre:
pre_refine_out = images_out
else:
try:
pre_refine_out, _ = _layout_image_batches(
plan,
pre_comb,
pre_segs,
export_segments=export_segments,
is_batch=is_batch,
video_batch=video_batch,
)
except Exception as exc:
log.warning("images_pre_refine layout failed: %s", exc)
pre_refine_out = images_out
report = report + f"\n\nimages_pre_refine: fallback to images ({exc})."
split_for_audio = split_layout
audio_frame_end = frame_count if not split_for_audio else None
audio_mode = resolve_audio_mode(plan)
use_generated = audio_mode == AUDIO_MODE_GENERATE
# Prefer caller-provided export lengths (post continuity trim); else match IMAGE batches.
if segment_frame_counts is None and segment_audios and split_for_audio:
segment_frame_counts = [int(s.shape[0]) for s in segment_outputs]
audio_out, source_fallback = build_director_audio_outputs(
plan,
images_out,
export_segments=split_for_audio,
output_frame_end=audio_frame_end,
segment_audios=segment_audios if use_generated else None,
segment_frame_counts=segment_frame_counts if use_generated else None,
audio_mode=audio_mode,
)
report = report + source_audio_report_note(
plan,
audio_out,
export_segments=split_for_audio,
output_frame_end=audio_frame_end,
used_generated_audio=bool(use_generated and segment_audios),
audio_mode=audio_mode,
source_fallback=source_fallback,
)
split_source_outputs = export_segments or (is_batch and not video_batch)
if export_source_images:
try:
source_images_out = build_source_images_output(
plan,
images_out,
split_outputs=split_source_outputs,
)
except Exception as exc:
log.warning("Source images output failed: %s", exc)
source_images_out = images_out
report = report + f"\n\nSource images: fallback to generated output ({exc})."
else:
source_images_out = _empty_source_images_for(images_out)
images_out = _ensure_nonempty_image_batches(images_out, label="images")
source_images_out = _ensure_nonempty_image_batches(source_images_out, label="source_images")
pre_refine_out = _ensure_nonempty_image_batches(pre_refine_out, label="images_pre_refine")
refine_pack = getattr(plan, "refine", None)
if isinstance(refine_pack, dict) and refine_pack.get("enabled"):
report = report + (
"\n\nimages_pre_refine: first-pass video (before second sample / upscale). "
"Cached or passthrough slots reuse the stored final frames."
)
else:
report = report + (
"\n\nimages_pre_refine: same as images (Refine node not connected)."
)
report = report + "\n\n有问题联系作者:AI搅拌手 QQ交流群:551482703"
fps_out = float(plan.frame_rate or 24.0)
return images_out, audio_out, fps_out, frame_count, source_images_out, report, pre_refine_out
@@ -0,0 +1,287 @@
"""Graph packer: Refine / upscale config for MiniMax H3 Director.refine."""
from __future__ import annotations
import comfy.samplers
from ..director.h3_latent_upscale import list_h3_latent_upscale_models
from ..director.refine_pack import (
ASPECT_RATIO_CHOICES,
DEFAULT_REFINE_SIGMA_SAMPLER,
DEFAULT_UPSCALE_MEGAPIXELS,
FOLLOW_DIRECTOR_ASPECT,
MAX_REFINE_PASSES,
MMX_DIR_REFINE,
REFINE_MODES,
SEED_MODES,
UPSCALE_METHODS,
infer_upscale_target,
pack_refine,
)
_CATEGORY = "MiniMaxH3"
class MiniMaxH3DirectorRefine:
"""Pack refine/upscale settings. Connect ``refine`` to Director.refine.
``refine``: same-resolution second sample.
``upscale``: enlarge to target canvas then second-sample.
``latent_upscale``: H3 latent enlarge only, no second sample.
Second sample uses SIGMAS from BasicScheduler / ManualSigmas.
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"mode": (
list(REFINE_MODES),
{
"default": "refine",
"tooltip": (
"refine = 同分辨率二采(精修)。"
"upscale = 先放大到目标画布再二采。"
"latent_upscale = 只放大 H3 latent,不再二采。"
),
},
),
"upscale_method": (
list(UPSCALE_METHODS),
{
"default": "h3_latent",
"tooltip": (
"仅 mode=upscale。"
"h3_latent = 先按目标画布放大 H3 视频 latent,再二采"
"(下方选 3D 权重)。"
"lanczos = 像素插值;可另接 upscale_model(RealESRGAN 等)。"
"nvidia_rtx_vsr = NVIDIA RTX Video Super Resolution"
"(需 nvidia-vfx + NVIDIA GPU)。"
),
},
),
"latent_upscale_model": (
list_h3_latent_upscale_models(),
{
"tooltip": (
"H3 3D latent 放大权重。"
"放到 ComfyUI/models/latent_upscale_models/,"
"文件名含 3d(如 minimax_h3_latent_upscaler_3d_*.safetensors)。"
"mode=latent_upscale,或 upscale + h3_latent 时使用。"
),
},
),
"sampler": (
comfy.samplers.KSampler.SAMPLERS,
{
"default": DEFAULT_REFINE_SIGMA_SAMPLER,
"tooltip": (
"二采采样器。海螺案例用 euler;"
"BasicScheduler 高质量二采常用 res_multistep。"
),
},
),
"passes": (
"INT",
{
"default": 1,
"min": 1,
"max": MAX_REFINE_PASSES,
"tooltip": (
"精修次数。1 = 一次二采。"
"upscale 时只有第 1 次放大,之后都是同分辨率精修。"
"latent_upscale 不二采,此值无效。"
),
},
),
},
"optional": {
"refine_model": (
"MODEL",
{
"tooltip": (
"Second-pass UNET (二采模型)。"
"不接则用导演台主模型。"
"适合一采挂 Turbo LoRA、二采卸掉或换另一套。"
),
},
),
"sigmas": (
"SIGMAS",
{
"forceInput": True,
"tooltip": (
"二采噪声表。接 Comfy 自带 BasicScheduler 或 ManualSigmas。"
"mode=refine / upscale 时必须接线。"
"BasicScheduler 请接和二采相同的 MODEL(导演台主模型或 refine_model)。"
"H3 的 SigmaShift 仍由 Refine 内部套上。"
),
},
),
"upscale_model": (
"UPSCALE_MODEL",
{
"tooltip": (
"可选。用「加载放大模型」接入,例如 RealESRGAN_x2plus。"
"仅 mode=upscale 且 upscale_method=lanczos 时使用。"
"不接则纯 lanczos 插值。选 nvidia_rtx_vsr / h3_latent 时忽略此口。"
),
},
),
"seed_mode": (
list(SEED_MODES),
{
"default": "inherit",
"tooltip": "inherit = 用导演台 seed;offset = 每轮 seed+1、+2…。",
},
),
"aspect_ratio": (
list(ASPECT_RATIO_CHOICES),
{
"default": FOLLOW_DIRECTOR_ASPECT,
"tooltip": (
"放大目标画布,算法同导演台「输出分辨率」。"
"导演台是一采分辨率(例如 0.4 MP),这里是放大后的目标"
"(例如 1.0 MP)。跟随导演台:按导演台画布比例推 720P 档。"
"比例预设:配合百万像素。"
"自定义:直接填宽高(对齐 ×32)。"
),
},
),
"megapixels": (
"FLOAT",
{
"default": DEFAULT_UPSCALE_MEGAPIXELS,
"min": 0.0,
"max": 16.0,
"step": 0.1,
"tooltip": (
"百万像素,同导演台 ResolutionSelector。"
"1.0 MP 在 16:9 约为 1376×768(对齐 32)。仅比例预设时生效。"
),
},
),
"width": (
"INT",
{
"default": 1280,
"min": 0,
"max": 8192,
"step": 32,
"tooltip": "自定义宽度(×32)。仅「自定义」时生效。",
},
),
"height": (
"INT",
{
"default": 720,
"min": 0,
"max": 8192,
"step": 32,
"tooltip": "自定义高度(×32)。仅「自定义」时生效。",
},
),
"skip_fl2v": (
"BOOLEAN",
{
"default": True,
"tooltip": (
"跳过首尾帧(fl2v)镜头的二采/放大。"
"二采会改画面,容易把钉死的首尾帧画飘;默认跳过以保护关键帧。"
"关掉则 fl2v 也走精修 / latent 放大。"
),
},
),
},
}
@classmethod
def VALIDATE_INPUTS(cls, input_types=None, **_kwargs):
# Skip combo/min checks so old workflows (target_width=0 → aspect_ratio) can load.
return True
RETURN_TYPES = (MMX_DIR_REFINE, "INT", "INT")
RETURN_NAMES = ("refine", "width", "height")
FUNCTION = "pack"
CATEGORY = _CATEGORY
DESCRIPTION = (
"MiniMax H3 Director Refine: connect to Director.refine. "
"Director.images is the refined / upscaled result; "
"Director.images_pre_refine is the first-pass video (before second sample). "
"Second sample uses SIGMAS from BasicScheduler / ManualSigmas. "
"Upscale / latent_upscale canvas uses the same aspect + megapixels / custom W×H as Director. "
"Director first-pass stays at its own resolution; Refine target is the enlarge size. "
"width / height are the resolved target canvas (×32). "
"Does not sample by itself — no IMAGE output."
)
def pack(
self,
mode="refine",
upscale_method="h3_latent",
sampler="",
passes=1,
seed_mode="inherit",
aspect_ratio=FOLLOW_DIRECTOR_ASPECT,
megapixels=DEFAULT_UPSCALE_MEGAPIXELS,
width=1280,
height=720,
skip_fl2v=True,
latent_upscale_model=None,
upscale_model=None,
h3_latent_model="",
sigmas=None,
refine_model=None,
model=None,
target_width=0,
target_height=0,
**kwargs,
):
del kwargs
try:
mp = float(megapixels)
except (TypeError, ValueError):
mp = DEFAULT_UPSCALE_MEGAPIXELS
if mp < 0.1:
mp = DEFAULT_UPSCALE_MEGAPIXELS
try:
w = int(width or 0)
except (TypeError, ValueError):
w = 1280
try:
h = int(height or 0)
except (TypeError, ValueError):
h = 720
if w < 32:
w = 1280
if h < 32:
h = 720
try:
n_passes = int(passes or 1)
except (TypeError, ValueError):
n_passes = 1
if n_passes < 1:
n_passes = 1
pack = pack_refine(
mode=mode,
passes=n_passes,
seed_mode=seed_mode,
aspect_ratio=aspect_ratio,
megapixels=mp,
width=w,
height=h,
target_width=target_width,
target_height=target_height,
skip_fl2v=skip_fl2v,
upscale_method=upscale_method,
sample_model=refine_model if refine_model is not None else model,
latent_upscale_model=latent_upscale_model if latent_upscale_model is not None else h3_latent_model,
upscale_model=upscale_model,
sampler=sampler,
sigmas=sigmas,
)
out_w = int(pack.get("target_width") or 0)
out_h = int(pack.get("target_height") or 0)
if out_w <= 0 or out_h <= 0:
out_w, out_h = infer_upscale_target(0, 0)
return (pack, int(out_w), int(out_h))
@@ -0,0 +1,14 @@
[project]
name = "ComfyUI_MiniMaxH3_Director"
description = "Multi-segment MiniMax H3 Director — official MiniMaxH3ImageToVideo / ReferenceToVideo pipeline."
version = "1.0.0"
license = {file = "LICENSE"}
requires-python = ">=3.10"
[project.urls]
Repository = "https://github.com/AIMixer/ComfyUI_MiniMaxH3_Director"
[tool.comfy]
PublisherId = ""
DisplayName = "ComfyUI MiniMax H3 Director"
Icon = ""
@@ -0,0 +1,12 @@
# Source-video decode for v2v / timeline loading
opencv-python-headless>=4.8
# Source-audio extract + incremental segment mp4 encode (「分段导出」边生成边保存)
imageio-ffmpeg>=0.4
# Smart shot split (智能分割)
scenedetect>=0.6.4,<0.8
# Optional: Refine upscale_method=nvidia_rtx_vsr (NVIDIA RTX GPU only).
# Do not add as a hard dep — AMD / cloud / no-VSR installs would break.
# pip install nvidia-vfx --extra-index-url https://pypi.nvidia.com
@@ -0,0 +1,408 @@
/** Shared helpers for MiniMax H3 Director generation tasks. */
import { t } from "./minimax_i18n.js";
/** MiniMax H3 canvas snap (official nodes use 32). */
export const MINIMAX_CANVAS_MULTIPLE = 32;
/** ResolutionSelector aspect presets (UI labels in Chinese; ratios match official node). */
export const RESOLUTION_ASPECTS = [
["1:1 (方形)", 1, 1],
["2:3 (竖版照片)", 2, 3],
["3:2 (横版照片)", 3, 2],
["3:4 (竖版标准)", 3, 4],
["4:3 (标准)", 4, 3],
["9:16 (竖屏)", 9, 16],
["16:9 (宽屏)", 16, 9],
["21:9 (超宽)", 21, 9],
];
export const DEFAULT_ASPECT_RATIO = "16:9 (宽屏)";
/** Manual width × height (not in official ResolutionSelector). */
export const CUSTOM_ASPECT_RATIO = "自定义";
/** Official MiniMax template default: 0.4 MP → 864×480 at 16:9 (multiple=32) */
export const DEFAULT_MEGAPIXELS = 0.4;
export const MIN_MEGAPIXELS = 0.1;
export const MAX_MEGAPIXELS = 16;
/** Clamp a finished megapixel value into the allowed range. */
export function clampMegapixels(value, fallback = DEFAULT_MEGAPIXELS) {
const n = Number(value);
if (!Number.isFinite(n) || n <= 0) return fallback;
return Math.min(MAX_MEGAPIXELS, Math.max(MIN_MEGAPIXELS, n));
}
/**
* Parse megapixels from a number input while the user may still be typing.
* Returns null for incomplete drafts ("" / "0" / "0." / ".") so UI must not coerce to default.
*/
export function parseMegapixelsInput(raw) {
const s = String(raw ?? "").trim();
if (!s || s === "." || s === "-" || s === "-.") return null;
// Trailing decimal = still typing ("0.", "1.")
if (/^-?\d+\.$/.test(s)) return null;
// Bare 0 is the start of "0.x"
if (/^-?0$/.test(s)) return null;
const n = Number(s);
if (!Number.isFinite(n) || n <= 0) return null;
// Below minimum while typing fractions like "0.05" — wait until blur/change to clamp.
if (n < MIN_MEGAPIXELS) return null;
return Math.min(MAX_MEGAPIXELS, n);
}
/** Map legacy English labels → current Chinese labels. */
const ASPECT_RATIO_ALIASES = {
"1:1 (Square)": "1:1 (方形)",
"2:3 (Portrait Photo)": "2:3 (竖版照片)",
"3:2 (Photo)": "3:2 (横版照片)",
"3:4 (Portrait Standard)": "3:4 (竖版标准)",
"4:3 (Standard)": "4:3 (标准)",
"9:16 (Portrait Widescreen)": "9:16 (竖屏)",
"16:9 (Widescreen)": "16:9 (宽屏)",
"21:9 (Ultrawide)": "21:9 (超宽)",
"自定义 (Custom)": CUSTOM_ASPECT_RATIO,
Custom: CUSTOM_ASPECT_RATIO,
};
export function normalizeAspectRatioLabel(aspectRatio) {
const v = String(aspectRatio || "").trim();
if (!v) return DEFAULT_ASPECT_RATIO;
if (ASPECT_RATIO_ALIASES[v]) return ASPECT_RATIO_ALIASES[v];
if (RESOLUTION_ASPECTS.some(([label]) => label === v)) return v;
if (isCustomAspectRatio(v)) return CUSTOM_ASPECT_RATIO;
// Fallback: match by ratio prefix e.g. "16:9"
const prefix = v.split(" ")[0];
const byPrefix = RESOLUTION_ASPECTS.find(([label]) => label.startsWith(`${prefix} `) || label === prefix);
return byPrefix ? byPrefix[0] : DEFAULT_ASPECT_RATIO;
}
export function isCustomAspectRatio(aspectRatio) {
const v = String(aspectRatio || "").trim();
return v === CUSTOM_ASPECT_RATIO || v === "Custom" || v === "自定义 (Custom)" || v.startsWith("自定义");
}
/**
* Official MiniMax frame formula from workflow templates:
* max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17
* where a = duration seconds (UI stores 1 decimal place, matching official workflows).
*
* Note for t2v/i2v UI: group "秒数" is the user intent; the toolbar tag Xs (Yf) and
* output preview seconds use aligned frames (Yf / fps). Play length can differ slightly
* from the typed seconds (e.g. 7 → 175f ≈ 7.3s) — that is snap, not an 8s hard cap.
*/
export function durationToMiniMaxFrames(seconds, fps = 24) {
const a = Math.max(0.1, Number(seconds) || 0.1);
const n = Math.max(5, Math.round(a * fps));
const rem = ((5 - (n % 17)) % 17 + 17) % 17;
return n + rem;
}
/** MiniMax H3 frame grid: snap up to 17k+5 (min 5). */
export function alignMiniMaxFrameCount(n) {
n = Math.max(5, parseInt(n, 10) || 5);
while (n % 17 !== 5) n += 1;
return n;
}
/** Round user-facing duration to 1 decimal place (official workflow step). */
export function roundDurationSec(seconds) {
const n = Number(seconds);
if (!Number.isFinite(n)) return 0.1;
return Math.round(n * 10) / 10;
}
/** Raw inverse: frames → seconds (may look ugly, e.g. 124 → 5.17). Prefer preferredDurationSecFromFrames for UI. */
export function framesToDurationSec(frames, fps = 24) {
const f = Math.max(5, parseInt(frames, 10) || 5);
return Math.round((f / fps) * 100) / 100;
}
/**
* Migrate/display helper: pick a user-friendly seconds value that snaps to the same
* MiniMax frame count via durationToMiniMaxFrames (prefer whole seconds, then 1 decimal).
* Example: 124 frames → 5 (not 5.17).
*/
export function preferredDurationSecFromFrames(frames, fps = 24) {
const f = Math.max(5, parseInt(frames, 10) || 5);
const rough = f / Math.max(fps, 0.001);
const intLo = Math.max(1, Math.floor(rough) - 1);
const intHi = Math.ceil(rough) + 1;
for (let s = intLo; s <= intHi; s++) {
if (durationToMiniMaxFrames(s, fps) === f) return s;
}
const dLo = Math.max(1, Math.floor(rough * 10) - 2);
const dHi = Math.ceil(rough * 10) + 2;
for (let t = dLo; t <= dHi; t++) {
const s = t / 10;
if (durationToMiniMaxFrames(s, fps) === f) return roundDurationSec(s);
}
return roundDurationSec(rough);
}
/** Snap width/height to MiniMax canvas multiple (default 32). */
export function snapResolutionDim(v, multiple = MINIMAX_CANVAS_MULTIPLE) {
const mult = Math.max(8, parseInt(multiple, 10) || MINIMAX_CANVAS_MULTIPLE);
const n = Math.max(mult, Math.round(Number(v) || mult));
return Math.round(n / mult) * mult;
}
/** ResolutionSelector math: aspect_ratio + megapixels + multiple → width/height. */
export function resolutionFromSelector(aspectRatio, megapixels, multiple = MINIMAX_CANVAS_MULTIPLE) {
if (isCustomAspectRatio(aspectRatio)) {
return null;
}
const label = normalizeAspectRatioLabel(aspectRatio);
const row = RESOLUTION_ASPECTS.find(([l]) => l === label) || RESOLUTION_ASPECTS.find(([l]) => l === DEFAULT_ASPECT_RATIO);
const [, wRatio, hRatio] = row;
const mp = clampMegapixels(megapixels);
const mult = Math.max(8, parseInt(multiple, 10) || MINIMAX_CANVAS_MULTIPLE);
const totalPixels = mp * 1024 * 1024;
const scale = Math.sqrt(totalPixels / (wRatio * hRatio));
const width = Math.round((wRatio * scale) / mult) * mult;
const height = Math.round((hRatio * scale) / mult) * mult;
return { width, height, megapixels: mp, aspectRatio: row[0], multiple: mult };
}
export const IMAGE_BATCH_TASKS = new Set();
export const FL2V_TASKS = new Set(["fl2v"]);
/** Blank-canvas / subject-ref batch generation (not source-video editing). */
export const VIDEO_BATCH_TASKS = new Set(["t2v", "i2v", "r2v"]);
export const PROMPT_BATCH_TASKS = new Set([...VIDEO_BATCH_TASKS, ...FL2V_TASKS]);
/** Tasks that never use source-video upload toolbar. v2v/rv2v use Bernini-style video timeline. */
export const NO_VIDEO_UPLOAD_TASKS = new Set(["t2v", "i2v", "r2v"]);
export function resolveTaskKey(taskTypeValue) {
let value = String(taskTypeValue || "").split(",[object Object]", 1)[0].trim();
if (value.includes(" · ")) value = value.split(" · ", 1)[0].trim();
for (const sep of [" — ", " —— ", " - ", " – "]) {
if (value.includes(sep)) return value.split(sep, 1)[0].trim();
}
return value || "t2v";
}
export function isGenTaskType(taskTypeValue) {
const key = resolveTaskKey(taskTypeValue);
return PROMPT_BATCH_TASKS.has(key);
}
export function isVideoBatchTask(taskKey) {
return VIDEO_BATCH_TASKS.has(taskKey);
}
export function isImageBatchTask(taskKey) {
return IMAGE_BATCH_TASKS.has(taskKey);
}
export function isPromptBatchTask(taskKey) {
return PROMPT_BATCH_TASKS.has(taskKey);
}
export function getDirectorMode(taskTypeValue) {
const key = resolveTaskKey(taskTypeValue);
if (FL2V_TASKS.has(key)) return "fl2v";
if (PROMPT_BATCH_TASKS.has(key)) return "prompt_batch";
// v2v / rv2v (and any non-batch key) → source-video timeline, same as Bernini.
return "video";
}
/** t2i/t2v=plain, i2i/i2v=source image, r2i/r2v=up to 9 reference images */
export function imageBatchVariant(taskKey) {
if (taskKey === "i2i" || taskKey === "i2v") return "source";
if (taskKey === "r2i" || taskKey === "r2v") return "refs";
return "plain";
}
/** t2i/r2i/t2v/r2v need fixed canvas; i2i/i2v may use long_edge. */
export function imageBatchRequiresFixedOutput(taskKey) {
return taskKey === "t2i" || taskKey === "r2i" || taskKey === "t2v" || taskKey === "r2v";
}
/** Maximum frames per diffusion segment (model / VRAM practical limit). */
export const MAX_GEN_FRAMES = 512;
/** MiniMax H3 ReferenceToVideo supports up to 9 reference images. */
export const MAX_REFERENCE_IMAGES = 9;
/** User-facing slot label: index 0 → Picture/图片 1. */
export function refImageLabel(index) {
return t("slot.picture", { n: Number(index) + 1 });
}
/** Prompt token for MiniMax: index 0 → <Picture 1>. */
export function refImagePromptTag(index) {
return `<Picture ${Number(index) + 1}>`;
}
/** Official MiniMaxH3ReferenceToVideo supports up to 3 standalone reference audios. */
export const MAX_REFERENCE_AUDIOS = 3;
/** User-facing slot label: index 0 → Audio/音频 1. */
export function refAudioLabel(index) {
return t("slot.audio", { n: Number(index) + 1 });
}
/** Prompt token for MiniMax: index 0 → <Audio 1>. */
export function refAudioPromptTag(index) {
return `<Audio ${Number(index) + 1}>`;
}
/** Official MiniMaxH3ReferenceToVideo supports up to 3 reference videos. */
export const MAX_REFERENCE_VIDEOS = 3;
/** User-facing slot label: index 0 → Video/视频 1. */
export function refVideoLabel(index) {
return t("slot.video", { n: Number(index) + 1 });
}
/** Prompt token for MiniMax: index 0 → <Video 1>. */
export function refVideoPromptTag(index) {
return `<Video ${Number(index) + 1}>`;
}
/** Tasks that never show reference-image slots (v2v = source-video edit only). */
const NO_REF_IMAGE_TASKS = new Set(["v2v", "mv2v", "ads2v", "t2v", "i2v", "fl2v"]);
export function taskUsesReferenceImages(taskKey) {
if (NO_REF_IMAGE_TASKS.has(taskKey)) return false;
// r2v batch + legacy Bernini-style ref edit keys.
return taskKey === "r2v" || taskKey === "r2i" || taskKey === "rv2v" || taskKey === "vrc2v" || taskKey === "vi2v";
}
export function taskUsesReferenceVideo(taskKey) {
// Separate ref-video slot (ads2v). v2v uses the main source timeline instead.
return taskKey === "ads2v";
}
/** Standalone <Audio j> slots — official r2v / Director rv2v. */
export function taskUsesReferenceAudios(taskKey) {
return taskKey === "rv2v" || taskKey === "r2v";
}
/** Default duration seconds for video batch / fl2v (→ 124 frames @ 24fps). */
export function defaultDurationSec(taskKey) {
if (isImageBatchTask(taskKey)) return 0;
if (isVideoBatchTask(taskKey) || FL2V_TASKS.has(taskKey)) return 5;
return 5;
}
export function defaultFrameCount(taskKey) {
if (isImageBatchTask(taskKey)) return 1;
return durationToMiniMaxFrames(defaultDurationSec(taskKey), 24);
}
export function minFrameCount(taskKey) {
if (isImageBatchTask(taskKey)) return 1;
if (isVideoBatchTask(taskKey) || FL2V_TASKS.has(taskKey)) return 5;
return 5;
}
export function minDurationSec() {
return roundDurationSec(framesToDurationSec(5, 24)) || 0.2;
}
/** Max 1-decimal seconds whose aligned frame count still fits in MAX_GEN_FRAMES. */
export function maxDurationSec() {
let sec = roundDurationSec(framesToDurationSec(MAX_GEN_FRAMES, 24));
while (sec > 0.1 && durationToMiniMaxFrames(sec, 24) > MAX_GEN_FRAMES) {
sec = roundDurationSec(sec - 0.1);
}
return sec;
}
/**
* Frame count for a duration, capped to MAX_GEN_FRAMES on the 17k+5 grid.
* Returns the 1-decimal seconds that produced that count (may step down near the cap).
*/
export function durationToClampedMiniMaxFrames(seconds, fps = 24) {
let sec = roundDurationSec(seconds);
let fc = durationToMiniMaxFrames(sec, fps);
while (sec > 0.1 && fc > MAX_GEN_FRAMES) {
sec = roundDurationSec(sec - 0.1);
fc = durationToMiniMaxFrames(sec, fps);
}
if (fc > MAX_GEN_FRAMES) {
fc = alignMiniMaxFrameCount(MAX_GEN_FRAMES);
while (fc > MAX_GEN_FRAMES) fc -= 17;
sec = preferredDurationSecFromFrames(fc, fps);
}
return { frames: fc, durationSec: sec };
}
export function sumFrameCounts(segments) {
return (segments || []).reduce(
(s, seg) => s + Math.max(0, parseInt(seg.frameCount ?? seg.length, 10) || 0),
0,
);
}
export function genLayoutHint(taskKey) {
return "";
}
/** Master「段间引导」truthy check (timeline.output). */
export function isContinuityMasterEnabled(output) {
if (!output) return false;
const raw = output.continuityEnabled ?? output.continuity_enabled;
if (raw === true || raw === 1) return true;
if (typeof raw === "string") {
const s = raw.trim().toLowerCase();
return s === "true" || s === "1" || s === "yes" || s === "on";
}
return false;
}
/**
* Per-segment「引用上段」. Default true when unset (master ON ⇒ pin unless opted out).
* Index 0 never pins.
*/
export function isSegmentContinuityFromPrev(segOrShot, index) {
if (!(Number(index) > 0)) return false;
if (!segOrShot || typeof segOrShot !== "object") return true;
const raw = segOrShot.continuityFromPrev ?? segOrShot.continuity_from_prev;
if (raw === undefined || raw === null) return true;
if (raw === true || raw === 1) return true;
if (typeof raw === "string") {
const s = raw.trim().toLowerCase();
return s === "true" || s === "1" || s === "yes" || s === "on";
}
return false;
}
export function newBatchSegment(overrides = {}) {
const taskKey = resolveTaskKey(overrides.taskType || overrides.task_type || "");
const isVideo = isVideoBatchTask(taskKey);
// durationSec is the user-facing source of truth; frameCount is derived by formula.
let durationSec = defaultDurationSec(taskKey);
if (overrides.durationSec != null && Number.isFinite(Number(overrides.durationSec))) {
durationSec = Number(overrides.durationSec);
} else if (overrides.frameCount != null || overrides.length != null) {
durationSec = preferredDurationSecFromFrames(overrides.frameCount ?? overrides.length, 24);
}
let fc = 1;
if (isVideo) {
const resolved = durationToClampedMiniMaxFrames(durationSec, 24);
durationSec = resolved.durationSec;
fc = resolved.frames;
}
return {
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 7),
start: 0,
length: fc,
frameCount: fc,
durationSec: isVideo ? durationSec : undefined,
prompt: "",
negativePrompt: "",
taskType: "",
refs: [],
refAudios: [],
refVideos: [],
genImage: { imageFile: "" },
previewB64: "",
previewFrames: [],
previewFps: 24,
...overrides,
length: fc,
frameCount: fc,
...(isVideo ? { durationSec } : {}),
};
}
@@ -0,0 +1,363 @@
/** MiniMax H3 Director Refine — show canvas widgets like Director output bar. */
import { app } from "../../scripts/app.js";
import {
CUSTOM_ASPECT_RATIO,
resolutionFromSelector,
snapResolutionDim,
} from "./minimax_gen_timeline.js";
const REFINE_CLASS = "MiniMaxH3DirectorRefine";
const FOLLOW_DIRECTOR_ASPECT = "跟随导演台";
function isRefineNode(node) {
const cls = node?.comfyClass || node?.type || "";
return cls === REFINE_CLASS;
}
function widgetByName(node, name) {
return node.widgets?.find((w) => w.name === name);
}
function widgetValue(w) {
if (!w) return undefined;
const v = w.value;
if (v && typeof v === "object") {
if (typeof v.content === "string") return v.content;
if (typeof v.value === "string") return v.value;
}
return v;
}
function setWidgetVisible(node, name, visible) {
const w = widgetByName(node, name);
if (!w) return;
w.hidden = !visible;
if (!w.options) w.options = {};
w.options.hidden = !visible;
if (visible) {
if (w._mmxOrigComputeSize) {
w.computeSize = w._mmxOrigComputeSize;
delete w._mmxOrigComputeSize;
} else if (w.computeSize) {
delete w.computeSize;
}
if (w.element) w.element.style.display = "";
} else {
if (!w._mmxOrigComputeSize && typeof w.computeSize === "function") {
w._mmxOrigComputeSize = w.computeSize.bind(w);
}
w.computeSize = () => [0, -4];
if (w.element) w.element.style.display = "none";
}
}
function isCustomAspect(value) {
const v = String(value ?? "").trim();
return v === CUSTOM_ASPECT_RATIO || v === "Custom" || v.startsWith("自定义");
}
const ASPECT_CHOICES = new Set([
FOLLOW_DIRECTOR_ASPECT,
"Follow Director",
CUSTOM_ASPECT_RATIO,
"Custom",
"1:1 (方形)",
"2:3 (竖版照片)",
"3:2 (横版照片)",
"3:4 (竖版标准)",
"4:3 (标准)",
"9:16 (竖屏)",
"16:9 (宽屏)",
"21:9 (超宽)",
]);
const UPSCALE_METHOD_VALUES = new Set(["lanczos", "nvidia_rtx_vsr", "h3_latent"]);
const SAMPLER_HINTS = new Set([
"euler", "euler_ancestral", "heun", "heunpp2", "dpm_2", "dpm_2_ancestral",
"lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_sde",
"dpmpp_sde_gpu", "dpmpp_2m", "dpmpp_2m_sde", "dpmpp_2m_sde_gpu",
"dpmpp_3m_sde", "dpmpp_3m_sde_gpu", "ddpm", "lcm", "ipndm", "ipndm_v",
"deis", "res_multistep", "res_multistep_ancestral", "gradient_estimation",
"er_sde", "seeds_2", "seeds_3", "sa_solver", "sa_solver_pece",
"uni_pc", "uni_pc_bh2", "ddim",
]);
function looksLikeUpscaleMethod(value) {
return UPSCALE_METHOD_VALUES.has(String(value ?? "").trim().toLowerCase());
}
function looksLikeSampler(value) {
return SAMPLER_HINTS.has(String(value ?? "").trim().toLowerCase());
}
function clampPasses(value) {
const n = Math.round(Number(value));
if (!Number.isFinite(n) || n < 1) return 1;
return Math.min(9999, n);
}
function migrateRefineWidgetOrder(node) {
const samplerW = widgetByName(node, "sampler");
const passesW = widgetByName(node, "passes");
const methodW = widgetByName(node, "upscale_method");
if (samplerW && !looksLikeSampler(widgetValue(samplerW))) {
samplerW.value = "euler";
}
if (passesW) {
passesW.value = clampPasses(widgetValue(passesW));
}
if (methodW && !looksLikeUpscaleMethod(widgetValue(methodW))) {
methodW.value = "h3_latent";
}
}
function orderRefineWidgets(node) {
const widgets = node.widgets;
if (!Array.isArray(widgets)) return;
const names = [
"mode",
"upscale_method",
"latent_upscale_model",
"h3_latent_model",
"sampler",
"passes",
"seed_mode",
"aspect_ratio",
"megapixels",
"width",
"height",
"skip_fl2v",
];
const byName = new Map(widgets.map((w) => [w.name, w]));
const ordered = [];
const used = new Set();
for (const name of names) {
const w = byName.get(name);
if (!w) continue;
ordered.push(w);
used.add(w);
}
for (const w of widgets) {
if (!used.has(w)) ordered.push(w);
}
widgets.length = 0;
widgets.push(...ordered);
}
function migrateRefineWidgets(node) {
migrateRefineWidgetOrder(node);
orderRefineWidgets(node);
const aspectW = widgetByName(node, "aspect_ratio");
const mpW = widgetByName(node, "megapixels");
const widthW = widgetByName(node, "width");
const heightW = widgetByName(node, "height");
if (aspectW && !ASPECT_CHOICES.has(widgetValue(aspectW))) {
aspectW.value = FOLLOW_DIRECTOR_ASPECT;
}
if (mpW) {
const n = Number(widgetValue(mpW));
if (!Number.isFinite(n) || n < 0.1) mpW.value = 1.0;
}
if (widthW) {
const n = Number(widgetValue(widthW));
if (!Number.isFinite(n) || n < 32) widthW.value = 1280;
}
if (heightW) {
const n = Number(widgetValue(heightW));
if (!Number.isFinite(n) || n < 32) heightW.value = 720;
}
setWidgetVisible(node, "schedule", false);
setWidgetVisible(node, "denoise", false);
setWidgetVisible(node, "steps", false);
setWidgetVisible(node, "sigmas_text", false);
setWidgetVisible(node, "sigmas", false);
setWidgetVisible(node, "h3_latent_model", false);
setWidgetVisible(node, "upscale_model", false);
}
function isFollowAspect(value) {
const v = String(value ?? "").trim();
if (v === "0" || v === "0.0") return true;
return !v || v === FOLLOW_DIRECTOR_ASPECT || v === "Follow Director";
}
function readMode(node) {
const named = widgetByName(node, "mode");
const raw = String(widgetValue(named) ?? "").toLowerCase();
if (raw.includes("latent_upscale") || raw.includes("latent")) return "latent_upscale";
if (raw.includes("upscale")) return "upscale";
if (raw.includes("refine")) return "refine";
for (const w of node.widgets || []) {
const s = String(widgetValue(w) ?? "").toLowerCase();
if (s === "latent_upscale") return "latent_upscale";
if (s === "upscale") return "upscale";
if (s === "refine") return "refine";
}
return null;
}
function syncRefineComputedSize(node) {
const aspectW = widgetByName(node, "aspect_ratio");
const mpW = widgetByName(node, "megapixels");
const widthW = widgetByName(node, "width");
const heightW = widgetByName(node, "height");
if (!aspectW || isFollowAspect(widgetValue(aspectW)) || isCustomAspect(widgetValue(aspectW))) return;
const resolved = resolutionFromSelector(widgetValue(aspectW), widgetValue(mpW) ?? 1.0);
if (!resolved) return;
if (widthW) widthW.value = resolved.width;
if (heightW) heightW.value = resolved.height;
}
function readUpscaleMethod(node) {
return String(widgetValue(widgetByName(node, "upscale_method")) ?? "").trim().toLowerCase();
}
function syncRefineWidgetVisibility(node) {
const mode = readMode(node);
const upscale = mode === "upscale";
const latentOnly = mode === "latent_upscale";
const needsCanvas = upscale || latentOnly;
const aspect = widgetValue(widgetByName(node, "aspect_ratio"));
const follow = isFollowAspect(aspect);
const custom = isCustomAspect(aspect);
setWidgetVisible(node, "aspect_ratio", needsCanvas);
setWidgetVisible(node, "megapixels", needsCanvas && !follow && !custom);
setWidgetVisible(node, "width", needsCanvas && custom);
setWidgetVisible(node, "height", needsCanvas && custom);
const method = readUpscaleMethod(node);
const showH3Model = latentOnly || (upscale && method === "h3_latent");
setWidgetVisible(node, "upscale_method", upscale);
setWidgetVisible(node, "latent_upscale_model", showH3Model);
setWidgetVisible(node, "h3_latent_model", false);
setWidgetVisible(node, "upscale_model", false);
setWidgetVisible(node, "schedule", false);
setWidgetVisible(node, "denoise", false);
setWidgetVisible(node, "steps", false);
setWidgetVisible(node, "sigmas_text", false);
setWidgetVisible(node, "sigmas", false);
setWidgetVisible(node, "sampler", !latentOnly);
setWidgetVisible(node, "passes", !latentOnly);
setWidgetVisible(node, "seed_mode", !latentOnly);
setWidgetVisible(node, "target_width", false);
setWidgetVisible(node, "target_height", false);
orderRefineWidgets(node);
if (needsCanvas && !follow && !custom) syncRefineComputedSize(node);
try {
const size = node.computeSize?.();
if (Array.isArray(size) && size.length >= 2) {
node.setSize?.([node.size?.[0] || size[0], size[1]]);
}
} catch {
/* ignore */
}
node.setDirtyCanvas?.(true, true);
}
function hookWidget(node, name, fn) {
if (!node._mmxRefineHooked) node._mmxRefineHooked = new Set();
if (node._mmxRefineHooked.has(name)) return;
const w = widgetByName(node, name);
if (!w) return;
node._mmxRefineHooked.add(name);
const prev = w.callback;
w.callback = function (...args) {
const r = prev?.apply(this, args);
fn();
return r;
};
}
function installRefineResolutionUI(node) {
const onAspect = () => {
const aspectW = widgetByName(node, "aspect_ratio");
const widthW = widgetByName(node, "width");
const heightW = widgetByName(node, "height");
if (aspectW && isCustomAspect(widgetValue(aspectW)) && widthW && heightW) {
widthW.value = snapResolutionDim(widgetValue(widthW) || 1280);
heightW.value = snapResolutionDim(widgetValue(heightW) || 720);
}
syncRefineWidgetVisibility(node);
};
hookWidget(node, "mode", () => syncRefineWidgetVisibility(node));
hookWidget(node, "upscale_method", () => syncRefineWidgetVisibility(node));
hookWidget(node, "aspect_ratio", onAspect);
hookWidget(node, "megapixels", () => syncRefineComputedSize(node));
hookWidget(node, "width", () => {
const w = widgetByName(node, "width");
if (w) w.value = snapResolutionDim(widgetValue(w));
});
hookWidget(node, "height", () => {
const w = widgetByName(node, "height");
if (w) w.value = snapResolutionDim(widgetValue(w));
});
if (!node._mmxRefineOnWidgetChanged) {
node._mmxRefineOnWidgetChanged = true;
const prev = node.onWidgetChanged;
node.onWidgetChanged = function (name, ...rest) {
const r = prev?.apply(this, [name, ...rest]);
if (name === "mode" || name === "upscale_method" || name === "aspect_ratio" || name === "megapixels") {
migrateRefineWidgets(this);
syncRefineWidgetVisibility(this);
}
return r;
};
}
}
function refreshRefineNode(node) {
if (!isRefineNode(node)) return;
installRefineResolutionUI(node);
migrateRefineWidgets(node);
syncRefineWidgetVisibility(node);
}
function refreshAllRefineNodes() {
const graph = app.graph ?? app.canvas?.graph;
for (const node of graph?._nodes ?? graph?.nodes ?? []) {
refreshRefineNode(node);
}
}
function scheduleRefineRefresh(node) {
refreshRefineNode(node);
queueMicrotask(() => refreshRefineNode(node));
setTimeout(() => refreshRefineNode(node), 0);
setTimeout(() => refreshRefineNode(node), 80);
setTimeout(() => refreshRefineNode(node), 250);
}
app.registerExtension({
name: "ComfyUI.MiniMaxH3DirectorRefine",
async beforeRegisterNodeDef(nodeType, nodeData) {
if (nodeData?.name !== REFINE_CLASS) return;
const onNodeCreated = nodeType.prototype.onNodeCreated;
nodeType.prototype.onNodeCreated = function (...args) {
const r = onNodeCreated?.apply(this, args);
scheduleRefineRefresh(this);
return r;
};
const onConfigure = nodeType.prototype.onConfigure;
nodeType.prototype.onConfigure = function (...args) {
const r = onConfigure?.apply(this, args);
scheduleRefineRefresh(this);
return r;
};
const onConnectionsChange = nodeType.prototype.onConnectionsChange;
nodeType.prototype.onConnectionsChange = function (...args) {
const r = onConnectionsChange?.apply(this, args);
syncRefineWidgetVisibility(this);
return r;
};
},
nodeCreated(node) {
scheduleRefineRefresh(node);
},
loadedGraphNode(node) {
scheduleRefineRefresh(node);
},
afterConfigureGraph() {
refreshAllRefineNodes();
setTimeout(refreshAllRefineNodes, 100);
},
});
@@ -0,0 +1,6 @@
tree 49301b385f93baacf7dc7b051deea59a3f376180
parent 203eb357743402b437db8ae973a062a9b15387d2
author kijai <40791699+kijai@users.noreply.github.com> 1786729346 +0300
committer kijai <40791699+kijai@users.noreply.github.com> 1786729346 +0300
MiniMaxH3TokenCounter: Fix or latest ComfyUI commits
@@ -0,0 +1,2 @@
From https://github.com/kijai/ComfyUI-KJNodes
* branch 3f20054214fec9f9234fd3841ae6f1e4287948f6 -> FETCH_HEAD
@@ -0,0 +1,5 @@
{
"object": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6"
}
@@ -0,0 +1,6 @@
tree 49301b385f93baacf7dc7b051deea59a3f376180
parent 203eb357743402b437db8ae973a062a9b15387d2
author kijai <40791699+kijai@users.noreply.github.com> 1786729346 +0300
committer kijai <40791699+kijai@users.noreply.github.com> 1786729346 +0300
MiniMaxH3TokenCounter: Fix or latest ComfyUI commits
@@ -0,0 +1,402 @@
{
"sha": "49301b385f93baacf7dc7b051deea59a3f376180",
"truncated": false,
"tree": [
{
"path": ".github/workflows/publish.yml",
"mode": "100644",
"type": "blob",
"sha": "e155f5f40e46fa83942dee5a9460e8093f3b4208"
},
{
"path": ".gitignore",
"mode": "100644",
"type": "blob",
"sha": "6f1bfa9b027ca5507d6edf093373ac1688ff9c19"
},
{
"path": "LICENSE",
"mode": "100644",
"type": "blob",
"sha": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7"
},
{
"path": "README.md",
"mode": "100644",
"type": "blob",
"sha": "77e2a46ef0cb1240613555880077bcead86ab260"
},
{
"path": "__init__.py",
"mode": "100644",
"type": "blob",
"sha": "08e56f0685d754d8e332f0da5baf9683489abfa2"
},
{
"path": "custom_dimensions_example.json",
"mode": "100644",
"type": "blob",
"sha": "5c4814d377d44916a14b4d4a83b7cba72ae2958b"
},
{
"path": "docs/images/2024-04-03_20_49_29-ComfyUI.png",
"mode": "100644",
"type": "blob",
"sha": "43304322e9bad65a4d0bf5d216e3493d3bf67fc3"
},
{
"path": "docs/images/319121566-05f66385-7568-4b1f-8bbc-11053660b02f.png",
"mode": "100644",
"type": "blob",
"sha": "e749239c1c4ffd5ab29b51695dd8d8b51ed3597f"
},
{
"path": "docs/images/319121636-706b5081-9120-4a29-bd76-901691ada688.png",
"mode": "100644",
"type": "blob",
"sha": "b53ad666ff060d87971f3962e74101f0cb2a5c3f"
},
{
"path": "example_workflows/leapfusion_hunyuuanvideo_i2v_native_testing.json",
"mode": "100644",
"type": "blob",
"sha": "134a83788815d04b5574a807db67eb6e45bf9263"
},
{
"path": "fonts/FreeMono.ttf",
"mode": "100644",
"type": "blob",
"sha": "7485f9e4c84d5a372c81e11df2cd9f5e2eb2064a"
},
{
"path": "fonts/FreeMonoBoldOblique.otf",
"mode": "100644",
"type": "blob",
"sha": "dac575acbd08b6fa36d9aac4acd0b2d7ea140eec"
},
{
"path": "fonts/TTNorms-Black.otf",
"mode": "100644",
"type": "blob",
"sha": "39f96c80af61c25ca8c35b25b3cb21673cb0d037"
},
{
"path": "kjweb_async/marked.min.js",
"mode": "100644",
"type": "blob",
"sha": "2e66c369c388c135cc68d399861a737f4c5e68cd"
},
{
"path": "kjweb_async/purify.min.js",
"mode": "100644",
"type": "blob",
"sha": "c2f5164618eebcc44b0186f594ccb8092639c670"
},
{
"path": "nodes/audioscheduler_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "69d0422e7da875298f87fe60a7f6d1494530dca2"
},
{
"path": "nodes/batchcrop_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "dda22b3145555a19c6f8664113a730afb3ae4268"
},
{
"path": "nodes/context_windows_visualizer.py",
"mode": "100644",
"type": "blob",
"sha": "1f3f2be17e1e07796c58f6d64d28d5aec7964887"
},
{
"path": "nodes/curve_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "35dc3558790ca2f5e7860c04827e47a012bdebc7"
},
{
"path": "nodes/hdr_preview_node.py",
"mode": "100644",
"type": "blob",
"sha": "82d2f585a963de873815c4dacf1a4e1419bc13ed"
},
{
"path": "nodes/ideogram4_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "f00c12d6e7c4c7a4eeced984630440b812217686"
},
{
"path": "nodes/image_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "e62fc7d68392bb96798188b92e5f798dbcd63c65"
},
{
"path": "nodes/image_transform_node.py",
"mode": "100644",
"type": "blob",
"sha": "4a0abdc9d183ce0540b7919be94e9edf66201ded"
},
{
"path": "nodes/lora_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "976dbe84386acac7eb847b53e92593c7ff77145d"
},
{
"path": "nodes/ltxv_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "67e95e86008dfdd9be74b6df2c974673c32b2514"
},
{
"path": "nodes/mask_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "ca4dc69ce972751f85d2b80e1c3e5e2de1d82099"
},
{
"path": "nodes/minimax_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "0e666d3b06d0515c987d4eae60069915e18e7447"
},
{
"path": "nodes/model_optimization_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "90d8d41210825a6cc355f4467e4d247f13e55f94"
},
{
"path": "nodes/nodes.py",
"mode": "100644",
"type": "blob",
"sha": "564616cdbced80d962ef7c3a43f80687dbb5fa91"
},
{
"path": "nodes/preview_override_node.py",
"mode": "100644",
"type": "blob",
"sha": "b680803d56a496dbd123537801ce2a4764c7ab71"
},
{
"path": "nodes/sharpen_nodes.py",
"mode": "100644",
"type": "blob",
"sha": "dad2e8ce6c0bdae0511648eeb3dfeab20aa53bdc"
},
{
"path": "nodes/tiny_vae.py",
"mode": "100644",
"type": "blob",
"sha": "a597d5eea9cad07fa20bbb68946fbf5b6f0cc166"
},
{
"path": "nodes/triton_vae.py",
"mode": "100644",
"type": "blob",
"sha": "d92f4146d4b470a06b9cd1083b6131a7f08f6ef3"
},
{
"path": "pyproject.toml",
"mode": "100644",
"type": "blob",
"sha": "e00741e814502464595e0fe3a452de3c1e40522b"
},
{
"path": "requirements.txt",
"mode": "100644",
"type": "blob",
"sha": "791fc4c5f2930db3e6f81d9256b7f91457b9d4d8"
},
{
"path": "utility/fluid.py",
"mode": "100644",
"type": "blob",
"sha": "c0691987f5249a031ecbb74329ba513d5788b691"
},
{
"path": "utility/magictex.py",
"mode": "100644",
"type": "blob",
"sha": "e6d426f7deb3deb977604dd37581eb4e9fe9e6a9"
},
{
"path": "utility/numerical.py",
"mode": "100644",
"type": "blob",
"sha": "b5b88bc63c45d63d8913e56cbd06eb7ab413fe4f"
},
{
"path": "utility/utility.py",
"mode": "100644",
"type": "blob",
"sha": "fcd11f39d7a92601a4721aab695a8596736fdf51"
},
{
"path": "web/js/appearance.js",
"mode": "100644",
"type": "blob",
"sha": "9069207e2ca079363e757da234318c76d24806ee"
},
{
"path": "web/js/canvas_background.js",
"mode": "100644",
"type": "blob",
"sha": "774258a56c6feb37c6addc0f151cbb095aa50e2d"
},
{
"path": "web/js/context_windows_visualizer.js",
"mode": "100644",
"type": "blob",
"sha": "3837fc0afbf8610eeb9c54c6ab878689b6ed1025"
},
{
"path": "web/js/contextmenu.js",
"mode": "100644",
"type": "blob",
"sha": "9abccc68afa731ce54bb85a772a81eabc6ec6ca2"
},
{
"path": "web/js/editors/editor_base.js",
"mode": "100644",
"type": "blob",
"sha": "963d2f7cfaea49efe520fabf7dff1581e9a9a705"
},
{
"path": "web/js/editors/interpolation.js",
"mode": "100644",
"type": "blob",
"sha": "728f923109856572ba9f6474e92fd842eb21ad13"
},
{
"path": "web/js/editors/point_editor_canvas.js",
"mode": "100644",
"type": "blob",
"sha": "395825992b8599c83bf8c6c71dccbd18e7b3568a"
},
{
"path": "web/js/editors/spline_editor_canvas.js",
"mode": "100644",
"type": "blob",
"sha": "00c943de6c965a5416c3efc4ffcda50493935f69"
},
{
"path": "web/js/fast_preview.js",
"mode": "100644",
"type": "blob",
"sha": "15c99d6d7dfa7570e365390cfff3cb81dfbc8f2f"
},
{
"path": "web/js/fast_preview_batch.js",
"mode": "100644",
"type": "blob",
"sha": "f49e47cb3922b2ab04bd1488a846fea5a87cd229"
},
{
"path": "web/js/fillconnect.js",
"mode": "100644",
"type": "blob",
"sha": "1903e415eb10237b0dbae50440c9787fbf8d3f5a"
},
{
"path": "web/js/fix_node.js",
"mode": "100644",
"type": "blob",
"sha": "aec5cbd9b621a9a2030a1d040e826b1cd0f9a071"
},
{
"path": "web/js/hdr_preview.js",
"mode": "100644",
"type": "blob",
"sha": "c7c454f58e4b2f2d82f6114a8cb7c04ff4b7a8b6"
},
{
"path": "web/js/help_popup.js",
"mode": "100644",
"type": "blob",
"sha": "872ab81cec7498fd979785eb9a40d5ad539d451f"
},
{
"path": "web/js/ideogram4_prompt_builder.js",
"mode": "100644",
"type": "blob",
"sha": "ff3df3e22b9befe08885c4f4f3a9c75535d26e64"
},
{
"path": "web/js/image_transform.js",
"mode": "100644",
"type": "blob",
"sha": "b104d901f02daff26c6e25c01e41af0ba161098b"
},
{
"path": "web/js/jsnodes.js",
"mode": "100644",
"type": "blob",
"sha": "a38556a37824c7ce6b70c31c26f6e14fffafba4e"
},
{
"path": "web/js/node_insert.js",
"mode": "100644",
"type": "blob",
"sha": "468c20265aff1612db6c59339d9db476c50847be"
},
{
"path": "web/js/nodeswap.js",
"mode": "100644",
"type": "blob",
"sha": "d588fed5321cb4caf3fbb12da342732abe58c93e"
},
{
"path": "web/js/performance.js",
"mode": "100644",
"type": "blob",
"sha": "4420dce237fab545326b298cd175b27bd85e67bd"
},
{
"path": "web/js/play_sound.js",
"mode": "100644",
"type": "blob",
"sha": "cda30caea56623e650836b77a5e532f47c3cae8c"
},
{
"path": "web/js/preview_override/preview_override.css",
"mode": "100644",
"type": "blob",
"sha": "c5197d80df27cbc767d677b78cc260e1522f8e0a"
},
{
"path": "web/js/preview_override/preview_override.js",
"mode": "100644",
"type": "blob",
"sha": "cc1cf1a8e23e0e38bc0dc2e5dd4d6f64d7ab50cd"
},
{
"path": "web/js/screencap_stream.js",
"mode": "100644",
"type": "blob",
"sha": "1fca8b8b5450086cb40849ab941add09d6f58574"
},
{
"path": "web/js/setgetnodes.js",
"mode": "100644",
"type": "blob",
"sha": "cb4c9a4e61a3900ac406d63a5cbe71069fad783c"
},
{
"path": "web/js/shake_to_disconnect.js",
"mode": "100644",
"type": "blob",
"sha": "3c33c118a700851cfe793262c576745155c11fb7"
},
{
"path": "web/js/utility.js",
"mode": "100644",
"type": "blob",
"sha": "ac54017dbea5f8e57a5a1664989b978cdd00018d"
}
]
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,950 @@
{
"sources": [
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "nodes.py",
"local_file": "../t8-two-reference/core0332__nodes.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/nodes.py",
"sha256": "38f918673c5300bc2d355e02f1131a7b1f97548337e7623754dafaea412008e8",
"git_blob_sha1": "1a3dd3f484f56297f0a8df5722698f1d973f2a08",
"acquisition_time": "2026-10-31T23:49:32.739067+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_api/latest/_io.py",
"local_file": "../t8-two-reference/core0332__comfy_api__latest___io.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy_api/latest/_io.py",
"sha256": "495aefa059aad4eed4181aa7fbb415679d3f269651e9fc6f542bdac1b99dd40f",
"git_blob_sha1": "6d9e08f478f345871152ff395c295f19b0771943",
"acquisition_time": "2026-10-31T23:49:32.739067+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "LICENSE",
"local_file": "../t8-two-reference/core0332__LICENSE",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/LICENSE",
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
"acquisition_time": "2026-10-31T23:49:32.739067+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "requirements.txt",
"local_file": "../t8-two-reference/core0332__requirements.txt",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/requirements.txt",
"sha256": "f74b3a106dec0b367ad9a7a4ef132870474a1c997a58249a0e17eb01294e40c7",
"git_blob_sha1": "8a320b084468d0b77560829842bb1199bb28be43",
"acquisition_time": "2026-10-31T23:49:32.739067+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_api/latest/_input_impl/video_types.py",
"local_file": "../t8-two-reference/core0332__comfy_api__latest___input_impl__video_types.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy_api/latest/_input_impl/video_types.py",
"sha256": "f838d6d3e113c5f885e44fd056c32caa7d9549736663fe669f2b96c39422386b",
"git_blob_sha1": "cf4119250a4e2d99b29eacebc7bfbb629e21cac4",
"acquisition_time": "2026-10-31T23:50:25.004791+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_api/latest/_util/video_types.py",
"local_file": "../t8-two-reference/core0332__comfy_api__latest___util__video_types.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy_api/latest/_util/video_types.py",
"sha256": "5d2f7dd2b82aecec3c05f8f5bd9519530736825d33590207ea0aa32b8cc8627f",
"git_blob_sha1": "6c9d6a526251bf1040ef41bc3bb8a60f8be2c7b1",
"acquisition_time": "2026-10-31T23:50:25.004791+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "folder_paths.py",
"local_file": "../t8-two-reference/core0332__folder_paths.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/folder_paths.py",
"sha256": "b748be5d1e068ad673f6c4de069fb6b7b723405c40ae3c3c44465d416f7df2db",
"git_blob_sha1": "6723e52c867c57003e9ba4ed53ae58f8d79a7752",
"acquisition_time": "2026-10-31T23:50:25.004791+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "node_helpers.py",
"local_file": "../t8-two-reference/core0332__node_helpers.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/node_helpers.py",
"sha256": "22317a033cce556331bfedc5f4ab6c2833184fd2bbdf9496c9182a4973a7098a",
"git_blob_sha1": "cac4e88dd14276160146262c824fa39a542eaa24",
"acquisition_time": "2026-10-31T23:50:25.004791+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy/ldm/modules/attention.py",
"local_file": "../t8-two-reference/core0332__comfy__ldm__modules__attention.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy/ldm/modules/attention.py",
"sha256": "e427364dbbca564ae04b035d31363b609b8239bf19a99fb7bec0fccf878880ce",
"git_blob_sha1": "b22d03d775500d72297c51ffbdc17baefca8f1e7",
"acquisition_time": "2026-10-31T23:51:01.384617+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": "../t8-two-reference",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0340",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_extras/nodes_primitive.py",
"local_file": "../h3-latent-reference/core0340__comfy_extras__nodes_primitive.py",
"commit": "12d5279438bfefc058a269eae805ceab6047777f",
"tree": "f84b37182549cf760e146f94bc6a38b0395b004e",
"tag": "v0.34.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/12d5279438bfefc058a269eae805ceab6047777f/comfy_extras/nodes_primitive.py",
"sha256": "ee3882214ebdd0d20c8061691075cebb1642c303e162f6d22ae525d75aa59b2d",
"git_blob_sha1": "35761863ff49fba89af08f02314354f92770bc91",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/core0340__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "core0340",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0340",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_api/latest/_io.py",
"local_file": "../h3-latent-reference/core0340__comfy_api__latest___io.py",
"commit": "12d5279438bfefc058a269eae805ceab6047777f",
"tree": "f84b37182549cf760e146f94bc6a38b0395b004e",
"tag": "v0.34.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/12d5279438bfefc058a269eae805ceab6047777f/comfy_api/latest/_io.py",
"sha256": "495aefa059aad4eed4181aa7fbb415679d3f269651e9fc6f542bdac1b99dd40f",
"git_blob_sha1": "6d9e08f478f345871152ff395c295f19b0771943",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/core0340__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "core0340",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0340",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_api/latest/_io_public.py",
"local_file": "../h3-latent-reference/core0340__comfy_api__latest___io_public.py",
"commit": "12d5279438bfefc058a269eae805ceab6047777f",
"tree": "f84b37182549cf760e146f94bc6a38b0395b004e",
"tag": "v0.34.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/12d5279438bfefc058a269eae805ceab6047777f/comfy_api/latest/_io_public.py",
"sha256": "c805d754d61aba1ea72ed2d9d5c371de35be9affa5305d35426fb298fcb7c046",
"git_blob_sha1": "43c7680f3283cec64bf89023ca7ec90314a3499d",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/core0340__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "core0340",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "core0340",
"repo": "Comfy-Org/ComfyUI",
"file": "LICENSE",
"local_file": "../h3-latent-reference/core0340__LICENSE",
"commit": "12d5279438bfefc058a269eae805ceab6047777f",
"tree": "f84b37182549cf760e146f94bc6a38b0395b004e",
"tag": "v0.34.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/12d5279438bfefc058a269eae805ceab6047777f/LICENSE",
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/core0340__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "core0340",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "__init__.py",
"local_file": "../h3-latent-reference/kj____init__.py",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/__init__.py",
"sha256": "2d1032dc82a46f4539f301721e854dbc19b707f29db6734f54c0551b56bbfcf1",
"git_blob_sha1": "08e56f0685d754d8e332f0da5baf9683489abfa2",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "LICENSE",
"local_file": "../h3-latent-reference/kj__LICENSE",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/LICENSE",
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "requirements.txt",
"local_file": "../h3-latent-reference/kj__requirements.txt",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/requirements.txt",
"sha256": "e8cc1fb089c6e74bb5f326e949fd89ea7653de0d193d7a385c38af44e66656bd",
"git_blob_sha1": "791fc4c5f2930db3e6f81d9256b7f91457b9d4d8",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "pyproject.toml",
"local_file": "../h3-latent-reference/kj__pyproject.toml",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/pyproject.toml",
"sha256": "4d4a226e0b1ba9962b13bd9e81ddf91cf26be25f1f82e0e31660f96a84af1ae9",
"git_blob_sha1": "e00741e814502464595e0fe3a452de3c1e40522b",
"acquisition_time": "2026-10-31T22:43:40.872024+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "nodes/ltxv_nodes.py",
"local_file": "../h3-latent-reference/kj__nodes__ltxv_nodes.py",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/nodes/ltxv_nodes.py",
"sha256": "11286583c56e653dbd57f5e8eda6902c84b759f16b359b3bf0c895b43e6b5364",
"git_blob_sha1": "67e95e86008dfdd9be74b6df2c974673c32b2514",
"acquisition_time": "unknown:首次扩展已取得但未单独记时;保留复核时间,不把重取时间当首次",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "nodes/preview_override_node.py",
"local_file": "../h3-latent-reference/kj__nodes__preview_override_node.py",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/nodes/preview_override_node.py",
"sha256": "6060c2382e61c041104a61c1fe06f2a163fcddc6e715d20fbf7a03f0af46715c",
"git_blob_sha1": "b680803d56a496dbd123537801ce2a4764c7ab71",
"acquisition_time": "unknown:首次扩展已取得但未单独记时;保留复核时间,不把重取时间当首次",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "nodes/tiny_vae.py",
"local_file": "../h3-latent-reference/kj__nodes__tiny_vae.py",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/nodes/tiny_vae.py",
"sha256": "f09d1e3ab1cb0f2ee4949f4192b7ea1bb47390c47b80f8517532301283a3472d",
"git_blob_sha1": "a597d5eea9cad07fa20bbb68946fbf5b6f0cc166",
"acquisition_time": "2026-10-31T22:45:46.566804+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../h3-latent-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "nodes/minimax_nodes.py",
"local_file": "../director-two-reference/kj__nodes__minimax_nodes.py",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/nodes/minimax_nodes.py",
"sha256": "6f3df10c042677270053d75223db3e05ede1106be20fc178220531b73dc868fa",
"git_blob_sha1": "0e666d3b06d0515c987d4eae60069915e18e7447",
"acquisition_time": "2026-11-01T01:32:54.623177+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": "../director-two-reference",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复"
},
{
"id": "frontend",
"repo": "Comfy-Org/ComfyUI_frontend",
"file": "package.json",
"local_file": "../zimage-reference/frontend__package.json",
"commit": "8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33",
"tree": "cbdc998a1a98a915ae7ce222e8bfaea1004ecddb",
"tag": "v1.23.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33/package.json",
"sha256": "779859b44ef43fa6c7967e933757eb45c1310f1c9a1dc2a5939814beee657df5",
"git_blob_sha1": "c8571c621685462ca24a43f1f4e440b724a01b25",
"acquisition_time": "2026-10-31T00:28:49.814032+00:00",
"license_file": "../zimage-reference/frontend__LICENSE",
"transport": "filtered git; selected text blobs only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../zimage-reference",
"identity_key": "frontend",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "frontend",
"repo": "Comfy-Org/ComfyUI_frontend",
"file": "package-lock.json",
"local_file": "../zimage-reference/frontend__package-lock.json",
"commit": "8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33",
"tree": "cbdc998a1a98a915ae7ce222e8bfaea1004ecddb",
"tag": "v1.23.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33/package-lock.json",
"sha256": "69ef63cb797d33667714507f0dc3d482898f69d4ed20816d7bcd8f5b8f63a217",
"git_blob_sha1": "97a8f5a5062b55c158a8732cf15793f8de6cc2a9",
"acquisition_time": "2026-10-31T00:28:50.591465+00:00",
"license_file": "../zimage-reference/frontend__LICENSE",
"transport": "filtered git; selected text blobs only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../zimage-reference",
"identity_key": "frontend",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "frontend",
"repo": "Comfy-Org/ComfyUI_frontend",
"file": "src/scripts/widgets.ts",
"local_file": "../zimage-reference/frontend__src__scripts__widgets.ts",
"commit": "8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33",
"tree": "cbdc998a1a98a915ae7ce222e8bfaea1004ecddb",
"tag": "v1.23.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33/src/scripts/widgets.ts",
"sha256": "c0dbe60dd08111e6c589c4dfa86ad9be73b4a30007153aa6ac428600deda204e",
"git_blob_sha1": "90f5e54f7d42c7db18a1c0622f97d4a2003ceb4d",
"acquisition_time": "2026-10-31T00:28:51.279847+00:00",
"license_file": "../zimage-reference/frontend__LICENSE",
"transport": "filtered git; selected text blobs only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../zimage-reference",
"identity_key": "frontend",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "frontend",
"repo": "Comfy-Org/ComfyUI_frontend",
"file": "src/scripts/app.ts",
"local_file": "../zimage-reference/frontend__src__scripts__app.ts",
"commit": "8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33",
"tree": "cbdc998a1a98a915ae7ce222e8bfaea1004ecddb",
"tag": "v1.23.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33/src/scripts/app.ts",
"sha256": "c1a9217d3ef3e16e4b7bebe000b796083c5ac97f098fff7e64566046418455c9",
"git_blob_sha1": "31d2ba1ccbc553a6e03b54ebd4c5859a06ff6247",
"acquisition_time": "2026-10-31T00:28:51.944908+00:00",
"license_file": "../zimage-reference/frontend__LICENSE",
"transport": "filtered git; selected text blobs only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../zimage-reference",
"identity_key": "frontend",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "frontend",
"repo": "Comfy-Org/ComfyUI_frontend",
"file": "src/extensions/core/widgetInputs.ts",
"local_file": "../zimage-reference/frontend__src__extensions__core__widgetInputs.ts",
"commit": "8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33",
"tree": "cbdc998a1a98a915ae7ce222e8bfaea1004ecddb",
"tag": "v1.23.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33/src/extensions/core/widgetInputs.ts",
"sha256": "998f0f5e517080c2ea778f4e9c37723db174bb195a6f6960dfd6827a8fb49d4d",
"git_blob_sha1": "ee6dab6838376d0cb83d6a20da10751dc7401d32",
"acquisition_time": "2026-10-31T00:28:52.610512+00:00",
"license_file": "../zimage-reference/frontend__LICENSE",
"transport": "filtered git; selected text blobs only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../zimage-reference",
"identity_key": "frontend",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "frontend",
"repo": "Comfy-Org/ComfyUI_frontend",
"file": "src/extensions/core/rerouteNode.ts",
"local_file": "../zimage-reference/frontend__src__extensions__core__rerouteNode.ts",
"commit": "8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33",
"tree": "cbdc998a1a98a915ae7ce222e8bfaea1004ecddb",
"tag": "v1.23.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33/src/extensions/core/rerouteNode.ts",
"sha256": "73eba79858028e6e8656a2d2ded434e64e75d5d74e066a727b93a585139c31bb",
"git_blob_sha1": "0df8263aba4ad5486f2fa2305013a1b305374c04",
"acquisition_time": "2026-10-31T00:28:53.294754+00:00",
"license_file": "../zimage-reference/frontend__LICENSE",
"transport": "filtered git; selected text blobs only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../zimage-reference",
"identity_key": "frontend",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "frontend",
"repo": "Comfy-Org/ComfyUI_frontend",
"file": "LICENSE",
"local_file": "../zimage-reference/frontend__LICENSE",
"commit": "8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33",
"tree": "cbdc998a1a98a915ae7ce222e8bfaea1004ecddb",
"tag": "v1.23.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/8c05266b83b5024f2c12c8de6c2a0a4ecf2ebd33/LICENSE",
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
"acquisition_time": "2026-10-31T00:28:53.982138+00:00",
"license_file": "../zimage-reference/frontend__LICENSE",
"transport": "filtered git; selected text blobs only",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../zimage-reference",
"identity_key": "frontend",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "litegraph",
"tag": "0.15.15",
"commit": "npm锁定包;Git绑定未知",
"tree": "未知",
"file": "package/LICENSE",
"local_file": "../flux2-lineart-reference/litegraph__package__LICENSE",
"url": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.15.15.tgz",
"sha256": "1b38cc30fe774bcc77538ab99eb460f4e1c8a47c4fddc6e991ee3b5cc2a96bb9",
"artifact_sha256": "ccd21948eab83af59321b9ff80fa4c11f6f5ef639a210f7fb8e77a1129bb7769",
"artifact_sha512_base64": "otOKgTxNPV6gEa6PW1fHGMMF8twjnZkP0vWQhGsRISK4vN8tPfX8O9sC9Hnq3nV8axaMv4/Ff49+7mMVcFEKeA==",
"license_file": "../flux2-lineart-reference/litegraph__package__LICENSE",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../flux2-lineart-reference",
"identity_key": "litegraph",
"transport": "复用既有准确锁定包成员;本批重算成员SHA,不声称重算完整包摘要或Git身份",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "litegraph",
"tag": "0.15.15",
"commit": "npm锁定包;Git绑定未知",
"tree": "未知",
"file": "package/dist/litegraph.es.js",
"local_file": "../flux2-lineart-reference/litegraph__package__dist__litegraph.es.js",
"url": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.15.15.tgz",
"sha256": "6242fb80a52ce2989ab89e1d87103a0c174c783ebdca0b5359fedc360726bd40",
"artifact_sha256": "ccd21948eab83af59321b9ff80fa4c11f6f5ef639a210f7fb8e77a1129bb7769",
"artifact_sha512_base64": "otOKgTxNPV6gEa6PW1fHGMMF8twjnZkP0vWQhGsRISK4vN8tPfX8O9sC9Hnq3nV8axaMv4/Ff49+7mMVcFEKeA==",
"license_file": "../flux2-lineart-reference/litegraph__package__LICENSE",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../flux2-lineart-reference",
"identity_key": "litegraph",
"transport": "复用既有准确锁定包成员;本批重算成员SHA,不声称重算完整包摘要或Git身份",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "litegraph",
"tag": "0.15.15",
"commit": "npm锁定包;Git绑定未知",
"tree": "未知",
"file": "package/package.json",
"local_file": "../flux2-lineart-reference/litegraph__package__package.json",
"url": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.15.15.tgz",
"sha256": "7a9758d292a422fcec9af33159b54da11c90114722b3eb786dd19224b8103241",
"artifact_sha256": "ccd21948eab83af59321b9ff80fa4c11f6f5ef639a210f7fb8e77a1129bb7769",
"artifact_sha512_base64": "otOKgTxNPV6gEa6PW1fHGMMF8twjnZkP0vWQhGsRISK4vN8tPfX8O9sC9Hnq3nV8axaMv4/Ff49+7mMVcFEKeA==",
"license_file": "../flux2-lineart-reference/litegraph__package__LICENSE",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../flux2-lineart-reference",
"identity_key": "litegraph",
"transport": "复用既有准确锁定包成员;本批重算成员SHA,不声称重算完整包摘要或Git身份",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "litegraph",
"tag": "0.15.15",
"commit": "npm锁定包;Git绑定未知",
"tree": "未知",
"file": "package/dist/LGraphNode.d.ts",
"local_file": "../flux2-lineart-reference/litegraph__package__dist__LGraphNode.d.ts",
"url": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.15.15.tgz",
"sha256": "a3bc205d5492c23332647290fedb628443039ba8d6f8f4d731117f239481cf4b",
"artifact_sha256": "ccd21948eab83af59321b9ff80fa4c11f6f5ef639a210f7fb8e77a1129bb7769",
"artifact_sha512_base64": "otOKgTxNPV6gEa6PW1fHGMMF8twjnZkP0vWQhGsRISK4vN8tPfX8O9sC9Hnq3nV8axaMv4/Ff49+7mMVcFEKeA==",
"license_file": "../flux2-lineart-reference/litegraph__package__LICENSE",
"applicability": "第145批逐实例静态复核;保留首次记录,不证明目标安装/恢复",
"identity_root": "../flux2-lineart-reference",
"identity_key": "litegraph",
"transport": "复用既有准确锁定包成员;本批重算成员SHA,不声称重算完整包摘要或Git身份",
"reverified_at": "2026-11-01T03:50:49.608757+00:00"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "__init__.py",
"local_file": "director____init__.py",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/__init__.py",
"sha256": "b29b0f178c342c507791823228e2509c462011dc6c58ab3522a90364af2f9f96",
"git_blob_sha1": "e6dedcad084f6e726eddce0866c9a89ee96d7052",
"acquisition_time": "2026-11-01T03:50:49.608757+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "LICENSE",
"local_file": "director__LICENSE",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/LICENSE",
"sha256": "367fe288aba854ae7d586c5cd3df10183c8880e7776531de3ba12d2300df9ae2",
"git_blob_sha1": "56fd57f1eafe4e49920443b8465cd019803012f0",
"acquisition_time": "2026-11-01T03:50:49.608757+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "requirements.txt",
"local_file": "director__requirements.txt",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/requirements.txt",
"sha256": "7c8bb2cd2820d997a644937c63bfc6110bab99ab880c6217827d65e93143419e",
"git_blob_sha1": "ec483a2e893b726a6d71cf47b7daaa9686bdeafa",
"acquisition_time": "2026-11-01T03:50:49.608757+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "pyproject.toml",
"local_file": "director__pyproject.toml",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/pyproject.toml",
"sha256": "f1923fb2a45ecce7372b4199d81ace6b3f411feff5018d1d0e119e1a34955fea",
"git_blob_sha1": "d62dfdbfc9cc0219db30005ed259c36618149a75",
"acquisition_time": "2026-11-01T03:50:49.608757+00:00",
"reverified_at": "2026-11-01T03:50:49.608757+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "nodes/director_refine.py",
"local_file": "director__nodes__director_refine.py",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/nodes/director_refine.py",
"sha256": "32448f7c5f35a4b27d221ca100310a44203f9f1780edeef586dda37444b5fa58",
"git_blob_sha1": "0f92428a073da9b7c022f98b64534cda60242af2",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "nodes/director_common.py",
"local_file": "director__nodes__director_common.py",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/nodes/director_common.py",
"sha256": "ca4fc2bf41feeccf448b67030575a69e4d167651c273f3d88a208f64dcba4f14",
"git_blob_sha1": "8444bf4c9c559649af1c14278278c6968493fcab",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "web/js/minimax_refine.js",
"local_file": "director__web__js__minimax_refine.js",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/web/js/minimax_refine.js",
"sha256": "b3f3dffdf1d0a6a02855b8cf5875b89b55be698462975bd85b29e02d7ac16c8f",
"git_blob_sha1": "4690952699a7ad1c10fe7fedea9cb334b2b796b7",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "director/refine_pack.py",
"local_file": "director__director__refine_pack.py",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/director/refine_pack.py",
"sha256": "d40f510c5c3cf9344bebcfdb2ac9042f8afeb7a775944639d21f1e6fbb3c155b",
"git_blob_sha1": "a486f91ecfb5be65cebe5307ffc699d1e43c1168",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_extras/nodes_video.py",
"local_file": "core0332__comfy_extras__nodes_video.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy_extras/nodes_video.py",
"sha256": "727653159de9a6e9d5b37b1101d3ece5df7dce8fc6a5a3a1f27e260afcfa6c14",
"git_blob_sha1": "45394ce4df077c1bfb9593a21637675d9cc48b99",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": ".",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_extras/nodes_upscale_model.py",
"local_file": "core0332__comfy_extras__nodes_upscale_model.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy_extras/nodes_upscale_model.py",
"sha256": "5b88372065c516b318c9134f59972f0efb651886c3d08937258d0e1490d4ab19",
"git_blob_sha1": "d1e0401b9a2a9ae7022f7e732c6d4401d5b94021",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": ".",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_api/latest/_io_public.py",
"local_file": "core0332__comfy_api__latest___io_public.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy_api/latest/_io_public.py",
"sha256": "c805d754d61aba1ea72ed2d9d5c371de35be9affa5305d35426fb298fcb7c046",
"git_blob_sha1": "43c7680f3283cec64bf89023ca7ec90314a3499d",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": ".",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "core0340",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_extras/nodes_model_advanced.py",
"local_file": "core0340__comfy_extras__nodes_model_advanced.py",
"commit": "12d5279438bfefc058a269eae805ceab6047777f",
"tree": "f84b37182549cf760e146f94bc6a38b0395b004e",
"tag": "v0.34.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/12d5279438bfefc058a269eae805ceab6047777f/comfy_extras/nodes_model_advanced.py",
"sha256": "46de8e11873a00b7938737e77bdde3579a2236f54799174ab45ed80f8a10ae09",
"git_blob_sha1": "c73b0ba12399aae862406c56d0bb3e32393df00c",
"acquisition_time": "2026-11-01T03:51:35.775899+00:00",
"reverified_at": "2026-11-01T03:51:35.775899+00:00",
"license_file": "../h3-latent-reference/core0340__LICENSE",
"identity_root": ".",
"identity_key": "core0340",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "director/h3_latent_upscale.py",
"local_file": "director__director__h3_latent_upscale.py",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/director/h3_latent_upscale.py",
"sha256": "ef132239f53b8a38e6f68c4cf17dbbe05abb96865e3775cf522a8a7dbb700fe5",
"git_blob_sha1": "d06f357659e46df0124f91317f9aa32a5989a08b",
"acquisition_time": "2026-11-01T03:52:18.705159+00:00",
"reverified_at": "2026-11-01T03:52:18.705159+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "lib/image_prep.py",
"local_file": "director__lib__image_prep.py",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/lib/image_prep.py",
"sha256": "ef9b42c07c546af92a364516a08219adf1fe9a676284cb8b1af6abb0904fea65",
"git_blob_sha1": "8f3b1290ad4a6396d7cafaaed67dfc2d260ac650",
"acquisition_time": "2026-11-01T03:52:18.705159+00:00",
"reverified_at": "2026-11-01T03:52:18.705159+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "director",
"repo": "AIMixer/ComfyUI_MiniMaxH3_Director",
"file": "web/js/minimax_gen_timeline.js",
"local_file": "director__web__js__minimax_gen_timeline.js",
"commit": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"tree": "31655be0b414a37e23e142247f5e0b1abf5b6b1a",
"tag": "6ff79b4aa15d56055cfa61d915889867027c9ab1",
"url": "https://raw.githubusercontent.com/AIMixer/ComfyUI_MiniMaxH3_Director/6ff79b4aa15d56055cfa61d915889867027c9ab1/web/js/minimax_gen_timeline.js",
"sha256": "ff277adf18f0bbac4c47857bb8e1379eb9244d5acd5ce431642aa3864af8a546",
"git_blob_sha1": "6f4cede8eeef67afc029b1e253ed97757ce42d2a",
"acquisition_time": "2026-11-01T03:52:18.705159+00:00",
"reverified_at": "2026-11-01T03:52:18.705159+00:00",
"license_file": "director__LICENSE",
"identity_root": ".",
"identity_key": "director",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "kj",
"repo": "kijai/ComfyUI-KJNodes",
"file": "nodes/model_optimization_nodes.py",
"local_file": "kj__nodes__model_optimization_nodes.py",
"commit": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"tree": "49301b385f93baacf7dc7b051deea59a3f376180",
"tag": "3f20054214fec9f9234fd3841ae6f1e4287948f6",
"url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/3f20054214fec9f9234fd3841ae6f1e4287948f6/nodes/model_optimization_nodes.py",
"sha256": "f77bb07d3b086c18e55143a125e4f91debac6fcc9fe6e0d5856f65381ad728dd",
"git_blob_sha1": "90d8d41210825a6cc355f4467e4d247f13e55f94",
"acquisition_time": "2026-11-01T03:52:18.705159+00:00",
"reverified_at": "2026-11-01T03:52:18.705159+00:00",
"license_file": "../h3-latent-reference/kj__LICENSE",
"identity_root": ".",
"identity_key": "kj",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "core0332",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy_extras/nodes_preview_any.py",
"local_file": "core0332__comfy_extras__nodes_preview_any.py",
"commit": "7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa",
"tree": "c98185bd79c7df3e44d6762e392d2c8073e19978",
"tag": "v0.33.2",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/7cee3ceb1a35503172e0dfb8dbdbdedee2aba8aa/comfy_extras/nodes_preview_any.py",
"sha256": "9b4d5dcc4ee73e0c22d41ee58184c8392fa5b3f0f55d3af86cab52fe08d1046f",
"git_blob_sha1": "18bf7c1cdb091d59346514ee420b5b33d3b75863",
"acquisition_time": "2026-11-01T03:53:08.534958+00:00",
"reverified_at": "2026-11-01T03:53:08.534958+00:00",
"license_file": "../t8-two-reference/core0332__LICENSE",
"identity_root": ".",
"identity_key": "core0332",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
},
{
"id": "core0340",
"repo": "Comfy-Org/ComfyUI",
"file": "comfy/ldm/modules/attention.py",
"local_file": "core0340__comfy__ldm__modules__attention.py",
"commit": "12d5279438bfefc058a269eae805ceab6047777f",
"tree": "f84b37182549cf760e146f94bc6a38b0395b004e",
"tag": "v0.34.0",
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/12d5279438bfefc058a269eae805ceab6047777f/comfy/ldm/modules/attention.py",
"sha256": "e427364dbbca564ae04b035d31363b609b8239bf19a99fb7bec0fccf878880ce",
"git_blob_sha1": "b22d03d775500d72297c51ffbdc17baefca8f1e7",
"acquisition_time": "2026-11-01T03:53:08.534958+00:00",
"reverified_at": "2026-11-01T03:53:08.534958+00:00",
"license_file": "../h3-latent-reference/core0340__LICENSE",
"identity_root": ".",
"identity_key": "core0340",
"transport": "filtered Git necessary text only",
"applicability": "本图独立准确版本静态核准,不执行或认证安装/恢复"
}
]
}