Skip to content

Commit

Permalink
Workflows update
Browse files Browse the repository at this point in the history
  • Loading branch information
karurochari committed Sep 11, 2024
1 parent 356a3ad commit 8ec9256
Show file tree
Hide file tree
Showing 7 changed files with 7,511 additions and 20 deletions.
6 changes: 5 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"style": {
"noUselessElse": "off",
"noNonNullAssertion": "off"
},
"complexity": {
"useLiteralKeys": "off"
}
}
},
"ignore": ["./workflows/interface.ts"]
}
}
5 changes: 1 addition & 4 deletions src/comfy-types-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function CompileComfyJSON(cfg: ReturnType<typeof NormalizeComfyJSON>, bas
}
else {
if (type.length !== 0) return `${type.map(x => `'${$(x)}'`).join('|')}| $dyn`
else return 'void';
else return '$dyn'; //Technically void, but $dyn is always allowed
}
}

Expand All @@ -81,9 +81,6 @@ export function CompileComfyJSON(cfg: ReturnType<typeof NormalizeComfyJSON>, bas
* @desc ${metadata.description}
*/
${JSON.stringify(metadata.name)} : class extends Node{
//Setters
${Object.entries(inputs).map((x, i) => `//set '${$(x[0])}'(value : ${TypeFromComfyUI(x[1].type)}) { super.$$link(${i}, value) } `).join('\n')}
//Getters
${Object.entries(outputs).map((x, i) => `get '${$(x[0])}'() : ${TypeFromComfyUI(x[1].type)} { return [this.$uid.toString(), ${i}] as unknown as ${TypeFromComfyUI(x[1].type)}; }`).join('\n')}
Expand Down
1 change: 0 additions & 1 deletion workflows/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
/interface.ts
19 changes: 17 additions & 2 deletions workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
Sub-repo containing a collection of common sub-workflows to be either used standalone or as composable blocks in more complex strategies.
This content will be probably moved to an external repo at some point.
## Licence

Unlike the main repo, this section is "CC0-1.0"

## Contributions

Contributions of workflows are very appreciated, however there are some guidelines to follow:

- Only nodes supported in the latest version of ComfyUI mainline. Otherwise, a separate repository might be better.
- Only composable interface (no precompiled JSON as return type)
- Workflows must follow semantic versioning. If you break it, bump the major version. Major below 1 are excluded and can break at any point.
- Workflows should **really** avoid being async.
- Opinionated choices are good! If you want to define qualitative quantifiers like "HIGH" or "LOW" it is ok. However, consistency in the language is also good, so try to match the expected behaviour of other workflows if feasible.
- Feel free to use already defined workflows, but make sure to assert their version assuming semantic versioning is followed.
- Make sure to comment the interface of your workflows unless parameters are really trivial and self-explicative.

Feel free to use `example.ts` as reference for your own PR & have fun!
11 changes: 0 additions & 11 deletions workflows/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
Contributions of workflows are very appreciated, however there are some guidelines to follow:

- Only nodes supported in the latest version of ComfyUI mainline. Otherwise, a separate repository might be better.
- Only composable interface (no precompiled JSON as return type)
- Workflows must follow semantic versioning. If you break it, bump the major version. Major below 1 are excluded and can break at any point.
- Workflows should **really** avoid being async.
- Opinionated choices are good! If you want to define qualitative quantifiers like "HIGH" or "LOW" it is ok. However, consistency in the language is also good, so try to match the expected behaviour of other workflows if feasible.
- Feel free to use already defined workflows, but make sure to assert their version assuming semantic versioning is followed.
- Make sure to comment the interface of your workflows unless parameters are really trivial and self-explicative.

Feel free to use `example.ts` as reference for your own PR & have fun!
Loading

0 comments on commit 8ec9256

Please sign in to comment.