comfy-ts 2.25.0 → 2.25.1
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/dist/{chunk-y714t866.js → chunk-6mgjbrp6.js} +2 -2
- package/dist/{chunk-xk25ecw5.js → chunk-6tsg7fm5.js} +6 -4
- package/dist/{chunk-xk25ecw5.js.map → chunk-6tsg7fm5.js.map} +3 -3
- package/dist/{chunk-qw7be3v5.js → chunk-dvxjvwe7.js} +3 -3
- package/dist/{chunk-17hrzqcr.js → chunk-dw0t1nye.js} +5 -5
- package/dist/{chunk-3vhqs473.js → chunk-he70ewwx.js} +4 -4
- package/dist/{chunk-94f854t1.js → chunk-n22qz0j1.js} +4 -4
- package/dist/{chunk-94f854t1.js.map → chunk-n22qz0j1.js.map} +1 -1
- package/dist/{chunk-tye3z60z.js → chunk-n35nffm8.js} +4 -4
- package/dist/cli.js +5 -5
- package/dist/host/loraManagerApi.d.cts +1 -1
- package/dist/host/loraManagerApi.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/serve-web.js +1 -1
- package/dist/web.js +2 -2
- package/dist/web.js.map +2 -2
- package/package.json +1 -1
- package/src/cli/serve/web/components/controls/LorasControl.tsx +2 -0
- package/src/host/loraManagerApi.ts +8 -3
- /package/dist/{chunk-y714t866.js.map → chunk-6mgjbrp6.js.map} +0 -0
- /package/dist/{chunk-qw7be3v5.js.map → chunk-dvxjvwe7.js.map} +0 -0
- /package/dist/{chunk-17hrzqcr.js.map → chunk-dw0t1nye.js.map} +0 -0
- /package/dist/{chunk-3vhqs473.js.map → chunk-he70ewwx.js.map} +0 -0
- /package/dist/{chunk-tye3z60z.js.map → chunk-n35nffm8.js.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comfy-ts",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.1",
|
|
4
4
|
"description": "An efficient way to create, run, maintain and operate your ComfyUI workflows, for humans and agents. A TypeScript SDK typed from your own install, with a CLI, a terminal UI, a web panel and a guide for coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comfyui",
|
|
@@ -193,6 +193,8 @@ export const LorasControl = observer(function LorasControl(p: {
|
|
|
193
193
|
openFor(ix: number) {
|
|
194
194
|
this.target = ix
|
|
195
195
|
this.open = true
|
|
196
|
+
// a thumb that failed while the host was down tries again on the next open, not only on a reload
|
|
197
|
+
this.previewFailed.clear()
|
|
196
198
|
},
|
|
197
199
|
setOpen(open: boolean) {
|
|
198
200
|
this.open = open
|
|
@@ -318,11 +318,17 @@ export function looksLikeImage(bytes: Uint8Array): boolean {
|
|
|
318
318
|
)
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
/** a gate before the body is read, the magic bytes decide after it. octet-stream passes: a
|
|
322
|
+
* Windows python mimetypes table lacks webp, so lora-manager there serves every .webp so */
|
|
323
|
+
function previewContentTypeMayBeImage(ct: string): boolean {
|
|
324
|
+
return ct === '' || ct.startsWith('image/') || ct.startsWith('application/octet-stream')
|
|
325
|
+
}
|
|
326
|
+
|
|
321
327
|
/**
|
|
322
328
|
* fetch a preview image's bytes from its server-relative preview_url.
|
|
323
329
|
* cached on success at `.comfy-ts/cache/lora-previews/<sha1(url)>`. Returns null
|
|
324
330
|
* when the file is missing: lora-manager SPA-fallbacks to index.html (HTML), so
|
|
325
|
-
*
|
|
331
|
+
* an html or video content-type OR non-image magic bytes => no preview, not a crash.
|
|
326
332
|
*/
|
|
327
333
|
export async function fetchLoraPreviewBytes(host: ComfyHost, previewUrl: string): Promise<Uint8Array | null> {
|
|
328
334
|
const storage = getComfyStorage()
|
|
@@ -332,8 +338,7 @@ export async function fetchLoraPreviewBytes(host: ComfyHost, previewUrl: string)
|
|
|
332
338
|
// preview_url is already a full server-relative path — no /api probing
|
|
333
339
|
const res = await host.fetch(previewUrl, {}, { apiPrefix: false })
|
|
334
340
|
if (!res.ok) return null
|
|
335
|
-
|
|
336
|
-
if (ct !== '' && !ct.startsWith('image/')) return null // HTML fallback etc.
|
|
341
|
+
if (!previewContentTypeMayBeImage(res.headers.get('content-type') ?? '')) return null
|
|
337
342
|
const bytes = new Uint8Array(await res.arrayBuffer())
|
|
338
343
|
if (!looksLikeImage(bytes)) return null
|
|
339
344
|
storage.writeBytes(cachePath, bytes)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|