From 75f5c08569bc7039f8ba01658c48e8fb4c1301e8 Mon Sep 17 00:00:00 2001 From: karurochari Date: Thu, 22 Aug 2024 15:48:32 +0000 Subject: [PATCH] v0.2.7 with update support for modern comfyui --- TODO.md | 7 ++++++- package.json | 2 +- src/comfy-client.ts | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index ed8fed4..cc0691a 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,9 @@ # Upcoming -## Needed for release 0.2.7 +## Needed for release 0.2.9 - [ ] Add tests for the workflow building +- [ ] Add tests for ts code gen from workflow - [ ] Better error handling when workflows fail (and related tests) ## Needed for release 0.3.x @@ -48,3 +49,7 @@ - [x] Add helper to convert a JSON workflow in its ts equivalent. - [x] Improve examples and the related documentation + +## Needed for release 0.2.7 + +- [x] Added support for `models/type` from updated comfy backends \ No newline at end of file diff --git a/package.json b/package.json index bdc7f5c..57c8883 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "module": "index.ts", "type": "module", "license": "BSD-3-Clause", - "version": "0.2.6", + "version": "0.2.7", "description": "Wrapper for the REST endpoints of a comfyui instance & some quality of life utils.", "author": { "name": "karurochari", diff --git a/src/comfy-client.ts b/src/comfy-client.ts index 65d423b..dcfbdb2 100644 --- a/src/comfy-client.ts +++ b/src/comfy-client.ts @@ -161,6 +161,7 @@ export class ComfyClient { /** * @returns Available embeddings from ComfyUI + * @deprecated This function has been de-facto replaced by models("embeddings") on modern comfy instances */ async embeddings() { return await ( @@ -173,6 +174,22 @@ export class ComfyClient { ).json() } + /** + * @returns Available embeddings from ComfyUI + * @deprecated This function has been de-facto replaced by models("embeddings") on modern comfy instances + */ + async models(type:string) { + return await ( + await fetch( + `http${this.#secure ? "s" : ""}://${this.#endpoint}/models/${type}?${new URLSearchParams({ + clientId: this.#uid, + }).toString()}`, + { method: "GET" }, + ) + ).json() + } + + /** * @returns Listing all extensions installed on a ComfyUI instance */