Polish sequence prompt builder reference UI

This commit is contained in:
2026-10-20 13:24:12 +00:00
parent 506f97ab6c
commit e747945ba5
+16 -4
View File
@@ -370,12 +370,13 @@ function configure(node) {
panel.append(timeline);
const sliderHint = el("div", "Drag the white handles to resize shots. The bar represents the complete chunk duration."); sliderHint.style.cssText = "color:#aab6ad;margin-bottom:6px;font-size:11px"; panel.append(sliderHint);
const shotChips = el("div"); shotChips.style.cssText = "display:flex;gap:4px;overflow:hidden;margin:3px 0 5px";
const shotLabel = el("div", "SHOT TRACK"); shotLabel.style.cssText = "color:#8fa898;font-size:10px;letter-spacing:.08em;margin:4px 0 3px"; panel.append(shotLabel);
const shotChips = el("div"); shotChips.style.cssText = "display:flex;gap:5px;overflow:hidden;margin:3px 0 7px;padding:4px;background:#202020;border:1px solid #3f4742;border-radius:5px";
clip.slots.forEach((slot, index) => {
const chipText = (slot.text || `Shot ${index + 1}`).replace(/\s+/g, " ").trim().slice(0, 31);
const chip = el("button", chipText || `Shot ${index + 1}`); chip.type = "button";
chip.title = `Jump to Shot ${index + 1}`;
chip.style.cssText = `max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:3px 8px;border:1px solid ${palette[index % palette.length]};border-radius:4px;background:#1e1e1e;color:#e6e6e6;font:11px Arial;cursor:pointer`;
chip.style.cssText = `flex:1 1 90px;min-width:70px;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:5px 9px;border:1px solid ${palette[index % palette.length]};border-radius:5px;background:${palette[index % palette.length]}33;color:#e6e6e6;font:11px Arial;cursor:pointer`;
chip.onclick = (event) => {
event.preventDefault(); event.stopPropagation();
if (!prompt) return;
@@ -387,7 +388,8 @@ function configure(node) {
shotChips.append(chip);
});
panel.append(shotChips);
const referenceRow = el("div"); referenceRow.style.cssText = "display:flex;gap:8px;overflow:hidden;margin:7px 0 8px;align-items:center;flex-wrap:wrap";
const referenceLabel = el("div", "REFERENCE SLOTS"); referenceLabel.style.cssText = "color:#8fa898;font-size:10px;letter-spacing:.08em;margin:7px 0 3px"; panel.append(referenceLabel);
const referenceRow = el("div"); referenceRow.style.cssText = "display:flex;gap:7px;overflow:hidden;margin:3px 0 8px;padding:5px;background:#202020;border:1px solid #3f4742;border-radius:5px;align-items:center;flex-wrap:wrap;min-height:38px;box-sizing:border-box";
const connectedReferences = Array.from({ length: 9 }, (_, offset) => offset + 1)
.filter((index) => node.inputs?.some((input) => input.name === `reference_image_${index}` && input.link != null));
if (connectedReferences.length) {
@@ -444,6 +446,17 @@ function configure(node) {
referenceRow.append(button);
});
}
const refModsConnected = node.inputs?.some((input) => input.name === "ref_mods" && input.link != null);
if (refModsConnected) {
const firstRefModSlot = Math.max(0, ...connectedReferences);
const status = el("div"); status.title = "RefMods are connected to the prompt builder and are assigned after image reference slots.";
status.style.cssText = "display:inline-flex;align-items:center;gap:7px;height:31px;padding:2px 11px 2px 5px;border:2px solid #b78cff;border-radius:18px;background:#2a2138;color:#d9c2ff;font:13px monospace;white-space:nowrap";
const icon = el("span", "R"); icon.style.cssText = "display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#7952a8;color:#fff;font-weight:bold;font-size:12px";
status.append(icon, el("span", `RefMods → @R${firstRefModSlot + 1}…`)); referenceRow.append(status);
}
if (!connectedReferences.length && !refModsConnected) {
const empty = el("span", "Connect image references or RefMods to populate this row."); empty.style.cssText = "color:#77817a;font:11px Arial;padding:3px 2px"; referenceRow.append(empty);
}
panel.append(referenceRow);
const promptLabel = el("div", "PROMPT SCRIPT"); promptLabel.style.cssText = "color:#8fa898;font-size:10px;letter-spacing:.08em;margin:4px 0 3px"; panel.append(promptLabel);
prompt = el("textarea"); prompt.rows = 10; prompt.value = promptText; prompt.placeholder = "[Shot 1] At 00:00.000, describe the opening action...\n\nType @ at the start of a new line to add the next shot."; prompt.style.cssText = "width:100%;box-sizing:border-box;color:#e8e8e8;background:#171717;border:1px solid #4e4e4e;border-radius:4px;padding:8px;font:12px/1.45 monospace;margin-top:2px;resize:vertical;outline:none";
@@ -654,4 +667,3 @@ app.registerExtension({
loadedGraphNode(node) { setTimeout(() => configure(node), 0); },
afterConfigureGraph() { for (const node of app.graph?._nodes || []) configure(node); },
});