Basic Usage
Prompt Dialog
Confirm Dialog
API Reference
Prompt
Confirm
dialogService.ts file in the source code.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use ComfyUI’s Dialog API for standardized prompt and confirm dialogs across desktop and web, with usage examples and full API reference.
// Show a prompt dialog
app.extensionManager.dialog.prompt({
title: "User Input",
message: "Please enter your name:",
defaultValue: "User"
}).then(result => {
if (result !== null) {
console.log(`Input: ${result}`);
}
});
// Show a confirmation dialog
app.extensionManager.dialog.confirm({
title: "Confirm Action",
message: "Are you sure you want to continue?",
type: "default"
}).then(result => {
console.log(result ? "User confirmed" : "User cancelled");
});
app.extensionManager.dialog.prompt({
title: string, // Dialog title
message: string, // Message/question to display
defaultValue?: string // Initial value in the input field (optional)
}).then((result: string | null) => {
// result is the entered text, or null if cancelled
});
app.extensionManager.dialog.confirm({
title: string, // Dialog title
message: string, // Message to display
type?: "default" | "overwrite" | "delete" | "dirtyClose" | "reinstall", // Dialog type (optional)
itemList?: string[], // List of items to display (optional)
hint?: string // Hint text to display (optional)
}).then((result: boolean | null) => {
// result is true if confirmed, false if denied, null if cancelled
});
dialogService.ts file in the source code.Was this page helpful?