@node-ai/comfyui
Version:
node-ai for comfyui
95 lines (94 loc) • 3.53 kB
TypeScript
import { ComfyUIApiClient } from './comfyui.api.client';
import { ComfyClientConfig, EnqueuePromptOptions, WorkflowPrompt } from '../types';
export declare class ComfyUIHApiClient extends ComfyUIApiClient {
constructor(config?: ComfyClientConfig);
/**
* Retrieves the list of samplers from the node definitions.
*/
getSamplers(): Promise<string[]>;
/**
* Retrieves the list of schedulers from the node definitions.
*/
getSchedulers(): Promise<string[]>;
/**
* Retrieves the list of model names from the node definitions.
*/
getSDModels(): Promise<string[]>;
/**
* Retrieves the list of model names from the node definitions.
*/
getControlNetModels(): Promise<string[]>;
/**
* Retrieves the list of model names from the node definitions for the UpscaleModelLoader node.
*/
getUpscaleModels(): Promise<string[]>;
/**
* Retrieves the list of hypernetwork names from the node definitions.
*/
getHyperNetworks(): Promise<string[]>;
/**
* Retrieves the list of LoRAs from the node definitions.
*/
getLoRAs(): Promise<string[]>;
/**
* Retrieves the list of VAE names from the node definitions.
*/
getVAEs(): Promise<string[]>;
/**
* Retrieves the status of a prompt based on the provided prompt ID.
*
* @param prompt_id - The ID of the prompt to check status for.
* @return Object containing the running, pending, and done status of the prompt.
*/
getPromptStatus(prompt_id: string): Promise<{
running: boolean;
pending: boolean;
done: boolean;
}>;
/**
* Retrieves the outputs of a prompt with the given ID from the history.
*
* @param prompt_id - The ID of the prompt to retrieve the outputs for.
* @return A promise that resolves to the outputs of the prompt.
* @throws If the prompt with the given ID is not found in the history or if it failed with a non-"success" status.
*/
getPromptOutputs(prompt_id: string): Promise<import("../types").HistoryPromptOutputs>;
/**
* Retrieves the result of a prompt based on the provided prompt ID.
*
* @param prompt_id - The ID of the prompt to retrieve the result for.
* @return An object containing the images associated with the prompt and the prompt ID.
*/
getPromptImageResult(prompt_id: string): Promise<{
images: {
type: string;
data: string;
}[];
prompt_id: string;
}>;
/**
* Asynchronously waits for the prompt with the provided ID to be done.
*
* @param prompt_id - The ID of the prompt to wait for.
* @param [polling_ms=1000] - The number of milliseconds to wait between checks.
* @return
*/
waitForPrompt(prompt_id: string, polling_ms?: number): Promise<void>;
/**
* Asynchronously runs a prompt with the provided options.
*
* This function does not use WebSocket, but uses polling to get the result
* So if your workflow contains custom ws events, this function will not be able to get these events
*
* @param prompt - The prompt to run.
* @param options - The options for running the prompt.
* @return A promise that resolves with the prompt result.
*/
enqueue_polling(prompt: WorkflowPrompt, options?: EnqueuePromptOptions): Promise<{
images: {
type: string;
data: string;
}[];
prompt_id: string;
}>;
}