Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Has been cancelled
Execution Tests / test (macos-latest) (push) Has been cancelled
Execution Tests / test (ubuntu-latest) (push) Has been cancelled
Execution Tests / test (windows-latest) (push) Has been cancelled
Test server launches without errors / test (push) Has been cancelled
Unit Tests / test (macos-latest) (push) Has been cancelled
Unit Tests / test (ubuntu-latest) (push) Has been cancelled
Unit Tests / test (windows-2022) (push) Has been cancelled
Includes 30 custom nodes committed directly, 7 Civitai-exclusive loras stored via Git LFS, and a setup script that installs all dependencies and downloads HuggingFace-hosted models on vast.ai. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
1.9 KiB
JavaScript
56 lines
1.9 KiB
JavaScript
import { app } from "../../scripts/app.js";
|
|
import { rgthreeApi } from "../../rgthree/common/rgthree_api.js";
|
|
const PASS_THROUGH = function (item) {
|
|
return item;
|
|
};
|
|
export async function showLoraChooser(event, callback, parentMenu, loras) {
|
|
var _a, _b;
|
|
const canvas = app.canvas;
|
|
if (!loras) {
|
|
loras = ["None", ...(await rgthreeApi.getLoras().then((loras) => loras.map((l) => l.file)))];
|
|
}
|
|
new LiteGraph.ContextMenu(loras, {
|
|
event: event,
|
|
parentMenu: parentMenu != null ? parentMenu : undefined,
|
|
title: "Choose a lora",
|
|
scale: Math.max(1, (_b = (_a = canvas.ds) === null || _a === void 0 ? void 0 : _a.scale) !== null && _b !== void 0 ? _b : 1),
|
|
className: "dark",
|
|
callback,
|
|
});
|
|
}
|
|
export function showNodesChooser(event, mapFn, callback, parentMenu) {
|
|
var _a, _b;
|
|
const canvas = app.canvas;
|
|
const nodesOptions = app.graph._nodes
|
|
.map(mapFn)
|
|
.filter((e) => e != null);
|
|
nodesOptions.sort((a, b) => {
|
|
return a.value - b.value;
|
|
});
|
|
new LiteGraph.ContextMenu(nodesOptions, {
|
|
event: event,
|
|
parentMenu,
|
|
title: "Choose a node id",
|
|
scale: Math.max(1, (_b = (_a = canvas.ds) === null || _a === void 0 ? void 0 : _a.scale) !== null && _b !== void 0 ? _b : 1),
|
|
className: "dark",
|
|
callback,
|
|
});
|
|
}
|
|
export function showWidgetsChooser(event, node, mapFn, callback, parentMenu) {
|
|
var _a, _b;
|
|
const options = (node.widgets || [])
|
|
.map(mapFn)
|
|
.filter((e) => e != null);
|
|
if (options.length) {
|
|
const canvas = app.canvas;
|
|
new LiteGraph.ContextMenu(options, {
|
|
event,
|
|
parentMenu,
|
|
title: "Choose an input/widget",
|
|
scale: Math.max(1, (_b = (_a = canvas.ds) === null || _a === void 0 ? void 0 : _a.scale) !== null && _b !== void 0 ? _b : 1),
|
|
className: "dark",
|
|
callback,
|
|
});
|
|
}
|
|
}
|