Add object_info schema (#67)

This commit is contained in:
Chenlei Hu
2024-06-30 10:14:16 -04:00
committed by GitHub
parent 5746b130bb
commit ee6788a35e
7 changed files with 128 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
import { HistoryTaskItem, PendingTaskItem, RunningTaskItem } from "/types/apiTypes";
import { HistoryTaskItem, PendingTaskItem, RunningTaskItem, ComfyNodeDef } from "/types/apiTypes";
interface QueuePromptRequestBody {
@@ -215,7 +215,7 @@ class ComfyApi extends EventTarget {
* Loads node object definitions for the graph
* @returns The node definitions
*/
async getNodeDefs() {
async getNodeDefs(): Promise<Record<string, ComfyNodeDef>> {
const resp = await this.fetchApi("/object_info", { cache: "no-store" });
return await resp.json();
}