Ai
1 Star 0 Fork 1

ComfyUI CustomNodes Clone/ComfyUI-Custom-Scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
linkRenderMode.js 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
import { app } from "../../../scripts/app.js";
import { $el } from "../../../scripts/ui.js";
const id = "pysssss.LinkRenderMode";
const ext = {
name: id,
async setup(app) {
if (app.extensions.find((ext) => ext.name === "Comfy.LinkRenderMode")) {
console.log("%c[🐍 pysssss]", "color: limegreen", "Skipping LinkRenderMode as core extension found");
return;
}
const setting = app.ui.settings.addSetting({
id,
name: "🐍 Link Render Mode",
defaultValue: 2,
type: () => {
return $el("tr", [
$el("td", [
$el("label", {
for: id.replaceAll(".", "-"),
textContent: "🐍 Link Render Mode:",
}),
]),
$el("td", [
$el(
"select",
{
textContent: "Manage",
style: {
fontSize: "14px",
},
oninput: (e) => {
setting.value = e.target.value;
app.canvas.links_render_mode = +e.target.value;
app.graph.setDirtyCanvas(true, true);
},
},
LiteGraph.LINK_RENDER_MODES.map((m, i) =>
$el("option", {
value: i,
textContent: m,
selected: i == app.canvas.links_render_mode,
})
)
),
]),
]);
},
onChange(value) {
app.canvas.links_render_mode = +value;
app.graph.setDirtyCanvas(true);
},
});
},
};
app.registerExtension(ext);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/custom_nodes_clone/ComfyUI-Custom-Scripts.git
git@gitee.com:custom_nodes_clone/ComfyUI-Custom-Scripts.git
custom_nodes_clone
ComfyUI-Custom-Scripts
ComfyUI-Custom-Scripts
main

搜索帮助