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.
@@ -2,7 +2,7 @@ import {
2
2
  extractErrorMessage,
3
3
  stripAnsi,
4
4
  DefinedWorkflow
5
- } from "./chunk-xk25ecw5.js";
5
+ } from "./chunk-6tsg7fm5.js";
6
6
 
7
7
  // src/cli/tui/treeRows.ts
8
8
  import { basename, dirname } from "pathe";
@@ -576,4 +576,4 @@ function findDefinedWorkflow(mod) {
576
576
  export { moduleName, familyOf, assignFamilyColors, buildFileRows, ENHANCE_KEY, isDraftMetaKey, assembleLogChunks, LogsSt, draftKeyForFile, draftsDirForFile, listDraftsForFile, DraftsSt, scanCflowFiles, mergeWorkflowSources, findDefinedWorkflow };
577
577
 
578
578
  //# debugId=C9A6EC268910514364756E2164756E21
579
- //# sourceMappingURL=chunk-y714t866.js.map
579
+ //# sourceMappingURL=chunk-6mgjbrp6.js.map
@@ -494,6 +494,9 @@ function looksLikeImage(bytes) {
494
494
  const is = (sig, off = 0) => sig.every((v, i) => b[off + i] === v);
495
495
  return is([137, 80, 78, 71]) || is([255, 216, 255]) || is([71, 73, 70]) || is([82, 73, 70, 70]) && is([87, 69, 66, 80], 8);
496
496
  }
497
+ function previewContentTypeMayBeImage(ct) {
498
+ return ct === "" || ct.startsWith("image/") || ct.startsWith("application/octet-stream");
499
+ }
497
500
  async function fetchLoraPreviewBytes(host, previewUrl) {
498
501
  const storage = getComfyStorage();
499
502
  const cachePath = comfyts.resolveFromCache(`lora-previews/${sha1HexOfString(previewUrl)}`);
@@ -503,8 +506,7 @@ async function fetchLoraPreviewBytes(host, previewUrl) {
503
506
  const res = await host.fetch(previewUrl, {}, { apiPrefix: false });
504
507
  if (!res.ok)
505
508
  return null;
506
- const ct = res.headers.get("content-type") ?? "";
507
- if (ct !== "" && !ct.startsWith("image/"))
509
+ if (!previewContentTypeMayBeImage(res.headers.get("content-type") ?? ""))
508
510
  return null;
509
511
  const bytes = new Uint8Array(await res.arrayBuffer());
510
512
  if (!looksLikeImage(bytes))
@@ -1870,5 +1872,5 @@ function summarizeDrift(d) {
1870
1872
 
1871
1873
  export { extractErrorMessage, sha1HexOfString, statelessRegex, isQuiet, logInfo, logError, logSuccess, resolveComfyStorage, getComfyStorage, bang, isRecord, importSharp, hashArrayBuffer, MEDIA_KINDS, DEFAULT_MEDIA_EXTENSIONS, extensionOf, isVideoFilename, mediaMime, MODEL_3D_MIMES, model3dMime, ansi, stripAnsi, colorsAvailable, lmFolder, lmModelName, lmBaseModel, lmSha256, lmFileSize, lmNotes, lmCivitai, lmTags, lmTrainedWords, lmFilePath, loraKey, loraBasename, fetchLoraCivitai, fetchLoraDescription, fetchLoraExampleImages, fetchLoraList, loraPreviewMapFrom, fetchLoraPreviewBytes, buildLoraMirror, writeLoraMirror, readLoraMirror, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, getLoraInfo, getLoraTriggerWords, getLoraDisplayName, getLoraTriggers, recordCivitaiMiss, getLoraAddedAt, getLoraPreviewUrl, loraMirrorEntries, loraMatchesFilter, lorasMissingFromMirror, getLoraKeyword, isLoraKeywordFromMirror, loraKeywordFromMirror, clearLoraKeywordOverride, setLoraKeyword, isLoraStrength, isPromptInput, isLoraLanes, isLorasInput, PromptVar, LorasVar, DefinedWorkflow, MODEL_LISTS, diffSchemas, driftChanged, summarizeDrift };
1872
1874
 
1873
- //# debugId=CD3EDEAE3C532E4864756E2164756E21
1874
- //# sourceMappingURL=chunk-xk25ecw5.js.map
1875
+ //# debugId=F31026EF6BD649FB64756E2164756E21
1876
+ //# sourceMappingURL=chunk-6tsg7fm5.js.map