Compare commits

..
4 Commits
Author SHA1 Message Date
ausboss f6d01458a8 Merge pull request #422 from ausboss/ausboss/sharp-benz-0b488e
Edit Lock: say what is wrong when the VAE and model don't match
2026-11-26 11:48:51 -06:00
ausboss 60dca17f4a Merge pull request #421 from ausboss/fix/wired-megapixels-readout
Crop + Rotate + Pad: show wired values instead of the widget's own
2026-11-26 11:48:36 -06:00
ausboss 94b1ab1def Edit Lock: say what is wrong when the VAE and model don't match
The readout blamed the VAE alone. It now says either file can be the
wrong one, gives the two channel counts it compared, and points to the
model and VAE in the workflow's notes.
2026-11-26 11:27:06 -06:00
ausboss f7fe1ceac8 Crop + Rotate + Pad: show wired values in the summary, fields and size readout
A setting wired from another node runs with the wired value, and a wired
value skips the input's range. A Float of 24 wired into Megapixels resized
to 24 MP while the card summary, the MP field and the size readout all
showed the widget's own 16.00 MP, which read as a 16 MP cap.

The summary, the face fields and the size readout now read feather, Align,
the resize switch, Megapixels and Step through the link: a typed number
shows as itself, and a calculated one says it comes from a link. Shared by
the image and both video Crop + Rotate + Pad nodes.
2026-11-26 11:23:11 -06:00
7 changed files with 302 additions and 17 deletions
+8
View File
@@ -2,6 +2,14 @@
All notable changes to ComfyUI-AusBoss are documented here.
## Unreleased
- **Edit Lock 🆎 says what is wrong when the VAE and model don't match.**
The readout used to blame the VAE alone. It now says either file can be
the wrong one, gives the two channel counts it compared, and points to
the model and VAE in the workflow's notes. A GGUF or other converted
model is a common cause.
## 2.28.1 - 2026-11-25
- **Image Resize 🆎 shows Fit only when it is used.** Fit, and Fill under
+2
View File
@@ -306,6 +306,8 @@ export const ZH = {
"Unlink strength": "断开强度连线", "link": "连线",
"Takes 1 off after each run. Tap for Random.": "每次运行后减 1。点一下改为随机。",
"The words come from the wire.": "文字来自连线。",
"from a link": "来自连线",
"Set by a link into this input. Remove the link to type a value here.": "由连到这个输入的连线设置。断开连线后可在此输入数值。",
"Tick to add with others": "勾选后与其他一起添加",
"Toggle this trigger word into the row's output": "把这个触发词加入或移出该行的输出",
"Trigger word separator": "触发词分隔符",
+63 -16
View File
@@ -6,6 +6,7 @@ import { hideInputsInDef, hideWidget } from "./widget_visibility.mjs";
import { mountTransformTrim } from "./transform_trim.mjs";
import { mountClipWindow } from "./clip_window.mjs";
import { clipOutputRate, inputNumber } from "./clip_rate.mjs";
import { wiredFieldText, wiredNumber, wiredResize, wiredSummaryParts, wiredSwitch } from "./transform_wired.mjs";
import { BRAND, chainCallback, keepDomWidgetWidthAuto, notifyAusbossChange, showToast } from "./index.mjs";
import { WIDGET_FRAME, fillNodeHeight, holdVueNodeMinWidth, holdVuePanelMinHeight } from "./panel_layout.mjs";
import { mediaViewQuery, unlistedMedia } from "./media_list.mjs";
@@ -191,6 +192,7 @@ function installStyles() {
.ausboss-transform-group-title{display:inline-flex;align-items:center;gap:6px;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}
.ausboss-transform-group-caret{display:inline-block;color:${BRAND};font-size:11px;transition:transform .14s ease}
.ausboss-transform-group.open .ausboss-transform-group-caret{transform:rotate(90deg)}
.ausboss-transform-wired{display:inline-flex;align-items:center;justify-content:flex-end;min-height:24px;padding:0 6px;border:1px dashed #3a5352;border-radius:5px;color:#8ca8a5;font:500 11px system-ui;font-variant-numeric:tabular-nums;white-space:nowrap;cursor:default}
.ausboss-transform-group-summary{display:inline-flex;align-items:center;gap:6px;min-width:0;color:#8ca8a5;font:500 11px system-ui;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ausboss-transform-group-swatch{flex:none;width:10px;height:10px;border:1px solid #555b63;border-radius:3px;box-sizing:border-box}
.ausboss-transform-group-meta{min-width:0;overflow:hidden;text-overflow:ellipsis}
@@ -632,16 +634,9 @@ export function transformGroupSummary(state) {
parts.push(`Custom ${ratioLabel(canvas.width, canvas.height)}`);
}
if (lockActive(state)) parts.push("held");
const feather = Math.round(Number(value(node, "feather", 0)) || 0);
if (feather > 0) parts.push(`feather ${feather} px`);
const multiple = Math.round(Number(value(node, "canvas_multiple", 1)) || 1);
if (multiple > 1) parts.push(`÷${multiple}`);
if (widget(node, "resize_to_megapixels") && value(node, "resize_to_megapixels", false)) {
const mp = Number(value(node, "megapixels", 1)) || 1;
const steps = Math.round(Number(value(node, "resolution_steps", 1)) || 1);
parts.push(`${mp.toFixed(2)} MP`);
if (steps > 1 && multiple <= 1) parts.push(`÷${steps}`);
}
// Feather, Align and the resize as the run uses them: a linked input runs
// with the wired value, not the widget's own (js/shared/transform_wired.mjs).
parts.push(...wiredSummaryParts(node));
return parts.join(" · ");
}
@@ -933,6 +928,13 @@ export function installTransformNode(node, kind, mountPanel = null) {
for (const trim of state.trimViews) trim.sync();
}
}
// A wired value changed upstream (a Float typed to 24): the summary,
// the face fields and the size readout follow it.
if (!state.disposed) {
const wired = JSON.stringify([wiredSummaryParts(node), wiredResize(node)]);
if (state.wiredKey !== undefined && wired !== state.wiredKey) queueMicrotask(() => { if (!state.disposed) draw(state); });
state.wiredKey = wired;
}
if (state.disposed || state.zoomRedraw || !panelBackingStale(state)) return;
state.zoomRedraw = requestAnimationFrame(() => { state.zoomRedraw = null; if (!state.disposed) draw(state); });
});
@@ -956,6 +958,7 @@ export function installTransformNode(node, kind, mountPanel = null) {
}
chainCallback(node, "onConnectionsChange", () => queueMicrotask(() => {
for (const trim of state.trimViews) trim.sync();
if (!state.disposed) draw(state);
}));
chainCallback(node, "onConfigure", () => queueMicrotask(() => {
if (state.disposed) return;
@@ -1514,6 +1517,12 @@ function buildCanvasRow(state) {
stepLabel.append(createElement("span", "", "Step"), steps.root);
const hasResize = Boolean(widget(node, "resize_to_megapixels"));
resizeRow.append(resizeLabel, budgetLabel, stepLabel);
const wired = [
wiredStandIn(node, "feather", feather, 0, (amount) => `${Math.round(amount)} px`),
wiredStandIn(node, "canvas_multiple", multiple, 1, (amount) => `${Math.round(amount)} px`),
wiredStandIn(node, "megapixels", budget, 1, (amount) => `${Number(amount).toFixed(2)} MP`),
wiredStandIn(node, "resolution_steps", steps, 1, (amount) => `${Math.round(amount)} px`),
];
const sync = () => {
fill.value = normalizeColor(value(node, "fill_color", "#808080"));
fill.title = `${fill.title.split(" Now ")[0]} Now ${fill.value}.`;
@@ -1523,7 +1532,9 @@ function buildCanvasRow(state) {
resize.sync();
budget.set(value(node, "megapixels", 1));
steps.set(value(node, "resolution_steps", 1));
const resizeOn = hasResize && Boolean(value(node, "resize_to_megapixels", false));
for (const standIn of wired) standIn();
const switched = wiredSwitch(node, "resize_to_megapixels", false);
const resizeOn = hasResize && (!switched.known || Boolean(switched.value));
resizeRow.style.display = hasResize ? "" : "none";
budgetLabel.style.display = resizeOn ? "" : "none";
stepLabel.style.display = resizeOn ? "" : "none";
@@ -1537,6 +1548,22 @@ function buildCanvasRow(state) {
return [alignRow, row, resizeRow];
}
// A linked setting runs with the wired value, so its number box gives way to
// that value (or "from a link" when only the run knows it). The box stays the
// way to set the widget's own value once the link is gone. Returns the sync.
function wiredStandIn(node, name, control, fallback, format) {
const text = createElement("span", "ausboss-transform-wired");
text.title = t("Set by a link into this input. Remove the link to type a value here.");
text.style.display = "none";
control.root.after(text);
return () => {
const shown = wiredFieldText(wiredNumber(node, name, fallback), format);
control.root.style.display = shown === null ? "" : "none";
text.style.display = shown === null ? "none" : "";
if (shown !== null) text.textContent = shown === "from a link" ? t("from a link") : shown;
};
}
// Resize as an off | on pill, on the node face and in the editor.
function resizeSwitch(state) {
const node = state.node;
@@ -1577,7 +1604,7 @@ function syncReadout(state) {
const source = rotatedSize(state.sourceWidth, state.sourceHeight, current.rotation_degrees);
const resize = resizeRequest(state.node);
const chain = sizeChain(current, source, resize);
const { tokens, warnings } = litTokens(state, sizeChainTokens(chain));
const { tokens, warnings } = readoutTokens(state, chain);
const prefix = createElement("span", "ausboss-transform-ellipsis");
tokens.forEach((token, index) => {
if (index) prefix.append(" → ");
@@ -2334,6 +2361,12 @@ function buildControls(state, sidebar) {
previewSection.append(finalPreview);
state.finalPreviewCanvas = finalPreview;
const editorWired = [
wiredStandIn(node, "feather", featherNumber, 24, (amount) => `${Math.round(amount)} px`),
wiredStandIn(node, "canvas_multiple", multiple, 1, (amount) => `${Math.round(amount)} px`),
...(budget ? [wiredStandIn(node, "megapixels", budget, 1, (amount) => `${Number(amount).toFixed(2)} MP`)] : []),
...(steps ? [wiredStandIn(node, "resolution_steps", steps, 1, (amount) => `${Math.round(amount)} px`)] : []),
];
sidebar.append(cropSection, rotateSection, padSection);
if (resizeSection) sidebar.append(resizeSection);
sidebar.append(actions, previewSection);
@@ -2343,6 +2376,7 @@ function buildControls(state, sidebar) {
featherNumber.set(value(node, "feather", 24));
multiple.set(value(node, "canvas_multiple", 1)); color.value = normalizeColor(value(node, "fill_color", "#808080"));
resize?.sync(); budget?.set(value(node, "megapixels", 1)); steps?.set(value(node, "resolution_steps", 1));
for (const standIn of editorWired) standIn();
if (more) more.value = extra.includes(liveRequest(state) ?? "") ? liveRequest(state) : "";
};
}
@@ -2891,10 +2925,23 @@ function drawScene(context, state, render, compact, interactive) {
context.restore();
}
// The resize the run makes, wired values included; null when it is off or a
// link decides a part of it that only the run knows (resizeFromLink).
function resizeRequest(node) {
return value(node, "resize_to_megapixels", false)
? { megapixels: value(node, "megapixels", 1), steps: value(node, "resolution_steps", 1) }
: null;
const resize = wiredResize(node);
return resize && !resize.unknown ? resize : null;
}
function resizeFromLink(node) {
return Boolean(wiredResize(node)?.unknown);
}
// The size chain's steps, ending on a resize a link decides when it does:
// the size it lands on is only known at run time.
function readoutTokens(state, chain) {
const result = litTokens(state, sizeChainTokens(chain));
if (resizeFromLink(state.node)) result.tokens = [...result.tokens, { label: "resize", text: "from a link" }];
return result;
}
// The size readout, drawn OUTSIDE the image: under the output rect, above
@@ -2905,7 +2952,7 @@ function resizeRequest(node) {
// amber line when the steps stretch the picture or the resize undoes Align.
const READOUT_LINE = 15;
function drawOutputSize(context, state, render) {
const { tokens } = litTokens(state, sizeChainTokens(sizeChain(values(state.node), render.source, resizeRequest(state.node))));
const { tokens } = readoutTokens(state, sizeChain(values(state.node), render.source, resizeRequest(state.node)));
// The amber line is the settled note, as on the face: it waits for the hand.
const warnings = shownNote(state).warnings;
const { outputRect } = render;
+94
View File
@@ -0,0 +1,94 @@
// What the Crop + Rotate + Pad nodes will really use for a setting that can
// be wired: a linked input runs with the wired value, not the widget's own.
// A wired value also skips the input's range (ComfyUI only range-checks typed
// values), so a Float of 24 wired into Megapixels resizes to 24 MP while the
// widget still holds 16.
//
// Only typed numbers are read across the wire (clip_rate.mjs inputNumber):
// a calculated value (Math Expression) stays unknown until the run, and the
// face says the value comes from a link instead of showing a wrong one.
//
// Pure: reads `inputs`, `widgets` and `graph`, so tests run it on plain
// objects.
import { inputNumber, linkOrigin } from "./clip_rate.mjs";
function widgetValue(node, name, fallback) {
return node?.widgets?.find((item) => item.name === name)?.value ?? fallback;
}
export function inputLinked(node, name) {
const slot = node?.inputs?.find((input) => input?.name === name || input?.widget?.name === name);
return slot?.link !== null && slot?.link !== undefined;
}
// { value, linked, known } for a number setting. Unlinked: the widget's
// value. Linked to a typed number: that number. Linked to anything else:
// value null, known false.
export function wiredNumber(node, name, fallback) {
const own = widgetValue(node, name, fallback);
if (!inputLinked(node, name)) return { value: own, linked: false, known: true };
const read = inputNumber(node, name, own);
return read === null ? { value: null, linked: true, known: false } : { value: read, linked: true, known: true };
}
const SWITCHES = ["PrimitiveBoolean"];
// The same for an on/off setting.
export function wiredSwitch(node, name, fallback) {
const own = Boolean(widgetValue(node, name, fallback));
if (!inputLinked(node, name)) return { value: own, linked: false, known: true };
const origin = linkOrigin(node, name);
const unknown = { value: null, linked: true, known: false };
if (!origin) return unknown;
const { node: source, slot } = origin;
let read;
if ((source.comfyClass ?? source.type) === "PrimitiveNode") read = source.widgets?.[0]?.value;
else if (SWITCHES.includes(source.type) && slot === 0
&& !source.inputs?.some((input) => input.name === "value" && input.link != null)) {
read = source.widgets?.find((item) => item.name === "value")?.value;
}
return typeof read === "boolean" ? { value: read, linked: true, known: true } : unknown;
}
// The resize the run makes: null when it is off, { megapixels, steps } when
// every part is known, { unknown: true } when a link decides a part of it.
export function wiredResize(node) {
if (!node?.widgets?.some((item) => item.name === "resize_to_megapixels")) return null;
const on = wiredSwitch(node, "resize_to_megapixels", false);
if (on.known && !on.value) return null;
const megapixels = wiredNumber(node, "megapixels", 1);
const steps = wiredNumber(node, "resolution_steps", 1);
if (!on.known || !megapixels.known || !steps.known) return { unknown: true };
return { megapixels: Number(megapixels.value) || 1, steps: Number(steps.value) || 1 };
}
// The end of the "Crop, pad & resize" summary: feather, Align, and the
// resize, each as the run will use it.
export function wiredSummaryParts(node) {
const parts = [];
const feather = wiredNumber(node, "feather", 0);
if (!feather.known) parts.push("feather from a link");
else if (Math.round(Number(feather.value) || 0) > 0) parts.push(`feather ${Math.round(Number(feather.value))} px`);
const multiple = wiredNumber(node, "canvas_multiple", 1);
const align = multiple.known ? Math.round(Number(multiple.value) || 1) : null;
if (align === null) parts.push("align from a link");
else if (align > 1) parts.push(`÷${align}`);
if (!node?.widgets?.some((item) => item.name === "resize_to_megapixels")) return parts;
const on = wiredSwitch(node, "resize_to_megapixels", false);
if (on.known && !on.value) return parts;
if (!on.known) parts.push("resize from a link");
const megapixels = wiredNumber(node, "megapixels", 1);
parts.push(megapixels.known ? `${(Number(megapixels.value) || 1).toFixed(2)} MP` : "MP from a link");
const steps = wiredNumber(node, "resolution_steps", 1);
if (!steps.known) parts.push("step from a link");
else if (Math.round(Number(steps.value) || 1) > 1 && align !== null && align <= 1) parts.push(`÷${Math.round(Number(steps.value))}`);
return parts;
}
// What a face field shows for a linked setting in place of its number box:
// the wired number, or that a link sets it.
export function wiredFieldText(reading, format) {
if (!reading.linked) return null;
return reading.known ? format(reading.value) : "from a link";
}
+10 -1
View File
@@ -285,6 +285,8 @@ class EditLock:
self.wide: float | None = None # share of the picture the lock would free, at the decision
self.top: float | None = None # the strongest spot then, in units of the quiet level
self.peak: float | None = None # and the strongest hundredth
self.vae_channels: int | None = None # when the VAE and model disagree: the picture's channels
self.model_channels: int | None = None # and the channels the model predicts
self._sigma: float | None = None
self._first = True
self._first_sigma = 1.0
@@ -328,6 +330,7 @@ class EditLock:
latent = self.latent[:, :, 0] if self.latent.ndim == 5 else self.latent
if latent.shape[1] != flat.shape[1]:
self.status = "vae"
self.vae_channels, self.model_channels = int(latent.shape[1]), int(flat.shape[1])
return pred
source = fit_latent(latent.to(device=flat.device, dtype=torch.float32), *flat.shape[-2:])
if source is None:
@@ -451,5 +454,11 @@ def describe(lock: EditLock) -> str:
if lock.status == "video":
return "Edit Lock did nothing: it works on single pictures, not video."
if lock.status == "vae":
return "Edit Lock did nothing: this VAE does not belong to this model."
counts = ""
if lock.vae_channels is not None and lock.model_channels is not None:
counts = (f" (your VAE makes {lock.vae_channels}-channel pictures, "
f"the model expects {lock.model_channels})")
return ("Edit Lock did nothing: the VAE and the diffusion model don't match"
f"{counts}. Either file can be the wrong one. Use the model and VAE listed "
"in the workflow's notes. A GGUF or other converted model is a common cause.")
return "Edit Lock has not run yet: plug its model output into the sampler."
+12
View File
@@ -279,6 +279,18 @@ class EditLockTests(unittest.TestCase):
lock.status = status
self.assertIn("did nothing", describe(lock))
def test_a_vae_and_model_that_do_not_match_say_both_counts(self):
source, other, redraw = latents()
pred = local_prediction(source, other, redraw)
lock = lock_for(source[:, :16].clone())
self.assertTrue(torch.equal(run(lock, pred), pred))
self.assertEqual(lock.status, "vae")
text = describe(lock)
self.assertIn("the VAE and the diffusion model don't match", text)
self.assertIn(f"your VAE makes 16-channel pictures, the model expects {pred.shape[1]}", text)
self.assertIn("workflow's notes", text)
self.assertIn("GGUF", text)
def test_a_grid_one_cell_off_still_locks(self):
source, other, redraw = latents(video=False)
lock = lock_for(torch.nn.functional.interpolate(source, size=(H + 2, W + 1), mode="bilinear"))
+113
View File
@@ -0,0 +1,113 @@
// A linked setting on the Crop + Rotate + Pad nodes runs with the wired value
// (js/shared/transform_wired.mjs). A Float of 24 wired into Megapixels
// resized to 24 MP while the card summary, the MP field and the size readout
// all said 16.00 MP, the widget's own value, and read as a 16 MP cap.
import assert from "node:assert/strict";
import fs from "node:fs";
import test from "node:test";
import { wiredFieldText, wiredNumber, wiredResize, wiredSummaryParts, wiredSwitch } from "../js/shared/transform_wired.mjs";
const WIDGETS = { feather: 24, canvas_multiple: 1, resize_to_megapixels: true, megapixels: 16, resolution_steps: 1 };
// A crop node whose inputs named in `wires` are linked to the given source
// nodes, as plain objects.
function cropNode(values = {}, wires = {}) {
const nodes = new Map();
const links = {};
const graph = { links, getNodeById: (id) => nodes.get(id) ?? null };
const merged = { ...WIDGETS, ...values };
const node = {
id: 1, graph,
widgets: Object.entries(merged).map(([name, value]) => ({ name, value })),
inputs: Object.keys(merged).map((name) => ({ name, widget: { name }, link: null })),
};
nodes.set(1, node);
let next = 10;
for (const [name, source] of Object.entries(wires)) {
const id = next++;
source.id = id;
source.mode ??= 0;
source.inputs ??= [];
nodes.set(id, source);
links[id] = { id, origin_id: id, origin_slot: 0, target_id: 1 };
node.inputs.find((input) => input.name === name).link = id;
}
return node;
}
const float = (value) => ({ type: "PrimitiveFloat", widgets: [{ name: "value", value }] });
const int = (value) => ({ type: "PrimitiveInt", widgets: [{ name: "value", value }] });
const math = () => ({ type: "AUSBOSS_NODES_MathExpression", widgets: [{ name: "expression", value: "a*2" }] });
test("unlinked settings read the widgets, as before", () => {
const node = cropNode();
assert.deepEqual(wiredNumber(node, "megapixels", 1), { value: 16, linked: false, known: true });
assert.deepEqual(wiredSummaryParts(node), ["feather 24 px", "16.00 MP"]);
assert.deepEqual(wiredResize(node), { megapixels: 16, steps: 1 });
assert.equal(wiredFieldText(wiredNumber(node, "megapixels", 1), (v) => `${v} MP`), null);
});
test("a typed number wired into Megapixels shows that number, past the 16 MP range", () => {
const node = cropNode({}, { megapixels: float(24) });
assert.deepEqual(wiredNumber(node, "megapixels", 1), { value: 24, linked: true, known: true });
assert.deepEqual(wiredSummaryParts(node), ["feather 24 px", "24.00 MP"]);
assert.deepEqual(wiredResize(node), { megapixels: 24, steps: 1 });
assert.equal(wiredFieldText(wiredNumber(node, "megapixels", 1), (v) => `${v.toFixed(2)} MP`), "24.00 MP");
});
test("a calculated value says it comes from a link instead of showing the widget's", () => {
const node = cropNode({}, { megapixels: math() });
assert.deepEqual(wiredNumber(node, "megapixels", 1), { value: null, linked: true, known: false });
assert.deepEqual(wiredSummaryParts(node), ["feather 24 px", "MP from a link"]);
assert.deepEqual(wiredResize(node), { unknown: true });
assert.equal(wiredFieldText(wiredNumber(node, "megapixels", 1), String), "from a link");
});
test("the other summary values follow their links too", () => {
const node = cropNode({ resolution_steps: 1 }, { feather: int(8), canvas_multiple: math(), resolution_steps: int(32) });
assert.deepEqual(wiredSummaryParts(node), ["feather 8 px", "align from a link", "16.00 MP"]);
const steps = cropNode({}, { resolution_steps: int(32) });
assert.deepEqual(wiredSummaryParts(steps), ["feather 24 px", "16.00 MP", "÷32"]);
assert.deepEqual(wiredSummaryParts(cropNode({}, { feather: math() })), ["feather from a link", "16.00 MP"]);
assert.deepEqual(wiredSummaryParts(cropNode({}, { resolution_steps: math() })), ["feather 24 px", "16.00 MP", "step from a link"]);
});
test("a wired resize switch decides whether the resize shows", () => {
const off = cropNode({}, { resize_to_megapixels: { type: "PrimitiveBoolean", widgets: [{ name: "value", value: false }] } });
assert.deepEqual(wiredSwitch(off, "resize_to_megapixels", false), { value: false, linked: true, known: true });
assert.deepEqual(wiredSummaryParts(off), ["feather 24 px"]);
assert.equal(wiredResize(off), null);
const typedOn = cropNode({ resize_to_megapixels: false }, { resize_to_megapixels: { type: "PrimitiveBoolean", widgets: [{ name: "value", value: true }] } });
assert.deepEqual(wiredResize(typedOn), { megapixels: 16, steps: 1 });
const unknown = cropNode({ resize_to_megapixels: false }, { resize_to_megapixels: math() });
assert.deepEqual(wiredSummaryParts(unknown), ["feather 24 px", "resize from a link", "16.00 MP"]);
assert.deepEqual(wiredResize(unknown), { unknown: true });
});
test("a muted source is unknown, not the widget's value", () => {
const source = float(24);
source.mode = 2;
const node = cropNode({}, { megapixels: source });
assert.deepEqual(wiredSummaryParts(node), ["feather 24 px", "MP from a link"]);
});
test("a node without the resize inputs (video) only gets feather and Align", () => {
const node = cropNode();
node.widgets = node.widgets.filter((item) => !["resize_to_megapixels", "megapixels", "resolution_steps"].includes(item.name));
assert.deepEqual(wiredSummaryParts(node), ["feather 24 px"]);
assert.equal(wiredResize(node), null);
});
test("the transform face reads the summary, the fields and the size readout through the wire", () => {
const source = fs.readFileSync(new URL("../js/shared/transform_editor.mjs", import.meta.url), "utf8");
const summary = source.slice(source.indexOf("export function transformGroupSummary"), source.indexOf("function buildTransformGroup"));
assert.match(summary, /wiredSummaryParts\(node\)/);
assert.doesNotMatch(summary, /value\(node, "megapixels"/);
const request = source.slice(source.indexOf("function resizeRequest"), source.indexOf("function resizeFromLink"));
assert.match(request, /wiredResize\(node\)/);
for (const name of ["feather", "canvas_multiple", "megapixels", "resolution_steps"]) {
assert.match(source, new RegExp(`wiredStandIn\\(node, "${name}"`), `${name} has no stand-in on the face`);
}
});