Conversion to standard prompt format

This commit is contained in:
space-nuko
2023-05-19 11:05:35 -05:00
parent 74a1b5c636
commit ec80884684
10 changed files with 404 additions and 224 deletions

View File

@@ -33,7 +33,7 @@
"svelte-check": "^3.2.0", "svelte-check": "^3.2.0",
"svelte-dnd-action": "^0.9.22", "svelte-dnd-action": "^0.9.22",
"typescript": "^5.0.3", "typescript": "^5.0.3",
"vite": "^4.3.1", "vite": "^4.3.8",
"vite-plugin-glsl": "^1.1.2", "vite-plugin-glsl": "^1.1.2",
"vite-plugin-static-copy": "^0.14.0", "vite-plugin-static-copy": "^0.14.0",
"vite-plugin-svelte-console-remover": "^1.0.10", "vite-plugin-svelte-console-remover": "^1.0.10",

140
pnpm-lock.yaml generated
View File

@@ -69,7 +69,7 @@ importers:
version: link:litegraph/packages/tsconfig version: link:litegraph/packages/tsconfig
'@sveltejs/vite-plugin-svelte': '@sveltejs/vite-plugin-svelte':
specifier: ^2.1.1 specifier: ^2.1.1
version: 2.1.1(svelte@3.58.0)(vite@4.3.1) version: 2.1.1(svelte@3.58.0)(vite@4.3.8)
'@tsconfig/svelte': '@tsconfig/svelte':
specifier: ^4.0.1 specifier: ^4.0.1
version: 4.0.1 version: 4.0.1
@@ -123,7 +123,7 @@ importers:
version: 9.0.0 version: 9.0.0
vite-plugin-full-reload: vite-plugin-full-reload:
specifier: ^1.0.5 specifier: ^1.0.5
version: 1.0.5(vite@4.3.1) version: 1.0.5(vite@4.3.8)
zod: zod:
specifier: ^3.21.4 specifier: ^3.21.4
version: 3.21.4 version: 3.21.4
@@ -174,20 +174,20 @@ importers:
specifier: ^5.0.3 specifier: ^5.0.3
version: 5.0.3 version: 5.0.3
vite: vite:
specifier: ^4.3.1 specifier: ^4.3.8
version: 4.3.1(sass@1.61.0) version: 4.3.8(sass@1.61.0)
vite-plugin-glsl: vite-plugin-glsl:
specifier: ^1.1.2 specifier: ^1.1.2
version: 1.1.2(vite@4.3.1) version: 1.1.2(vite@4.3.8)
vite-plugin-static-copy: vite-plugin-static-copy:
specifier: ^0.14.0 specifier: ^0.14.0
version: 0.14.0(vite@4.3.1) version: 0.14.0(vite@4.3.8)
vite-plugin-svelte-console-remover: vite-plugin-svelte-console-remover:
specifier: ^1.0.10 specifier: ^1.0.10
version: 1.0.10(sass@1.61.0) version: 1.0.10(sass@1.61.0)
vite-tsconfig-paths: vite-tsconfig-paths:
specifier: ^4.0.8 specifier: ^4.0.8
version: 4.0.8(typescript@5.0.3)(vite@4.3.1) version: 4.0.8(typescript@5.0.3)(vite@4.3.8)
vitest: vitest:
specifier: ^0.27.3 specifier: ^0.27.3
version: 0.27.3(happy-dom@9.18.3)(jsdom@22.0.0)(sass@1.61.0) version: 0.27.3(happy-dom@9.18.3)(jsdom@22.0.0)(sass@1.61.0)
@@ -3044,7 +3044,7 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@sveltejs/vite-plugin-svelte@2.1.1(svelte@3.58.0)(vite@4.3.1): /@sveltejs/vite-plugin-svelte@2.1.1(svelte@3.58.0)(vite@4.3.8):
resolution: {integrity: sha512-7YeBDt4us0FiIMNsVXxyaP4Hwyn2/v9x3oqStkHU3ZdIc5O22pGwUwH33wUqYo+7Itdmo8zxJ45Qvfm3H7UUjQ==} resolution: {integrity: sha512-7YeBDt4us0FiIMNsVXxyaP4Hwyn2/v9x3oqStkHU3ZdIc5O22pGwUwH33wUqYo+7Itdmo8zxJ45Qvfm3H7UUjQ==}
engines: {node: ^14.18.0 || >= 16} engines: {node: ^14.18.0 || >= 16}
peerDependencies: peerDependencies:
@@ -3057,8 +3057,8 @@ packages:
magic-string: 0.30.0 magic-string: 0.30.0
svelte: 3.58.0 svelte: 3.58.0
svelte-hmr: 0.15.1(svelte@3.58.0) svelte-hmr: 0.15.1(svelte@3.58.0)
vite: 4.3.1(sass@1.61.0) vite: 4.3.8(sass@1.61.0)
vitefu: 0.2.4(vite@4.3.1) vitefu: 0.2.4(vite@4.3.8)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
dev: false dev: false
@@ -3066,7 +3066,7 @@ packages:
/@swc/helpers@0.4.14: /@swc/helpers@0.4.14:
resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==}
dependencies: dependencies:
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/@tootallnate/once@2.0.0: /@tootallnate/once@2.0.0:
@@ -3528,7 +3528,7 @@ packages:
engines: {node: '>=16.1.0'} engines: {node: '>=16.1.0'}
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/autoprefixer@10.4.2(postcss@8.4.21): /autoprefixer@10.4.2(postcss@8.4.21):
@@ -3700,7 +3700,7 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
fast-unique-numbers: 8.0.0 fast-unique-numbers: 8.0.0
tslib: 2.5.0 tslib: 2.5.1
worker-factory: 7.0.0 worker-factory: 7.0.0
dev: false dev: false
@@ -3975,7 +3975,7 @@ packages:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
dashify: 2.0.0 dashify: 2.0.0
indefinite-article: 0.0.2 indefinite-article: 0.0.2
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/compilerr@11.0.0: /compilerr@11.0.0:
@@ -3985,7 +3985,7 @@ packages:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
dashify: 2.0.0 dashify: 2.0.0
indefinite-article: 0.0.2 indefinite-article: 0.0.2
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/concat-map@0.0.1: /concat-map@0.0.1:
@@ -4972,14 +4972,14 @@ packages:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
broker-factory: 3.0.76 broker-factory: 3.0.76
extendable-media-recorder-wav-encoder-worker: 8.0.77 extendable-media-recorder-wav-encoder-worker: 8.0.77
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/extendable-media-recorder-wav-encoder-worker@8.0.77: /extendable-media-recorder-wav-encoder-worker@8.0.77:
resolution: {integrity: sha512-9g9Q7fhOxPY7RALHVTK9Wjnc8RPYjJ9XCBP1TaNtDraIAFxvhBRax9QUOmFqHM2MvRM6hQhNav7jn23yy6tcVQ==} resolution: {integrity: sha512-9g9Q7fhOxPY7RALHVTK9Wjnc8RPYjJ9XCBP1TaNtDraIAFxvhBRax9QUOmFqHM2MvRM6hQhNav7jn23yy6tcVQ==}
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
tslib: 2.5.0 tslib: 2.5.1
worker-factory: 7.0.0 worker-factory: 7.0.0
dev: false dev: false
@@ -5042,7 +5042,7 @@ packages:
engines: {node: '>=14.15.4'} engines: {node: '>=14.15.4'}
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/fast-unique-numbers@8.0.0: /fast-unique-numbers@8.0.0:
@@ -5050,7 +5050,7 @@ packages:
engines: {node: '>=16.1.0'} engines: {node: '>=16.1.0'}
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/fastq@1.15.0: /fastq@1.15.0:
@@ -6646,7 +6646,7 @@ packages:
broker-factory: 3.0.76 broker-factory: 3.0.76
fast-unique-numbers: 8.0.0 fast-unique-numbers: 8.0.0
media-encoder-host-worker: 9.1.1 media-encoder-host-worker: 9.1.1
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/media-encoder-host-worker@9.1.1: /media-encoder-host-worker@9.1.1:
@@ -6654,7 +6654,7 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
extendable-media-recorder-wav-encoder-broker: 7.0.78 extendable-media-recorder-wav-encoder-broker: 7.0.78
tslib: 2.5.0 tslib: 2.5.1
worker-factory: 7.0.0 worker-factory: 7.0.0
dev: false dev: false
@@ -6664,7 +6664,7 @@ packages:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
media-encoder-host-broker: 7.0.79 media-encoder-host-broker: 7.0.79
media-encoder-host-worker: 9.1.1 media-encoder-host-worker: 9.1.1
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/merge-stream@2.0.0: /merge-stream@2.0.0:
@@ -6782,7 +6782,7 @@ packages:
engines: {node: '>=12.20.1'} engines: {node: '>=12.20.1'}
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/murmurhash-js@1.0.0: /murmurhash-js@1.0.0:
@@ -7198,6 +7198,14 @@ packages:
picocolors: 1.0.0 picocolors: 1.0.0
source-map-js: 1.0.2 source-map-js: 1.0.2
/postcss@8.4.23:
resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
nanoid: 3.3.6
picocolors: 1.0.0
source-map-js: 1.0.2
/posthtml-parser@0.10.2: /posthtml-parser@0.10.2:
resolution: {integrity: sha512-PId6zZ/2lyJi9LiKfe+i2xv57oEjJgWbsHGGANwos5AvdQp98i6AtamAl8gzSVFGfQ43Glb5D614cvZf012VKg==} resolution: {integrity: sha512-PId6zZ/2lyJi9LiKfe+i2xv57oEjJgWbsHGGANwos5AvdQp98i6AtamAl8gzSVFGfQ43Glb5D614cvZf012VKg==}
engines: {node: '>=12'} engines: {node: '>=12'}
@@ -7382,7 +7390,7 @@ packages:
resolution: {integrity: sha512-oiiS2sp6eMxkvjt13yetSYUJvnAxBZk60mIxz0Vf/2lDWa/4svCyMLHIDzYKbHahkISd0UYyqLS9dI7xDlUOCA==} resolution: {integrity: sha512-oiiS2sp6eMxkvjt13yetSYUJvnAxBZk60mIxz0Vf/2lDWa/4svCyMLHIDzYKbHahkISd0UYyqLS9dI7xDlUOCA==}
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/recorder-audio-worklet@5.1.39: /recorder-audio-worklet@5.1.39:
@@ -7394,7 +7402,7 @@ packages:
recorder-audio-worklet-processor: 4.2.21 recorder-audio-worklet-processor: 4.2.21
standardized-audio-context: 25.3.45 standardized-audio-context: 25.3.45
subscribable-things: 2.1.14 subscribable-things: 2.1.14
tslib: 2.5.0 tslib: 2.5.1
worker-factory: 6.0.76 worker-factory: 6.0.76
dev: false dev: false
@@ -7777,7 +7785,7 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
automation-events: 6.0.0 automation-events: 6.0.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/std-env@3.3.3: /std-env@3.3.3:
@@ -7861,7 +7869,7 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
rxjs-interop: 2.0.0 rxjs-interop: 2.0.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/sucrase@3.32.0: /sucrase@3.32.0:
@@ -8450,7 +8458,6 @@ packages:
/tslib@2.5.1: /tslib@2.5.1:
resolution: {integrity: sha512-KaI6gPil5m9vF7DKaoXxx1ia9fxS4qG5YveErRRVknPDXXriu5M8h48YRjB6h5ZUOKuAKlSJYb0GaDe8I39fRw==} resolution: {integrity: sha512-KaI6gPil5m9vF7DKaoXxx1ia9fxS4qG5YveErRRVknPDXXriu5M8h48YRjB6h5ZUOKuAKlSJYb0GaDe8I39fRw==}
dev: false dev: false
optional: true
/tsutils@3.21.0(typescript@5.0.3): /tsutils@3.21.0(typescript@5.0.3):
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
@@ -8629,7 +8636,7 @@ packages:
fast-json-patch: 3.1.1 fast-json-patch: 3.1.1
json-stringify-pretty-compact: 3.0.0 json-stringify-pretty-compact: 3.0.0
semver: 7.4.0 semver: 7.4.0
tslib: 2.5.0 tslib: 2.5.1
vega: 5.22.1 vega: 5.22.1
vega-interpreter: 1.0.5 vega-interpreter: 1.0.5
vega-lite: 0.6.7 vega-lite: 0.6.7
@@ -9007,7 +9014,7 @@ packages:
picocolors: 1.0.0 picocolors: 1.0.0
source-map: 0.6.1 source-map: 0.6.1
source-map-support: 0.5.21 source-map-support: 0.5.21
vite: 4.3.1(@types/node@18.16.0)(sass@1.61.0) vite: 4.3.8(@types/node@18.16.0)(sass@1.61.0)
transitivePeerDependencies: transitivePeerDependencies:
- '@types/node' - '@types/node'
- less - less
@@ -9028,7 +9035,7 @@ packages:
mlly: 1.2.1 mlly: 1.2.1
pathe: 1.1.0 pathe: 1.1.0
picocolors: 1.0.0 picocolors: 1.0.0
vite: 4.3.1(@types/node@18.16.0) vite: 4.3.8(@types/node@18.16.0)
transitivePeerDependencies: transitivePeerDependencies:
- '@types/node' - '@types/node'
- less - less
@@ -9114,29 +9121,29 @@ packages:
- supports-color - supports-color
dev: false dev: false
/vite-plugin-full-reload@1.0.5(vite@4.3.1): /vite-plugin-full-reload@1.0.5(vite@4.3.8):
resolution: {integrity: sha512-kVZFDFWr0DxiHn6MuDVTQf7gnWIdETGlZh0hvTiMXzRN80vgF4PKbONSq8U1d0WtHsKaFODTQgJeakLacoPZEQ==} resolution: {integrity: sha512-kVZFDFWr0DxiHn6MuDVTQf7gnWIdETGlZh0hvTiMXzRN80vgF4PKbONSq8U1d0WtHsKaFODTQgJeakLacoPZEQ==}
peerDependencies: peerDependencies:
vite: ^2 || ^3 || ^4 vite: ^2 || ^3 || ^4
dependencies: dependencies:
picocolors: 1.0.0 picocolors: 1.0.0
picomatch: 2.3.1 picomatch: 2.3.1
vite: 4.3.1(sass@1.61.0) vite: 4.3.8(sass@1.61.0)
dev: false dev: false
/vite-plugin-glsl@1.1.2(vite@4.3.1): /vite-plugin-glsl@1.1.2(vite@4.3.8):
resolution: {integrity: sha512-zmXsfc1vn2MlYve9t3FAoWuhLyoCkNS1TuQL+TkXZL7tGmBjRErp10eNYxcse5tK9oUC5MyJpNc4ElpQnx8DoA==} resolution: {integrity: sha512-zmXsfc1vn2MlYve9t3FAoWuhLyoCkNS1TuQL+TkXZL7tGmBjRErp10eNYxcse5tK9oUC5MyJpNc4ElpQnx8DoA==}
engines: {node: '>= 16.15.1', npm: '>= 8.11.0'} engines: {node: '>= 16.15.1', npm: '>= 8.11.0'}
peerDependencies: peerDependencies:
vite: ^3.0.0 || ^4.0.0 vite: ^3.0.0 || ^4.0.0
dependencies: dependencies:
'@rollup/pluginutils': 5.0.2 '@rollup/pluginutils': 5.0.2
vite: 4.3.1(sass@1.61.0) vite: 4.3.8(sass@1.61.0)
transitivePeerDependencies: transitivePeerDependencies:
- rollup - rollup
dev: true dev: true
/vite-plugin-static-copy@0.14.0(vite@4.3.1): /vite-plugin-static-copy@0.14.0(vite@4.3.8):
resolution: {integrity: sha512-RMFmb4czomcrsbQBiUZs9HcDGN3kxGvF+OrtkfTVocp12CuoUCuJQhcY26RK35A6KS4WasGzEwcYZqHMjkAvVw==} resolution: {integrity: sha512-RMFmb4czomcrsbQBiUZs9HcDGN3kxGvF+OrtkfTVocp12CuoUCuJQhcY26RK35A6KS4WasGzEwcYZqHMjkAvVw==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies: peerDependencies:
@@ -9146,7 +9153,7 @@ packages:
fast-glob: 3.2.12 fast-glob: 3.2.12
fs-extra: 11.1.1 fs-extra: 11.1.1
picocolors: 1.0.0 picocolors: 1.0.0
vite: 4.3.1(sass@1.61.0) vite: 4.3.8(sass@1.61.0)
dev: true dev: true
/vite-plugin-svelte-console-remover@1.0.10(sass@1.61.0): /vite-plugin-svelte-console-remover@1.0.10(sass@1.61.0):
@@ -9162,7 +9169,7 @@ packages:
- supports-color - supports-color
dev: true dev: true
/vite-tsconfig-paths@4.0.8(typescript@5.0.3)(vite@4.3.1): /vite-tsconfig-paths@4.0.8(typescript@5.0.3)(vite@4.3.8):
resolution: {integrity: sha512-p04zH+Ey+NT78571x0pdX7nVRIJSlmKVvYryFglSWOK3Hc72eDL0+JJfbyQiugaIBApJkaEqbBQvqpsFZOSVGg==} resolution: {integrity: sha512-p04zH+Ey+NT78571x0pdX7nVRIJSlmKVvYryFglSWOK3Hc72eDL0+JJfbyQiugaIBApJkaEqbBQvqpsFZOSVGg==}
peerDependencies: peerDependencies:
vite: '*' vite: '*'
@@ -9173,7 +9180,7 @@ packages:
debug: 4.3.4 debug: 4.3.4
globrex: 0.1.2 globrex: 0.1.2
tsconfck: 2.1.1(typescript@5.0.3) tsconfck: 2.1.1(typescript@5.0.3)
vite: 4.3.1(sass@1.61.0) vite: 4.3.8(sass@1.61.0)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
- typescript - typescript
@@ -9325,8 +9332,8 @@ packages:
fsevents: 2.3.2 fsevents: 2.3.2
dev: false dev: false
/vite@4.3.1(@types/node@18.16.0)(sass@1.61.0): /vite@4.3.8(@types/node@18.16.0):
resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==} resolution: {integrity: sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@@ -9352,15 +9359,48 @@ packages:
dependencies: dependencies:
'@types/node': 18.16.0 '@types/node': 18.16.0
esbuild: 0.17.18 esbuild: 0.17.18
postcss: 8.4.21 postcss: 8.4.23
rollup: 3.21.0
optionalDependencies:
fsevents: 2.3.2
dev: false
/vite@4.3.8(@types/node@18.16.0)(sass@1.61.0):
resolution: {integrity: sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
peerDependencies:
'@types/node': '>= 14'
less: '*'
sass: '*'
stylus: '*'
sugarss: '*'
terser: ^5.4.0
peerDependenciesMeta:
'@types/node':
optional: true
less:
optional: true
sass:
optional: true
stylus:
optional: true
sugarss:
optional: true
terser:
optional: true
dependencies:
'@types/node': 18.16.0
esbuild: 0.17.18
postcss: 8.4.23
rollup: 3.21.0 rollup: 3.21.0
sass: 1.61.0 sass: 1.61.0
optionalDependencies: optionalDependencies:
fsevents: 2.3.2 fsevents: 2.3.2
dev: true dev: true
/vite@4.3.1(sass@1.61.0): /vite@4.3.8(sass@1.61.0):
resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==} resolution: {integrity: sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@@ -9385,7 +9425,7 @@ packages:
optional: true optional: true
dependencies: dependencies:
esbuild: 0.17.18 esbuild: 0.17.18
postcss: 8.4.21 postcss: 8.4.23
rollup: 3.21.0 rollup: 3.21.0
sass: 1.61.0 sass: 1.61.0
optionalDependencies: optionalDependencies:
@@ -9400,7 +9440,7 @@ packages:
optional: true optional: true
dev: true dev: true
/vitefu@0.2.4(vite@4.3.1): /vitefu@0.2.4(vite@4.3.8):
resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==}
peerDependencies: peerDependencies:
vite: ^3.0.0 || ^4.0.0 vite: ^3.0.0 || ^4.0.0
@@ -9408,7 +9448,7 @@ packages:
vite: vite:
optional: true optional: true
dependencies: dependencies:
vite: 4.3.1(sass@1.61.0) vite: 4.3.8(sass@1.61.0)
dev: false dev: false
/vitest@0.27.3(happy-dom@9.18.3)(jsdom@22.0.0)(sass@1.61.0): /vitest@0.27.3(happy-dom@9.18.3)(jsdom@22.0.0)(sass@1.61.0):
@@ -9451,7 +9491,7 @@ packages:
tinybench: 2.5.0 tinybench: 2.5.0
tinypool: 0.3.1 tinypool: 0.3.1
tinyspy: 1.1.1 tinyspy: 1.1.1
vite: 4.3.1(@types/node@18.16.0)(sass@1.61.0) vite: 4.3.8(@types/node@18.16.0)(sass@1.61.0)
vite-node: 0.27.3(@types/node@18.16.0)(sass@1.61.0) vite-node: 0.27.3(@types/node@18.16.0)(sass@1.61.0)
why-is-node-running: 2.2.2 why-is-node-running: 2.2.2
transitivePeerDependencies: transitivePeerDependencies:
@@ -9657,7 +9697,7 @@ packages:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
compilerr: 10.0.2 compilerr: 10.0.2
fast-unique-numbers: 7.0.2 fast-unique-numbers: 7.0.2
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/worker-factory@7.0.0: /worker-factory@7.0.0:
@@ -9666,7 +9706,7 @@ packages:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
compilerr: 11.0.0 compilerr: 11.0.0
fast-unique-numbers: 8.0.0 fast-unique-numbers: 8.0.0
tslib: 2.5.0 tslib: 2.5.1
dev: false dev: false
/wrap-ansi@7.0.0: /wrap-ansi@7.0.0:

View File

@@ -7,11 +7,10 @@ const ModelHashes = z.object({
a1111_shorthash !== undefined || sha256 !== undefined, a1111_shorthash !== undefined || sha256 !== undefined,
{ message: "At least one model hash must be specified" }) { message: "At least one model hash must be specified" })
const GroupPrompt = z.object({ const GroupConditioning = z.object({
positive: z.string(), text: z.string(),
negative: z.string()
}) })
export type ComfyBoxStdGroupPrompt = z.infer<typeof GroupPrompt> export type ComfyBoxStdGroupConditioning = z.infer<typeof GroupConditioning>
const GroupCheckpoint = z.object({ const GroupCheckpoint = z.object({
model_name: z.string().optional(), model_name: z.string().optional(),
@@ -138,15 +137,46 @@ const GroupDDetailer = z.object({
dilation: z.number(), dilation: z.number(),
offset_x: z.number(), offset_x: z.number(),
offset_y: z.number(), offset_y: z.number(),
inpaint_full: z.number(), preprocess: z.boolean(),
inpaint_full: z.boolean(),
inpaint_padding: z.number(), inpaint_padding: z.number(),
cfg: z.number()
}) })
export type ComfyBoxStdGroupDDetailer = z.infer<typeof GroupDDetailer> export type ComfyBoxStdGroupDDetailer = z.infer<typeof GroupDDetailer>
const group = (s: ZodTypeAny) => z.optional(z.array(s).nonempty()); /*
* This metadata can be attached to each entry in a group to assist in
* identifying the correct nodes to apply it to.
*
* As an example, positive and negative conditioning are deployed as two
* separate nodes in ComfyUI. This makes bundling them into a { positive,
* negative } entry difficult as either one can be missing. So instead they're
* tagged like
*
* {
* conditioning: [
* { text: "masterpiece", "$meta": { types: ["positive"] } },
* { text: "worst quality", "$meta": { types: ["negative"] } },
* ]
* }
*
* The reasoning is the "types" information isn't required to reinstantiate
* the node, it's only semantic information describing how the node is used in
* the encompassing workflow. When the prompt is loaded the workflow can be
* searched for a node with the compatible type to attach the information to.
*/
const GroupMetadata = z.object({
types: z.array(z.string()).nonempty().optional()
})
export type ComfyBoxStdGroupMetadata = z.infer<typeof GroupMetadata>
const group = (entry: ZodTypeAny) => {
const groupEntry = entry.and(z.object({ "$meta": GroupMetadata }))
return z.optional(z.array(groupEntry).nonempty());
}
const Parameters = z.object({ const Parameters = z.object({
prompt: group(GroupPrompt), conditioning: group(GroupConditioning),
checkpoint: group(GroupCheckpoint), checkpoint: group(GroupCheckpoint),
vae: group(GroupVAE), vae: group(GroupVAE),
k_sampler: group(GroupKSampler), k_sampler: group(GroupKSampler),
@@ -183,22 +213,40 @@ const Metadata = z.object({
extra_data: ExtraData extra_data: ExtraData
}) })
const Prompt = z.object({
metadata: Metadata,
parameters: Parameters
})
const ComfyBoxStdPrompt = z.object({ const ComfyBoxStdPrompt = z.object({
version: z.number(), version: z.number(),
prompt: Prompt, metadata: Metadata,
parameters: Parameters
}) })
export default ComfyBoxStdPrompt export default ComfyBoxStdPrompt
/* /*
* A standardized Stable Diffusion prompt and parameter format, to be used with * A standardized Stable Diffusion parameter format that should be used with an
* an encompassing workflow. Aims to encompass an arbitrary number of parameter * encompassing workflow. Aims to encompass an arbitrary number of parameter
* counts and types, so that most ComfyUI workflows can have parts of their * counts and types, so that most ComfyUI workflows can have parts of their
* prompts transferred between each other. * prompts transferred between each other.
*
* This format does *not* describe how the information should be used in the
* underlying workflow, i.e. it does not specify the structure of a ComfyUI
* execution graph. It only gives hints via tagged input types on each input
* entry as to where the data should be inserted. To recreate a ComfyBox
* workflow with the exact state of the UI intact, the `SerializedAppState` type
* should be used instead. It suffices to embed data of that type in the output
* PNGs for recreating their workflows. This type is meant as an interchange
* format *between* workflows so their inputs can be copied to and from each
* other in a sane-enough manner. (In ComfyBox, copying workflow outputs like
* images to other workflows is handled separately, since this type does not
* retain the actual image data.)
*
* In contrast with a serialized workflow, which is concerned with the
* connections between nodes and the state of the frontend's UI, this format
* concerns itself with the exact values that the execution backend receives,
* after the data in the UI have finished processing.
*
* (Take for example a "scale by" slider that adjusts the width and height of an
* img2img input image of 512 x 512 resolution by 2x. The backend will only
* "see" width 1024 and height 1024, even though the only parameter exposed from
* the frontend was the scale of 2.)
*/ */
export type ComfyBoxStdPrompt = z.infer<typeof ComfyBoxStdPrompt> export type ComfyBoxStdPrompt = z.infer<typeof ComfyBoxStdPrompt>

View File

@@ -1,4 +1,4 @@
import type { Progress, SerializedPrompt, SerializedPromptInputs, SerializedPromptInputsAll, SerializedPromptOutputs } from "./components/ComfyApp"; import type { Progress, SerializedPrompt, SerializedPromptInputsForNode, SerializedPromptInputsAll, SerializedPromptOutputs } from "./components/ComfyApp";
import type TypedEmitter from "typed-emitter"; import type TypedEmitter from "typed-emitter";
import EventEmitter from "events"; import EventEmitter from "events";
import type { ComfyImageLocation } from "$lib/utils"; import type { ComfyImageLocation } from "$lib/utils";

View File

@@ -0,0 +1,26 @@
import type { ComfyBoxStdGroupLoRA, ComfyBoxStdPrompt } from "./ComfyBoxStdPrompt";
import type { ComfyNodeID } from "./api";
import type { SerializedPromptInputs } from "./components/ComfyApp";
import type { ComfyBackendNode } from "./nodes/ComfyBackendNode";
export type ComfyPromptConverter = (stdPrompt: ComfyBoxStdPrompt, inputs: SerializedPromptInputs, nodeID: ComfyNodeID) => void;
function LoraLoader(stdPrompt: ComfyBoxStdPrompt, inputs: SerializedPromptInputs) {
const params = stdPrompt.prompt.parameters
const lora: ComfyBoxStdGroupLoRA = {
model_name: inputs["lora_name"],
strength_unet: inputs["strength_model"],
strength_tenc: inputs["strength_clip"]
}
if (params.lora)
params.lora.push(lora)
else
params.lora = [lora]
}
const converters: Record<string, ComfyPromptConverter> = {
LoraLoader
}
export default converters;

View File

@@ -40,6 +40,7 @@ import { ComfyComboNode } from "$lib/nodes/widgets";
import parseA1111, { type A1111ParsedInfotext } from "$lib/parseA1111"; import parseA1111, { type A1111ParsedInfotext } from "$lib/parseA1111";
import convertA1111ToStdPrompt from "$lib/convertA1111ToStdPrompt"; import convertA1111ToStdPrompt from "$lib/convertA1111ToStdPrompt";
import type { ComfyBoxStdPrompt } from "$lib/ComfyBoxStdPrompt"; import type { ComfyBoxStdPrompt } from "$lib/ComfyBoxStdPrompt";
import ComfyBoxStdPromptSerializer from "./ComfyBoxStdPromptSerializer";
export const COMFYBOX_SERIAL_VERSION = 1; export const COMFYBOX_SERIAL_VERSION = 1;
@@ -86,19 +87,21 @@ export type SerializedAppState = {
/** [link_origin, link_slot_index] | input_value */ /** [link_origin, link_slot_index] | input_value */
export type SerializedPromptInput = [ComfyNodeID, number] | any export type SerializedPromptInput = [ComfyNodeID, number] | any
export type SerializedPromptInputs = Record<string, SerializedPromptInput>;
/* /*
* A single node in the prompt and its input values. * A single node in the prompt and its input values.
*/ */
export type SerializedPromptInputs = { export type SerializedPromptInputsForNode = {
/* property name -> value or link */ /* property name -> value or link */
inputs: Record<string, SerializedPromptInput>, inputs: SerializedPromptInputs,
class_type: string class_type: string
} }
/* /*
* All nodes in the graph and their input values. * All nodes in the graph and their input values.
*/ */
export type SerializedPromptInputsAll = Record<ComfyNodeID, SerializedPromptInputs> export type SerializedPromptInputsAll = Record<ComfyNodeID, SerializedPromptInputsForNode>
export type SerializedPrompt = { export type SerializedPrompt = {
workflow: SerializedLGraph, workflow: SerializedLGraph,
@@ -144,10 +147,12 @@ export default class ComfyApp {
private queueItems: QueueItem[] = []; private queueItems: QueueItem[] = [];
private processingQueue: boolean = false; private processingQueue: boolean = false;
private promptSerializer: ComfyPromptSerializer; private promptSerializer: ComfyPromptSerializer;
private stdPromptSerializer: ComfyBoxStdPromptSerializer;
constructor() { constructor() {
this.api = new ComfyAPI(); this.api = new ComfyAPI();
this.promptSerializer = new ComfyPromptSerializer(); this.promptSerializer = new ComfyPromptSerializer();
this.stdPromptSerializer = new ComfyBoxStdPromptSerializer();
} }
async setup(): Promise<void> { async setup(): Promise<void> {
@@ -649,6 +654,9 @@ export default class ComfyApp {
console.debug(graphToGraphVis(this.lGraph)) console.debug(graphToGraphVis(this.lGraph))
console.debug(promptToGraphVis(p)) console.debug(promptToGraphVis(p))
const stdPrompt = this.stdPromptSerializer.serialize(p);
console.warn("STD", stdPrompt);
const extraData: ComfyBoxPromptExtraData = { const extraData: ComfyBoxPromptExtraData = {
extra_pnginfo: { extra_pnginfo: {
workflow: p.workflow, workflow: p.workflow,

View File

@@ -0,0 +1,35 @@
import type { ComfyBoxStdPrompt } from "$lib/ComfyBoxStdPrompt";
import type { SerializedPrompt } from "./ComfyApp";
import comfyStdPromptConverters from "$lib/comfyStdPromptConverters"
const COMMIT_HASH: string = "asdf";
export default class ComfyBoxStdPromptSerializer {
serialize(prompt: SerializedPrompt): ComfyBoxStdPrompt {
const stdPrompt: ComfyBoxStdPrompt = {
version: 1,
metadata: {
created_with: "ComfyBox",
commit_hash: COMMIT_HASH,
extra_data: {
comfybox: {
}
}
},
parameters: {}
}
for (const [nodeID, inputs] of Object.entries(prompt.output)) {
const classType = inputs.class_type
const converter = comfyStdPromptConverters[classType]
if (converter) {
converter(stdPrompt, inputs.inputs, nodeID)
}
else {
console.warn("No StdPrompt type converter for comfy class!", classType)
}
}
return stdPrompt
}
}

View File

@@ -2,7 +2,7 @@ import type ComfyGraph from "$lib/ComfyGraph";
import type { ComfyBackendNode } from "$lib/nodes/ComfyBackendNode"; import type { ComfyBackendNode } from "$lib/nodes/ComfyBackendNode";
import type ComfyGraphNode from "$lib/nodes/ComfyGraphNode"; import type ComfyGraphNode from "$lib/nodes/ComfyGraphNode";
import { GraphInput, GraphOutput, LGraph, LGraphNode, LLink, NodeMode, Subgraph, type SlotIndex } from "@litegraph-ts/core"; import { GraphInput, GraphOutput, LGraph, LGraphNode, LLink, NodeMode, Subgraph, type SlotIndex } from "@litegraph-ts/core";
import type { SerializedPrompt, SerializedPromptInput, SerializedPromptInputs, SerializedPromptInputsAll } from "./ComfyApp"; import type { SerializedPrompt, SerializedPromptInput, SerializedPromptInputsForNode, SerializedPromptInputsAll, SerializedPromptInputs } from "./ComfyApp";
import type IComfyInputSlot from "$lib/IComfyInputSlot"; import type IComfyInputSlot from "$lib/IComfyInputSlot";
function hasTag(node: LGraphNode, tag: string): boolean { function hasTag(node: LGraphNode, tag: string): boolean {
@@ -150,7 +150,7 @@ export class UpstreamNodeLocator {
} }
export default class ComfyPromptSerializer { export default class ComfyPromptSerializer {
serializeInputValues(node: ComfyBackendNode): Record<string, SerializedPromptInput> { serializeInputValues(node: ComfyBackendNode): SerializedPromptInputs {
// Store input values passed by frontend-only nodes // Store input values passed by frontend-only nodes
if (!node.inputs) { if (!node.inputs) {
return {} return {}

View File

@@ -49,10 +49,20 @@ export default function convertA1111ToStdPrompt(infotext: A1111ParsedInfotext):
const parameters: ComfyBoxStdParameters = {} const parameters: ComfyBoxStdParameters = {}
parameters.prompt = [{ parameters.conditioning = [
positive: infotext.positive, {
negative: infotext.negative, "^meta": {
}] types: ["positive"]
},
text: infotext.positive,
},
{
"^meta": {
types: ["negative"]
},
text: infotext.negative,
}
]
const hrUp = popOpt("hires upscale"); const hrUp = popOpt("hires upscale");
const hrSz = popOpt("hires resize"); const hrSz = popOpt("hires resize");
@@ -327,18 +337,16 @@ export default function convertA1111ToStdPrompt(infotext: A1111ParsedInfotext):
const prompt: ComfyBoxStdPrompt = { const prompt: ComfyBoxStdPrompt = {
version: 1, version: 1,
prompt: { metadata: {
metadata: { created_with: "stable-diffusion-webui",
created_with: "stable-diffusion-webui", app_version,
app_version, extra_data: {
extra_data: { a1111: {
a1111: { params: infotext.extraParams
params: infotext.extraParams
}
} }
}, }
parameters },
} parameters
} }
console.warn("Unhandled A1111 parameters:", infotext.extraParams, infotext.extraNetworks) console.warn("Unhandled A1111 parameters:", infotext.extraParams, infotext.extraNetworks)

View File

@@ -34,37 +34,42 @@ export default class convertA1111ToStdPromptTests extends UnitTest {
expect(converted).toEqual({ expect(converted).toEqual({
version: 1, version: 1,
prompt: { metadata: {
metadata: { created_with: "stable-diffusion-webui",
created_with: "stable-diffusion-webui", extra_data: {}
extra_data: {} },
}, parameters: {
parameters: { checkpoint: [{
checkpoint: [{ model_hashes: {
model_hashes: { a1111_shorthash: "925997e9",
a1111_shorthash: "925997e9", }
} }],
}], conditioning: [{
prompt: [{ "^meta": {
positive: "highest quality, masterpiece, best quality, masterpiece, asuka langley sitting cross legged on a chair", types: ["positive"]
negative: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts,signature, watermark, username, blurry, artist name" },
}], text: "highest quality, masterpiece, best quality, masterpiece, asuka langley sitting cross legged on a chair",
clip: [{ }, {
clip_skip: 2, "^meta": {
}], types: ["positive"]
k_sampler: [{ },
cfg_scale: 12, text: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts,signature, watermark, username, blurry, artist name"
denoise: 1, }],
sampler_name: "euler", clip: [{
scheduler: "normal", clip_skip: 2,
seed: 2870305590, }],
steps: 28 k_sampler: [{
}], cfg_scale: 12,
latent_image: [{ denoise: 1,
width: 512, sampler_name: "euler",
height: 512, scheduler: "normal",
}] seed: 2870305590,
} steps: 28
}],
latent_image: [{
width: 512,
height: 512,
}]
} }
}) })
@@ -105,61 +110,66 @@ export default class convertA1111ToStdPromptTests extends UnitTest {
expect(converted).toEqual({ expect(converted).toEqual({
version: 1, version: 1,
prompt: { metadata: {
metadata: { created_with: "stable-diffusion-webui",
created_with: "stable-diffusion-webui", extra_data: {}
extra_data: {} },
}, parameters: {
parameters: { checkpoint: [{
checkpoint: [{ model_name: "pastelmix-better-vae-fp16",
model_name: "pastelmix-better-vae-fp16", model_hashes: {
model_hashes: { a1111_shorthash: "0f0eaaa61e",
a1111_shorthash: "0f0eaaa61e", }
} }],
}], conditioning: [{
prompt: [{ "^meta": {
positive: "dreamlike fantasy landscape where everything is a shade of pink,\n dog ", types: ["positive"]
negative: "(worst quality:1.4), (low quality:1.4) , (monochrome:1.1)" },
}], text: "dreamlike fantasy landscape where everything is a shade of pink,\n dog ",
clip: [{ }, {
clip_skip: 2, "^meta": {
}], types: ["negative"]
hypernetwork: [{ },
model_name: "zxcfc", text: "(worst quality:1.4), (low quality:1.4) , (monochrome:1.1)"
strength: 0.5, }],
}], clip: [{
lora: [{ clip_skip: 2,
model_name: "asdfg", }],
strength_unet: 0.8, hypernetwork: [{
strength_tenc: 0.8, model_name: "zxcfc",
}], strength: 0.5,
k_sampler: [{ }],
cfg_scale: 12, lora: [{
denoise: 1, model_name: "asdfg",
sampler_name: "dpmpp_2m", strength_unet: 0.8,
scheduler: "karras", strength_tenc: 0.8,
seed: 2416682767, }],
steps: 40 k_sampler: [{
}, { cfg_scale: 12,
type: "upscale", denoise: 1,
cfg_scale: 12, sampler_name: "dpmpp_2m",
denoise: 0.55, scheduler: "karras",
sampler_name: "dpmpp_2m", seed: 2416682767,
scheduler: "karras", steps: 40
seed: 2416682767, }, {
steps: 20 type: "upscale",
}], cfg_scale: 12,
latent_image: [{ denoise: 0.55,
width: 640, sampler_name: "dpmpp_2m",
height: 512, scheduler: "karras",
}, { seed: 2416682767,
type: "upscale", steps: 20
width: 1280, }],
height: 1024, latent_image: [{
upscale_by: 2, width: 640,
upscale_method: "Latent" height: 512,
}] }, {
} type: "upscale",
width: 1280,
height: 1024,
upscale_by: 2,
upscale_method: "Latent"
}]
} }
}) })
@@ -205,58 +215,63 @@ export default class convertA1111ToStdPromptTests extends UnitTest {
expect(converted).toEqual({ expect(converted).toEqual({
version: 1, version: 1,
prompt: { metadata: {
metadata: { created_with: "stable-diffusion-webui",
created_with: "stable-diffusion-webui", extra_data: {}
extra_data: {} },
}, parameters: {
parameters: { checkpoint: [{
checkpoint: [{ model_name: "AbyssOrangeMix2_nsfw",
model_name: "AbyssOrangeMix2_nsfw", model_hashes: {
model_hashes: { a1111_shorthash: "0873291ac5",
a1111_shorthash: "0873291ac5", }
} }],
}], conditioning: [{
prompt: [{ "^meta": {
positive: "1girl, pink hair", types: ["positive"]
negative: "(worst quality, low quality:1.4)",
}],
lora: [{
module_name: "LoRA",
model_name: "ElysiaV3-000002",
model_hashes: {
addnet_shorthash: "6d3eb064dcc1"
},
strength_unet: 0.9,
strength_tenc: 0.7,
}, },
{ text: "1girl, pink hair",
module_name: "LoRA", }, {
model_name: "elfmorie2", "^meta": {
model_hashes: { types: ["negative"]
addnet_shorthash: "a34cd9a8c3cc" },
}, text: "(worst quality, low quality:1.4)",
strength_unet: 1, }],
strength_tenc: 0.8, lora: [{
}], module_name: "LoRA",
k_sampler: [{ model_name: "ElysiaV3-000002",
cfg_scale: 6, model_hashes: {
denoise: 0.2, addnet_shorthash: "6d3eb064dcc1"
sampler_name: "dpmpp_sde", },
scheduler: "karras", strength_unet: 0.9,
seed: 780207036, strength_tenc: 0.7,
steps: 20 },
}], {
latent_image: [{ module_name: "LoRA",
width: 512, model_name: "elfmorie2",
height: 768, model_hashes: {
mask_blur: 1 addnet_shorthash: "a34cd9a8c3cc"
}], },
sd_upscale: [{ strength_unet: 1,
upscaler: "4x_Valar_v1", strength_tenc: 0.8,
overlap: 64 }],
}] k_sampler: [{
} cfg_scale: 6,
denoise: 0.2,
sampler_name: "dpmpp_sde",
scheduler: "karras",
seed: 780207036,
steps: 20
}],
latent_image: [{
width: 512,
height: 768,
mask_blur: 1
}],
sd_upscale: [{
upscaler: "4x_Valar_v1",
overlap: 64
}]
} }
}) })