comfy-ts 0.2.0 → 0.3.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/LICENSE +21 -0
- package/README.md +363 -0
- package/dist/cli.js +764 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +4128 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +9862 -0
- package/dist/index.d.ts +9846 -58
- package/dist/index.js +4049 -2
- package/dist/index.js.map +1 -1
- package/dist/log-CdfgILde.js +10 -0
- package/dist/log-CdfgILde.js.map +1 -0
- package/dist/run-tui-Io8Xea0L.js +3340 -0
- package/dist/run-tui-Io8Xea0L.js.map +1 -0
- package/package.json +104 -75
- package/src/cli/comfy-ts-cli.ts +36 -0
- package/src/cli/gen.ts +47 -0
- package/src/cli/outline.ts +82 -0
- package/src/cli/tui/components/DraftsOverlay.tsx +44 -0
- package/src/cli/tui/components/EditField.tsx +27 -0
- package/src/cli/tui/components/Header.tsx +51 -0
- package/src/cli/tui/components/HostPanel.tsx +37 -0
- package/src/cli/tui/components/LorasOverlay.tsx +49 -0
- package/src/cli/tui/components/OverlayList.tsx +25 -0
- package/src/cli/tui/components/PickerOverlays.tsx +66 -0
- package/src/cli/tui/components/PreviewPanel.tsx +33 -0
- package/src/cli/tui/components/PromptOverlay.tsx +16 -0
- package/src/cli/tui/components/StatusBar.tsx +165 -0
- package/src/cli/tui/components/TextOverlay.tsx +72 -0
- package/src/cli/tui/components/TreePanel.tsx +51 -0
- package/src/cli/tui/components/TuiApp.tsx +223 -0
- package/src/cli/tui/components/VarsPanel.tsx +86 -0
- package/src/cli/tui/findDefinedWorkflow.ts +16 -0
- package/src/cli/tui/keys.ts +20 -0
- package/src/cli/tui/protocolImagePainter.ts +59 -0
- package/src/cli/tui/run-tui.tsx +73 -0
- package/src/cli/tui/state/DraftsSt.ts +273 -0
- package/src/cli/tui/state/EditorSt.ts +289 -0
- package/src/cli/tui/state/ExecSt.ts +170 -0
- package/src/cli/tui/state/HostSt.ts +107 -0
- package/src/cli/tui/state/LorasSt.ts +185 -0
- package/src/cli/tui/state/PickerSt.ts +112 -0
- package/src/cli/tui/state/PreviewSt.ts +138 -0
- package/src/cli/tui/state/QueueSt.ts +59 -0
- package/src/cli/tui/state/SettingsSt.ts +73 -0
- package/src/cli/tui/state/TreeSt.ts +122 -0
- package/src/cli/tui/state/TuiSt.ts +169 -0
- package/src/cli/tui/state/WorkflowsSt.ts +92 -0
- package/src/cli/tui-env.ts +8 -0
- package/src/errors/InvalidPromptError.ts +12 -0
- package/src/graph/ComfyNode.ts +403 -0
- package/src/graph/ComfyNodeID.ts +28 -0
- package/src/graph/ComfyNodeOutput.ts +16 -0
- package/src/graph/NodeSlotSize.ts +4 -0
- package/src/graph/autoValue.ts +17 -0
- package/src/host/ComfyHost.ts +646 -0
- package/src/host/ComfyInstallType.ts +15 -0
- package/src/host/ComfyManager.ts +232 -0
- package/src/host/ComfyUploader.ts +110 -0
- package/src/host/ComfyWorkflowBuilder.ts +60 -0
- package/src/host/Requirements.ts +55 -0
- package/src/host/ResilientWebsocket.ts +147 -0
- package/src/host/loraManagerApi.ts +98 -0
- package/src/image-utils/_getPngMetadata.ts +53 -0
- package/src/image-utils/_getWebpMetadata.ts +38 -0
- package/src/image-utils/_parseExifData.ts +53 -0
- package/src/index.ts +89 -0
- package/src/litegraph/LiteGraphGroup.ts +22 -0
- package/src/litegraph/LiteGraphJSON.ts +46 -0
- package/src/litegraph/LiteGraphLink.ts +23 -0
- package/src/litegraph/LiteGraphLinkID.ts +6 -0
- package/src/litegraph/LiteGraphNode.ts +69 -0
- package/src/litegraph/LiteGraphNodeInput.ts +27 -0
- package/src/litegraph/LiteGraphNodeOutput.ts +23 -0
- package/src/litegraph/LiteGraphSlotIndex.ts +6 -0
- package/src/litegraph/convertFlowToLiteGraphJSON.ts +114 -0
- package/src/manager/ComfyRegistry.ts +124 -0
- package/src/manager/generated/KnownComfyCustomNodeName.ts +19280 -0
- package/src/manager/generated/KnownComfyPluginTitle.ts +5130 -0
- package/src/manager/generated/KnownComfyPluginURL.ts +2589 -0
- package/src/manager/generated/KnownModel_Base.ts +126 -0
- package/src/manager/generated/KnownModel_FileName.ts +2287 -0
- package/src/manager/generated/KnownModel_Name.ts +2287 -0
- package/src/manager/generated/KnownModel_SavePath.ts +263 -0
- package/src/manager/generated/KnownModel_Type.ts +97 -0
- package/src/manager/json/alter-list.json +224 -0
- package/src/manager/json/custom-node-list.extra.ts +13 -0
- package/src/manager/json/custom-node-list.json +21948 -0
- package/src/manager/json/extension-node-map.json +31282 -0
- package/src/manager/json/github-stats.json +12602 -0
- package/src/manager/json/model-list.extra.ts +26 -0
- package/src/manager/json/model-list.json +5052 -0
- package/src/manager/loaders/step1_downloadComfyManagerJSONs.ts +56 -0
- package/src/manager/loaders/step2_custom-node-list-loader.ts +149 -0
- package/src/manager/loaders/step3_extension-node-map-loader.ts +189 -0
- package/src/manager/loaders/step4_model-list-loader.ts +159 -0
- package/src/manager/script-update-manager.bun.ts +18 -0
- package/src/manager/types/ComfyManagerAPIFetchPolicy.ts +9 -0
- package/src/manager/types/ComfyManagerAPIModelList.ts +10 -0
- package/src/manager/types/ComfyManagerAPIPluginList.ts +11 -0
- package/src/manager/types/ComfyManagerFileModelInfo.ts +5 -0
- package/src/manager/types/ComfyManagerFilePluginContent.ts +13 -0
- package/src/manager/types/ComfyManagerFilePluginList.ts +5 -0
- package/src/manager/types/ComfyManagerModelInfo.ts +18 -0
- package/src/manager/types/ComfyManagerPluginContentMetadata.ts +16 -0
- package/src/manager/types/ComfyManagerPluginEnums.ts +8 -0
- package/src/manager/types/ComfyManagerPluginInfo.ts +50 -0
- package/src/runner/ComfyExecution.ts +301 -0
- package/src/runner/ComfyExecutionStatus.ts +2 -0
- package/src/runner/ComfyWorkflow.ts +395 -0
- package/src/runner/ComfyWorkflowLayout.ts +96 -0
- package/src/runner/ComfyWsApi.ts +159 -0
- package/src/runner/MediaImage.ts +262 -0
- package/src/sdk-generator/ComfyNodeSchema.ts +79 -0
- package/src/sdk-generator/ComfySchema.ts +369 -0
- package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +95 -0
- package/src/sdk-generator/Primitives.ts +76 -0
- package/src/sdk-generator/_getUnionNameBasedOnFirstFoundEnumName.ts +39 -0
- package/src/sdk-generator/_pythonModuleToNamespace.ts +27 -0
- package/src/sdk-generator/_toQualifiedNodeKey.ts +5 -0
- package/src/sdk-generator/comfy-api-json.ts +16 -0
- package/src/sdk-generator/comfyui-sdk-codegen.ts +287 -0
- package/src/sdk-generator/comfyui-types.ts +56 -0
- package/src/sdk-generator/litegraphToApiRequestPayload.ts +157 -0
- package/src/ssh-host-manager/ssh-config-manager.ts +89 -0
- package/src/ssh-host-manager/ssh-config.windows.md +32 -0
- package/src/ssh-host-manager/ssh-manager.ts +129 -0
- package/src/state.ts +136 -0
- package/src/types/comfy-sdk.ts +106 -0
- package/src/types/index.ts +55 -0
- package/src/utils/CodeBuffer.ts +61 -0
- package/src/utils/ComfyColors.ts +38 -0
- package/src/utils/ansi.ts +26 -0
- package/src/utils/ansiImage.ts +36 -0
- package/src/utils/bang.ts +39 -0
- package/src/utils/deepCopyNaive.ts +1 -0
- package/src/utils/downloadFile.ts +77 -0
- package/src/utils/escapeJSKey.ts +32 -0
- package/src/utils/exhaust.ts +4 -0
- package/src/utils/extractErrorMessage.ts +11 -0
- package/src/utils/fuzzyMatch.ts +8 -0
- package/src/utils/githubRegexes.ts +2 -0
- package/src/utils/hashArrayBuffer.ts +6 -0
- package/src/utils/log.ts +9 -0
- package/src/utils/loraTag.ts +10 -0
- package/src/utils/printArkResultInConsole.ts +16 -0
- package/src/utils/softValidate.ts +8 -0
- package/src/utils/stringifyReadable.ts +32 -0
- package/src/utils/toposort.ts +59 -0
- package/src/utils/tryExtracting.ts +41 -0
- package/src/utils/writeFile.ts +16 -0
- package/src/vars/ComfyVars.ts +531 -0
- package/src/vars/DefinedWorkflow.ts +112 -0
- package/src/vars/loraKeywords.ts +56 -0
- package/dist/index.d.mts +0 -74
- package/dist/index.mjs +0 -3
- package/dist/index.mjs.map +0 -1
- package/readme.md +0 -40
package/dist/index.d.mts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration options for the Calculator
|
|
3
|
-
*/
|
|
4
|
-
interface CalculatorOptions {
|
|
5
|
-
/** Precision for decimal calculations */
|
|
6
|
-
precision?: number;
|
|
7
|
-
/** Whether to throw errors on invalid operations */
|
|
8
|
-
strict?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Supported mathematical operations
|
|
12
|
-
*/
|
|
13
|
-
type MathOperation = "add" | "subtract" | "multiply" | "divide";
|
|
14
|
-
/**
|
|
15
|
-
* Result of a mathematical operation
|
|
16
|
-
*/
|
|
17
|
-
interface CalculationResult {
|
|
18
|
-
/** The computed value */
|
|
19
|
-
value: number;
|
|
20
|
-
/** The operation that was performed */
|
|
21
|
-
operation: MathOperation;
|
|
22
|
-
/** Input operands */
|
|
23
|
-
operands: readonly number[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* A simple calculator class demonstrating TypeScript library patterns
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const calc = new Calculator({ precision: 2 })
|
|
32
|
-
* const result = calc.add(1, 2)
|
|
33
|
-
* console.log(result.value) // 3
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
declare class Calculator {
|
|
37
|
-
private readonly options;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a new Calculator instance
|
|
40
|
-
* @param options - Configuration options
|
|
41
|
-
*/
|
|
42
|
-
constructor(options?: CalculatorOptions);
|
|
43
|
-
/**
|
|
44
|
-
* Adds two or more numbers
|
|
45
|
-
* @param operands - Numbers to add
|
|
46
|
-
* @returns Calculation result
|
|
47
|
-
* @throws Error when no operands provided and strict mode is enabled
|
|
48
|
-
*/
|
|
49
|
-
add(...operands: number[]): CalculationResult;
|
|
50
|
-
/**
|
|
51
|
-
* Subtracts numbers from the first operand
|
|
52
|
-
* @param first - Initial value
|
|
53
|
-
* @param rest - Numbers to subtract
|
|
54
|
-
* @returns Calculation result
|
|
55
|
-
*/
|
|
56
|
-
subtract(first: number, ...rest: number[]): CalculationResult;
|
|
57
|
-
private roundToPrecision;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Formats a number as currency
|
|
62
|
-
* @param amount - The amount to format
|
|
63
|
-
* @param currency - Currency code (default: 'USD')
|
|
64
|
-
* @returns Formatted currency string
|
|
65
|
-
*/
|
|
66
|
-
declare function formatCurrency(amount: number, currency?: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* Validates an email address using a simple regex
|
|
69
|
-
* @param email - Email to validate
|
|
70
|
-
* @returns True if email appears valid
|
|
71
|
-
*/
|
|
72
|
-
declare function validateEmail(email: string): boolean;
|
|
73
|
-
|
|
74
|
-
export { type CalculationResult, Calculator, type CalculatorOptions, type MathOperation, Calculator as default, formatCurrency, validateEmail };
|
package/dist/index.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
var e=class{options;constructor(r={}){this.options={precision:r.precision??2,strict:r.strict??true};}add(...r){if(r.length===0&&this.options.strict)throw new Error("At least one operand required");return {value:this.roundToPrecision(r.reduce((i,n)=>i+n,0)),operation:"add",operands:Object.freeze([...r])}}subtract(r,...o){return {value:this.roundToPrecision(o.reduce((n,a)=>n-a,r)),operation:"subtract",operands:Object.freeze([r,...o])}}roundToPrecision(r){return Math.round(r*Math.pow(10,this.options.precision))/Math.pow(10,this.options.precision)}};function u(t,r="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(t)}function s(t){return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}export{e as Calculator,e as default,u as formatCurrency,s as validateEmail};//# sourceMappingURL=index.mjs.map
|
|
3
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/calculator.ts","../src/utils.ts"],"names":["Calculator","options","operands","sum","num","first","rest","diff","value","formatCurrency","amount","currency","validateEmail","email"],"mappings":";AAYO,IAAMA,CAAN,CAAA,KAAiB,CACH,OAAA,CAMjB,YAAYC,CAA6B,CAAA,EAAI,CAAA,CACzC,KAAK,OAAU,CAAA,CACX,SAAWA,CAAAA,CAAAA,CAAQ,WAAa,CAChC,CAAA,MAAA,CAAQA,CAAQ,CAAA,MAAA,EAAU,IAC9B,EACJ,CAQA,GAAA,CAAA,GAAOC,EAAuC,CAC1C,GAAIA,CAAS,CAAA,MAAA,GAAW,GAAK,IAAK,CAAA,OAAA,CAAQ,MACtC,CAAA,MAAM,IAAI,KAAM,CAAA,+BAA+B,CAKnD,CAAA,OAAO,CACH,KAAA,CAHU,IAAK,CAAA,gBAAA,CAAiBA,EAAS,MAAO,CAAA,CAACC,CAAKC,CAAAA,CAAAA,GAAQD,EAAMC,CAAK,CAAA,CAAC,CAAC,CAAA,CAI3E,UAAW,KACX,CAAA,QAAA,CAAU,MAAO,CAAA,MAAA,CAAO,CAAC,GAAGF,CAAQ,CAAC,CACzC,CACJ,CAQA,QAAA,CAASG,CAAkBC,CAAAA,GAAAA,CAAAA,CAAmC,CAG1D,OAAO,CACH,KAHU,CAAA,IAAA,CAAK,iBAAiBA,CAAK,CAAA,MAAA,CAAO,CAACC,CAAAA,CAAMH,CAAQG,GAAAA,CAAAA,CAAOH,CAAKC,CAAAA,CAAK,CAAC,CAI7E,CAAA,SAAA,CAAW,UACX,CAAA,QAAA,CAAU,OAAO,MAAO,CAAA,CAACA,CAAO,CAAA,GAAGC,CAAI,CAAC,CAC5C,CACJ,CAEQ,gBAAiBE,CAAAA,CAAAA,CAAuB,CAC5C,OAAO,KAAK,KAAMA,CAAAA,CAAAA,CAAQ,IAAK,CAAA,GAAA,CAAI,GAAI,IAAK,CAAA,OAAA,CAAQ,SAAS,CAAC,EAAI,IAAK,CAAA,GAAA,CAAI,EAAI,CAAA,IAAA,CAAK,OAAQ,CAAA,SAAS,CACzG,CACJ,EC3DO,SAASC,CAAAA,CAAeC,CAAgBC,CAAAA,CAAAA,CAAW,MAAe,CACrE,OAAO,IAAI,IAAA,CAAK,aAAa,OAAS,CAAA,CAClC,KAAO,CAAA,UAAA,CACP,SAAAA,CACJ,CAAC,CAAE,CAAA,MAAA,CAAOD,CAAM,CACpB,CAOO,SAASE,CAAAA,CAAcC,EAAwB,CAElD,OADmB,4BACD,CAAA,IAAA,CAAKA,CAAK,CAChC","file":"index.mjs","sourcesContent":["import type { CalculationResult, CalculatorOptions } from \"./types\"\n\n/**\n * A simple calculator class demonstrating TypeScript library patterns\n *\n * @example\n * ```typescript\n * const calc = new Calculator({ precision: 2 })\n * const result = calc.add(1, 2)\n * console.log(result.value) // 3\n * ```\n */\nexport class Calculator {\n private readonly options: Required<CalculatorOptions>\n\n /**\n * Creates a new Calculator instance\n * @param options - Configuration options\n */\n constructor(options: CalculatorOptions = {}) {\n this.options = {\n precision: options.precision ?? 2,\n strict: options.strict ?? true,\n }\n }\n\n /**\n * Adds two or more numbers\n * @param operands - Numbers to add\n * @returns Calculation result\n * @throws Error when no operands provided and strict mode is enabled\n */\n add(...operands: number[]): CalculationResult {\n if (operands.length === 0 && this.options.strict) {\n throw new Error(\"At least one operand required\")\n }\n\n const value = this.roundToPrecision(operands.reduce((sum, num) => sum + num, 0))\n\n return {\n value,\n operation: \"add\",\n operands: Object.freeze([...operands]),\n }\n }\n\n /**\n * Subtracts numbers from the first operand\n * @param first - Initial value\n * @param rest - Numbers to subtract\n * @returns Calculation result\n */\n subtract(first: number, ...rest: number[]): CalculationResult {\n const value = this.roundToPrecision(rest.reduce((diff, num) => diff - num, first))\n\n return {\n value,\n operation: \"subtract\",\n operands: Object.freeze([first, ...rest]),\n }\n }\n\n private roundToPrecision(value: number): number {\n return Math.round(value * Math.pow(10, this.options.precision)) / Math.pow(10, this.options.precision)\n }\n}\n","/**\n * Formats a number as currency\n * @param amount - The amount to format\n * @param currency - Currency code (default: 'USD')\n * @returns Formatted currency string\n */\nexport function formatCurrency(amount: number, currency = \"USD\"): string {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency,\n }).format(amount)\n}\n\n/**\n * Validates an email address using a simple regex\n * @param email - Email to validate\n * @returns True if email appears valid\n */\nexport function validateEmail(email: string): boolean {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n return emailRegex.test(email)\n}\n"]}
|
package/readme.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# comfy-ts
|
|
2
|
-
|
|
3
|
-
[](https://github.com/rvion/comfy-ts/actions/workflows/ci.yml)
|
|
4
|
-
[](https://badge.fury.io/js/%40cushy%2Fcomfy-ts)
|
|
5
|
-
<!-- [](https://codecov.io/gh/rvion/comfy-ts) -->
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
npm install comfy-ts
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
--------------
|
|
16
|
-
|
|
17
|
-
## creating a relase
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
# Add changeset for your changes
|
|
21
|
-
npx changeset
|
|
22
|
-
|
|
23
|
-
# Version packages (updates package.json and CHANGELOG.md)
|
|
24
|
-
npx changeset version
|
|
25
|
-
|
|
26
|
-
# Publish (done automatically via GitHub Actions)
|
|
27
|
-
npm run release
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## npm login
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
npm whoami
|
|
35
|
-
npm adduser
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
npm publish --access public
|
|
40
|
-
```
|