Fix DUMAS V3.9 manual resolution UI
This commit is contained in:
+29
-1
@@ -3006,7 +3006,35 @@ function configureResolutionPresetWidgets(node) {
|
|||||||
const heightWidget = findWidget(node, HEIGHT_WIDGET);
|
const heightWidget = findWidget(node, HEIGHT_WIDGET);
|
||||||
const presetWidget = findWidget(node, RESOLUTION_PRESET_WIDGET);
|
const presetWidget = findWidget(node, RESOLUTION_PRESET_WIDGET);
|
||||||
const customMpWidget = findWidget(node, CUSTOM_MP_WIDGET);
|
const customMpWidget = findWidget(node, CUSTOM_MP_WIDGET);
|
||||||
if (!sizeSourceWidget || !widthWidget || !heightWidget) return;
|
if (!widthWidget || !heightWidget) return;
|
||||||
|
|
||||||
|
// DUMAS V3.9 deliberately exposes Manual width/height only. The upstream
|
||||||
|
// resolution-preset UI expects size_source to exist and previously
|
||||||
|
// returned here, leaving width/height without the normal linked-input
|
||||||
|
// state, tooltips, or connection refresh behavior.
|
||||||
|
if (!sizeSourceWidget && node.comfyClass === V39_NODE_CLASS) {
|
||||||
|
const refreshManual = () => {
|
||||||
|
widthWidget.disabled = linkedInput(node, [WIDTH_WIDGET]);
|
||||||
|
heightWidget.disabled = linkedInput(node, [HEIGHT_WIDGET]);
|
||||||
|
widthWidget.tooltip = "Manual output width. Must be aligned to 32 pixels.";
|
||||||
|
heightWidget.tooltip = "Manual output height. Must be aligned to 32 pixels.";
|
||||||
|
node.setDirtyCanvas?.(true, true);
|
||||||
|
};
|
||||||
|
attachRefresh(widthWidget, "__h3ContinuumManualWidthCallback", refreshManual);
|
||||||
|
attachRefresh(heightWidget, "__h3ContinuumManualHeightCallback", refreshManual);
|
||||||
|
if (!node.__h3ContinuumManualResolutionConnectionCallback) {
|
||||||
|
const previous = node.onConnectionsChange;
|
||||||
|
node.onConnectionsChange = function(...args) {
|
||||||
|
const result = previous?.apply(this, args);
|
||||||
|
setTimeout(refreshManual, 0);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
node.__h3ContinuumManualResolutionConnectionCallback = true;
|
||||||
|
}
|
||||||
|
refreshManual();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!sizeSourceWidget) return;
|
||||||
|
|
||||||
const roundCanvas = (value) => Math.max(
|
const roundCanvas = (value) => Math.max(
|
||||||
CANVAS_MULTIPLE,
|
CANVAS_MULTIPLE,
|
||||||
|
|||||||
Reference in New Issue
Block a user