Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ComfyUI 탑바 메뉴에 커스텀 명령을 추가합니다. 기존 메뉴에 추가, 서브메뉴 생성, 한 명령을 여러 위치에 배치하는 방법을 포함합니다.
app.registerExtension({ name: "MyExtension", // 명령어 정의 commands: [ { id: "myCommand", label: "My Command", function: () => { alert("명령어 실행됨!"); } } ], // 메뉴에 명령어 추가 menuCommands: [ { path: ["Extensions", "My Extension"], commands: ["myCommand"] } ] });
id
label
function
{ id: string, // 명령어의 고유 식별자 label: string, // 명령어의 표시 이름 function: () => void // 명령어가 트리거될 때 실행할 함수 }
menuCommands
{ path: string[], // 메뉴 계층 구조를 나타내는 배열 commands: string[] // 이 위치에 추가할 명령어 ID 배열 }
path
["File", "Export"]
app.registerExtension({ name: "MenuExamples", commands: [ { id: "saveAsImage", label: "이미지로 저장", function: () => { // 캔버스를 이미지로 저장하는 코드 } }, { id: "exportWorkflow", label: "워크플로우 내보내기", function: () => { // 워크플로우를 내보내는 코드 } } ], menuCommands: [ // 파일 메뉴에 추가 { path: ["File"], commands: ["saveAsImage", "exportWorkflow"] } ] });
app.registerExtension({ name: "SubmenuExample", commands: [ { id: "option1", label: "옵션 1", function: () => { console.log("옵션 1"); } }, { id: "option2", label: "옵션 2", function: () => { console.log("옵션 2"); } }, { id: "suboption1", label: "하위 옵션 1", function: () => { console.log("하위 옵션 1"); } } ], menuCommands: [ // 중첩된 메뉴 구조 생성 { path: ["Extensions", "My Tools"], commands: ["option1", "option2"] }, { path: ["Extensions", "My Tools", "Advanced"], commands: ["suboption1"] } ] });
app.registerExtension({ name: "MultiLocationExample", commands: [ { id: "helpCommand", label: "도움말 받기", function: () => { window.open("https://docs.example.com", "_blank"); } } ], menuCommands: [ // 도움말 메뉴에 추가 { path: ["Help"], commands: ["helpCommand"] }, // 확장 프로그램 메뉴에도 추가 { path: ["Extensions"], commands: ["helpCommand"] } ] });
이 페이지가 도움이 되었나요?