diff --git a/TODO.md b/TODO.md index ed56518..3101de8 100644 --- a/TODO.md +++ b/TODO.md @@ -1,25 +1,31 @@ # Upcoming -## Needed for release 0.2.13 +## Needed for release 0.2.15 - [ ] Companion plugin for Comfy to simplify testing. +- [ ] Optional support to add/strip metadata in the final artifacts if so desired. + +## Needed for release 0.2.17 + - [ ] Add tests for the workflow building - [ ] Add tests for ts code gen from workflow -## Needed for release 0.2.15 +## Needed for release 0.2.19 - [ ] Use names from the workflow for nodes during code gen. - [ ] Generate more of the boilerplate during code gen. -- [ ] Optional support to add/strip metadata in the final artifacts if so desired. - [ ] Better error handling when workflows fail (and related tests) ## Needed for release 0.3.x - [ ] Add support for client-side certificates to authorize the connection with comfyui (needed for some semi-public configurations) -- [ ] Add interpolation support for pre-compiled workflows. Needed to generate many variants fast (?) # Older releases +## Needed for release 0.2.13 + +- [x] Fixing codegen for some plugins + ## Needed for release 0.2.11 - [x] Improve docs for recent features diff --git a/docs/cli.md b/docs/cli.md index 0a21b6d..148be36 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -18,7 +18,7 @@ bunx comfybun gen-types DEST_FILE --url=HOST:PORT --packageName=comfyclient ``` `url` and `packageName` have sound defaults. -If `DEST_FILE` is not specified a `workflow.ts` file will be generated locally. +If `DEST_FILE` is not specified a `comfy-types.ts` file will be generated locally. ### Code from image diff --git a/package.json b/package.json index 5b4142a..c75689a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "module": "index.ts", "type": "module", "license": "BSD-3-Clause", - "version": "0.2.12", + "version": "0.2.13", "description": "Wrapper for the REST endpoints of a comfyui instance & some quality of life utils.", "bin": { "comfybun": "./bin/main.ts" diff --git a/src/comfy-types-gen.ts b/src/comfy-types-gen.ts index 39f5b8a..55952a6 100644 --- a/src/comfy-types-gen.ts +++ b/src/comfy-types-gen.ts @@ -63,10 +63,26 @@ export function CompileComfyJSON(cfg: ReturnType, bas function TypeFromComfyUI(type: string | string[], metadata?: { min?: unknown, max?: unknown, default?: unknown, step?: unknown }) { if (typeof type === 'string') { - if (['STRING', 'BOOLEAN', 'INT', 'FLOAT', '*'].includes(type) === false) types.add(type); - if (type === '*') return 'ANY' - else if (metadata?.min !== undefined && metadata?.max !== undefined) return `${type}<${metadata.min},${metadata.max}>`; - else return type; + const type_list = type.split(","); + const ret_list = [] + for (const type of type_list) { + const reduced_type = type.split(":")[0] + if ( + ["STRING", "BOOLEAN", "INT", "FLOAT", "*"].includes( + reduced_type, + ) === false + ) + types.add(reduced_type); + + if (reduced_type === "*") ret_list.push("ANY"); + else if ( + metadata?.min !== undefined && + metadata?.max !== undefined + ) + ret_list.push(`${reduced_type}<${metadata.min},${metadata.max}>`); + else ret_list.push(reduced_type); + } + return ret_list.join('|'); } else { if (type.length !== 0) return `${type.map(x => `'${$(x)}'`).join('|')}| $dyn`