기본 사용법
프롬프트 대화
확인 대화
API 참조
프롬프트
확인
dialogService.ts 파일을 참고할 수 있습니다.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
데스크톱과 웹에서 표준화된 prompt/confirm 대화 상자를 제공하는 ComfyUI Dialog API. 사용 예제와 전체 API 레퍼런스를 포함합니다.
// 프롬프트 대화 표시
app.extensionManager.dialog.prompt({
title: "사용자 입력",
message: "이름을 입력해 주세요:",
defaultValue: "사용자"
}).then(result => {
if (result !== null) {
console.log(`입력: ${result}`);
}
});
// 확인 대화 표시
app.extensionManager.dialog.confirm({
title: "작업 확인",
message: "계속하시겠습니까?",
type: "default"
}).then(result => {
console.log(result ? "사용자가 확인함" : "사용자가 취소함");
});
app.extensionManager.dialog.prompt({
title: string, // 대화 제목
message: string, // 표시할 메시지/질문
defaultValue?: string // 입력란의 초기 값 (옵션)
}).then((result: string | null) => {
// result는 입력한 텍스트이며, 취소 시 null입니다
});
app.extensionManager.dialog.confirm({
title: string, // 대화 제목
message: string, // 표시할 메시지
type?: "default" | "overwrite" | "delete" | "dirtyClose" | "reinstall", // 대화 유형 (옵션)
itemList?: string[], // 표시할 항목 목록 (옵션)
hint?: string // 표시할 힌트 텍스트 (옵션)
}).then((result: boolean | null) => {
// result는 확인 시 참, 거부 시 거짓, 취소 시 null입니다
});
dialogService.ts 파일을 참고할 수 있습니다.