Add experimental timeline video reference modes

This commit is contained in:
ukr8b3g-cmyk
2026-09-22 03:02:57 +09:00
parent 085943ad9c
commit 178efb6b21
26 changed files with 5607 additions and 81 deletions
+15
View File
@@ -1340,6 +1340,20 @@ function configureIntuitiveV38Ux(node) {
setWidgetVisible(findWidget(node, LEGACY_RUN_NAME_WIDGET), advanced && storageEnabled);
setWidgetVisible(findWidget(node, REROLL_NONCE_WIDGET), advanced && explicitRegeneration);
applyV38WidgetHelp(node);
// This is the appended native widget, not another transient proxy.
// Core persists its value; visibility never changes the saved mode.
const videoMode = findWidget(node, "video_reference_mode");
setWidgetVisible(videoMode, videoConnected);
if (videoMode) {
videoMode.label = "Video Reference Mode";
setWidgetTooltip(videoMode, String(videoMode.value) === "Follow Timeline"
? "Experimental: use successive 24 fps source intervals. After the source ends, continue without a video reference. Independent of Prompt Format."
: "Legacy Video Guide behavior: reuse the same bounded source prefix on each physical group. This is not source looping or stretching.");
}
const timelineInput = node.inputs?.find((item) => item.name === "reference_video_1");
if (timelineInput) {
timelineInput.label = "Timeline Video Frames";
}
moveFacadeWidgetsToFront(node, orderedNames);
node.__h3ContinuumProductionUxRefresh?.();
node.setDirtyCanvas?.(true, true);
@@ -1348,6 +1362,7 @@ function configureIntuitiveV38Ux(node) {
for (const [name, key] of (
[
["prompt_mode", "__h3ContinuumFacadePromptMode"],
["video_reference_mode", "__h3ContinuumFacadeVideoReferenceMode"],
["continuity", "__h3ContinuumFacadeContinuity"],
["base_seed", "__h3ContinuumFacadeBaseSeed"],
["audio_continuity", "__h3ContinuumFacadeAudioContinuity"],
+4 -1
View File
@@ -17,7 +17,10 @@ export function normalizeReferenceAudioLabels(node) {
return true;
}
for (const input of node.inputs || []) {
const label = NORMALIZED_INPUT_LABELS[input.name];
const label = input.name === "reference_video_1"
&& node.comfyClass === "H3ContinuumSamplerV38"
? "Timeline Video Frames"
: NORMALIZED_INPUT_LABELS[input.name];
if (label) {
input.label = label;
}
+42
View File
@@ -0,0 +1,42 @@
import { app } from "../../scripts/app.js";
const NODE_CLASS = "H3ContinuumSamplerV38";
const MODE = "video_reference_mode";
const REPEAT = "Repeat Reference";
const FOLLOW = "Follow Timeline";
export function restoreVideoReferenceMode(node, info) {
const widget = node.widgets?.find((item) => item.name === MODE);
if (!widget) return;
const linked = info?.inputs?.some((input) => (
(input.name === MODE || input.widget?.name === MODE) && input.link != null
));
if (linked) return; // The connected input, not a hidden widget, owns its value.
let value;
const named = info?.widgets_values_named;
if (named && Object.prototype.hasOwnProperty.call(named, MODE)) {
value = named[MODE];
} else if (!named) {
// The existing V38X2 backend widgets occupy slots 0..29. This new
// optional scalar is appended; no upload/UI/transient row is inserted.
const values = info?.widgets_values;
if (Array.isArray(values) && values.length > 30) value = values[30];
}
// In particular A(Follow)->B(old workflow) must not inherit A's mode.
widget.value = value === FOLLOW ? FOLLOW : REPEAT;
node.__h3ContinuumIntuitiveUxRefresh?.();
}
app.registerExtension({
name: "H3Continuum.TimelineVideoModeExperimental",
beforeRegisterNodeDef(nodeType, nodeData) {
if (nodeData?.name !== NODE_CLASS && nodeType?.prototype?.comfyClass !== NODE_CLASS) return;
const previous = nodeType.prototype.onConfigure;
nodeType.prototype.onConfigure = function(info, ...args) {
const result = previous?.call(this, info, ...args);
restoreVideoReferenceMode(this, info);
return result;
};
},
});