> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# ComfyUI Dialog API

> Nutzen Sie die Dialog API von ComfyUI für standardisierte Prompt- und Bestätigungsdialoge unter Desktop und Web, mit Beispielen und vollständiger API-Referenz.

Die Dialog API stellt standardisierte Dialoge bereit, die unter Desktop- und Webumgebungen konsistent funktionieren. Für Erweiterungsautoren sind die Methoden `prompt` und `confirm` besonders nützlich.

## Grundlegende Nutzung

### Prompt-Dialog

```javascript theme={null}
// Prompt-Dialog anzeigen
app.extensionManager.dialog.prompt({
  title: "User Input",
  message: "Please enter your name:",
  defaultValue: "User"
}).then(result => {
  if (result !== null) {
    console.log(`Input: ${result}`);
  }
});
```

### Bestätigungsdialog

```javascript theme={null}
// Bestätigungsdialog anzeigen
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");
});
```

## API-Referenz

### Prompt

```javascript theme={null}
app.extensionManager.dialog.prompt({
  title: string,             // Dialogtitel
  message: string,           // Anzuzeigende Nachricht/Frage
  defaultValue?: string      // Anfangswert im Eingabefeld (optional)
}).then((result: string | null) => {
  // result ist der eingegebene Text oder null, wenn abgebrochen wurde
});
```

### Bestätigen

```javascript theme={null}
app.extensionManager.dialog.confirm({
  title: string,             // Dialogtitel
  message: string,           // Anzuzeigende Nachricht
  type?: "default" | "overwrite" | "delete" | "dirtyClose" | "reinstall", // Dialogtyp (optional)
  itemList?: string[],       // Liste der anzuzeigenden Elemente (optional)
  hint?: string              // Anzuzeigender Hinweistext (optional)
}).then((result: boolean | null) => {
  // result ist true, wenn bestätigt, false, wenn abgelehnt, null, wenn abgebrochen
});
```

Für weitere spezialisierte Dialoge, die in ComfyUI verfügbar sind, können Erweiterungsautoren die Datei `dialogService.ts` im Quellcode heranziehen.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.