comfy-ts 2.20.2 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- package/dist/{ServeApp-B469W26E.js → ServeApp-ByMobrWW.js} +3 -3
- package/dist/{ServeApp-B469W26E.js.map → ServeApp-ByMobrWW.js.map} +1 -1
- package/dist/cli.js +5 -5
- package/dist/{exampleAssets-yBLaKXLq.js → exampleAssets-B5sMqNia.js} +58 -3
- package/dist/exampleAssets-B5sMqNia.js.map +1 -0
- package/dist/{findDefinedWorkflow-B90-xFxX.js → findDefinedWorkflow-BNZgYIww.js} +2 -2
- package/dist/{findDefinedWorkflow-B90-xFxX.js.map → findDefinedWorkflow-BNZgYIww.js.map} +1 -1
- package/dist/index.cjs +87 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +87 -19
- package/dist/index.js.map +1 -1
- package/dist/{run-run-C-dDD9Dc.js → run-run-CuBSygku.js} +5 -5
- package/dist/{run-run-C-dDD9Dc.js.map → run-run-CuBSygku.js.map} +1 -1
- package/dist/{run-serve-CsEYPGm9.js → run-serve-COk_G0Qz.js} +4 -4
- package/dist/{run-serve-CsEYPGm9.js.map → run-serve-COk_G0Qz.js.map} +1 -1
- package/dist/{run-tui-bsmja4hi.js → run-tui-CB6i_x2y.js} +4 -4
- package/dist/{run-tui-bsmja4hi.js.map → run-tui-CB6i_x2y.js.map} +1 -1
- package/dist/{schemaDrift-DaWsE-mt.js → schemaDrift-CHDVYlaj.js} +32 -19
- package/dist/{schemaDrift-DaWsE-mt.js.map → schemaDrift-CHDVYlaj.js.map} +1 -1
- package/dist/web.d.ts +19 -3
- package/dist/web.js +87 -19
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
- package/src/host/ComfyHost.ts +21 -0
- package/src/host/leastBusy.ts +37 -0
- package/src/state.ts +6 -0
- package/src/vars/DefinedWorkflow.ts +38 -21
- package/dist/exampleAssets-yBLaKXLq.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
<a href="https://youtu.be/eniEaCp_NS4"><img src="https://raw.githubusercontent.com/rvion/comfy-ts/main/trailer/comfy-ts/thumbnail.jpg" alt="The comfy-ts trailer on YouTube, 1:39" width="640"></a>
|
|
6
6
|
|
|
7
|
-
[](https://github.com/rvion/comfy-ts/actions/workflows/ci.yml) [](https://www.npmjs.com/package/comfy-ts) [](https://www.npmjs.com/package/comfy-ts) [](https://github.com/rvion/comfy-ts/releases) [](https://www.npmjs.com/package/comfy-ts) [](https://github.com/rvion/comfy-ts/blob/main/LICENSE) [](https://github.com/sponsors/rvion)
|
|
7
|
+
[](https://github.com/rvion/comfy-ts/actions/workflows/ci.yml) [](https://www.npmjs.com/package/comfy-ts) [](https://www.npmjs.com/package/comfy-ts) [](https://github.com/rvion/comfy-ts/releases) [](https://www.npmjs.com/package/comfy-ts) [](https://github.com/rvion/comfy-ts/blob/main/LICENSE) [](https://github.com/sponsors/rvion) [](https://discord.gg/GfAN6hF2ad)
|
|
8
8
|
|
|
9
9
|
Write ComfyUI workflows in TypeScript, then run them from code, one command, a terminal, a browser or an agent. Types come from your own ComfyUI: every node and model it has autocompletes, and a wrong graph is a compile error. Run on your GPU, another machine or Comfy Cloud, and get the images, audio and video back in your code or as files. 73 ready workflows cover 43 model families, from SDXL to Wan video and ACE-Step songs.
|
|
10
10
|
|
|
11
|
+
💬 Questions, help, or something you made with it: come say hi on [the Discord](https://discord.gg/GfAN6hF2ad).
|
|
12
|
+
|
|
11
13
|
| you want to | start here |
|
|
12
14
|
| --- | --- |
|
|
13
15
|
| build and run workflows in code, typed down to the model names of your exact machine | [the SDK](#-the-sdk-workflows-as-code), [the codegen](#-the-codegen-an-sdk-for-your-own-install) |
|
|
@@ -438,6 +440,19 @@ Reaching a Comfy that runs on another one of your machines:
|
|
|
438
440
|
- **tailscale**: `tailscale serve 8188` on the box gives a stable https url for `url:`. Plain tailnet hostnames work with `host:` too.
|
|
439
441
|
- **cloudflared**: `cloudflared tunnel --url http://127.0.0.1:8188` prints a temporary public https url. Paste it into `url:`.
|
|
440
442
|
|
|
443
|
+
Several GPUs: `comfy.leastBusy` returns the host with the shortest queue, and `run({ host })` runs the workflow there.
|
|
444
|
+
|
|
445
|
+
```ts
|
|
446
|
+
const gpus = [comfy.host({ id: 'gpu-1' }), comfy.host({ id: 'gpu-2' })]
|
|
447
|
+
const runs = prompts.map(async (prompt) => {
|
|
448
|
+
txt2img.vars.prompt.value = prompt
|
|
449
|
+
return txt2img.run({ host: await comfy.leastBusy(gpus) })
|
|
450
|
+
})
|
|
451
|
+
await Promise.all(runs)
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
It counts the jobs in each server's queue, from every client, and the runs this process started that the server has not seen yet, so runs started together spread over the hosts. A host that does not answer is skipped. The graph is built against the host it runs on: a model that host does not have fails the run with ComfyUI's own error.
|
|
455
|
+
|
|
441
456
|
## 🔌 Custom nodes and models: ComfyUI-Manager
|
|
442
457
|
|
|
443
458
|
The whole ComfyUI-Manager registry is mirrored into generated types: every known custom node pack, plugin title and model is a typed union. The generated files are committed, browsable TypeScript:
|
|
@@ -566,6 +581,7 @@ One folder of local state per consumer repo: `hosts/` (schema dumps, the generat
|
|
|
566
581
|
| serve web panel: every var as a control, queue, gallery, phone | ✅ |
|
|
567
582
|
| prompt refiner in the panel (OpenRouter or local Open WebUI) | ✅ |
|
|
568
583
|
| cloud hosts: `url` + `X-API-Key` auth, Comfy Cloud ran live | ✅ |
|
|
584
|
+
| several GPUs: `comfy.leastBusy(hosts)` picks the shortest queue | 🔶 |
|
|
569
585
|
| ComfyUI-Manager registry mirror + Known\* ecosystem unions | ✅ |
|
|
570
586
|
| install custom nodes / models through the ComfyUI-Manager queue (V3.x, 4.x) | 🔶 |
|
|
571
587
|
| content-addressed local asset cache | 🔶 |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DEFAULT_MEDIA_EXTENSIONS, A as reloadLoraInfoCache, B as lmFileSize, C as getLoraTriggers, E as lorasMissingFromMirror, F as fetchLoraList, G as lmTags, I as fetchLoraPreviewBytes, J as loraKey, L as lmBaseModel, M as fetchLoraCivitai, N as fetchLoraDescription, O as recordCivitaiMiss, P as fetchLoraExampleImages, R as lmCivitai, S as getLoraTriggerWords, T as loraMirrorEntries, U as lmNotes, V as lmFolder, W as lmSha256, X as ansi, Y as loraPreviewMapFrom, _ as buildLoraMirror, b as getLoraInfo, c as isLoraLanes, d as isLoraStrength, et as MEDIA_KINDS, ht as extractErrorMessage, i as summarizeDrift, j as writeLoraMirror, k as refreshLoraInfoCacheIfChanged, l as isLorasInput, mt as sha1HexOfString, ot as bang, p as getLoraKeyword, pt as statelessRegex, r as driftChanged, u as isPromptInput, v as getLoraAddedAt, x as getLoraPreviewUrl, y as getLoraDisplayName, z as lmFilePath } from "./schemaDrift-
|
|
2
|
-
import { d as isDraftMetaKey, l as assembleLogChunks, o as draftsDirForFile, s as listDraftsForFile, u as ENHANCE_KEY } from "./findDefinedWorkflow-
|
|
1
|
+
import { $ as DEFAULT_MEDIA_EXTENSIONS, A as reloadLoraInfoCache, B as lmFileSize, C as getLoraTriggers, E as lorasMissingFromMirror, F as fetchLoraList, G as lmTags, I as fetchLoraPreviewBytes, J as loraKey, L as lmBaseModel, M as fetchLoraCivitai, N as fetchLoraDescription, O as recordCivitaiMiss, P as fetchLoraExampleImages, R as lmCivitai, S as getLoraTriggerWords, T as loraMirrorEntries, U as lmNotes, V as lmFolder, W as lmSha256, X as ansi, Y as loraPreviewMapFrom, _ as buildLoraMirror, b as getLoraInfo, c as isLoraLanes, d as isLoraStrength, et as MEDIA_KINDS, ht as extractErrorMessage, i as summarizeDrift, j as writeLoraMirror, k as refreshLoraInfoCacheIfChanged, l as isLorasInput, mt as sha1HexOfString, ot as bang, p as getLoraKeyword, pt as statelessRegex, r as driftChanged, u as isPromptInput, v as getLoraAddedAt, x as getLoraPreviewUrl, y as getLoraDisplayName, z as lmFilePath } from "./schemaDrift-CHDVYlaj.js";
|
|
2
|
+
import { d as isDraftMetaKey, l as assembleLogChunks, o as draftsDirForFile, s as listDraftsForFile, u as ENHANCE_KEY } from "./findDefinedWorkflow-BNZgYIww.js";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -2517,4 +2517,4 @@ var ServeApp = class {
|
|
|
2517
2517
|
//#endregion
|
|
2518
2518
|
export { describeVar as n, renderDescriptorLine as r, ServeApp as t };
|
|
2519
2519
|
|
|
2520
|
-
//# sourceMappingURL=ServeApp-
|
|
2520
|
+
//# sourceMappingURL=ServeApp-ByMobrWW.js.map
|