comfyui-mcp 0.50.43 → 0.50.44

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.
@@ -8547,7 +8547,39 @@ export function buildPanelToolDefs() {
8547
8547
  }, async (args, ctx) => {
8548
8548
  const items = args.items;
8549
8549
  const IMAGE_EXTS = new Set([".png", ".jpg", ".jpeg", ".gif", ".webp"]);
8550
- const VIDEO_EXTS = new Set([".mp4", ".webm"]);
8550
+ // #811 this used to be just {.mp4, .webm}, narrower than what this
8551
+ // codebase ALREADY treats as video elsewhere: get_image's
8552
+ // action:"list_outputs" documents ".mp4/.webm/.mov/.mkv/.m4v/.avi", and
8553
+ // upload_image's action:"video" accepts the identical set. A ProRes
8554
+ // .mov produced by VHS/standard ComfyUI video nodes was refused here
8555
+ // even though every other tool in this codebase already calls it a
8556
+ // valid video output. Aligned to the same set both of those already use.
8557
+ //
8558
+ // This widens the CONTAINER-extension gate only — it does not and
8559
+ // cannot guarantee browser-side codec decode (a ProRes stream inside
8560
+ // that .mov may still not play natively outside Safari). That is a
8561
+ // downstream browser limitation, not a reason to refuse the file
8562
+ // upfront: the panel's video path already degrades gracefully when a
8563
+ // codec can't be decoded (falls back to a native <video> element,
8564
+ // which surfaces the browser's own playback error, rather than
8565
+ // silently failing) — an honest browser failure is a strictly better
8566
+ // outcome than a blanket refusal at this gate for every .mov file,
8567
+ // most of which (H.264/H.265-encoded) play back completely fine.
8568
+ const VIDEO_EXTS = new Set([".mp4", ".webm", ".mov", ".mkv", ".m4v", ".avi"]);
8569
+ // Real IANA subtypes. The old code built video MIME by naive
8570
+ // `"video/" + ext.slice(1)`, which only ever worked for .mp4/.webm by
8571
+ // COINCIDENCE (their extension equals their MIME subtype) — extended to
8572
+ // .mov/.mkv/.avi it would have produced invalid types (`video/mov`
8573
+ // instead of `video/quicktime`), and a wrong MIME can make a browser
8574
+ // refuse to even ATTEMPT playback before the codec is ever considered.
8575
+ const VIDEO_MIME = {
8576
+ ".mp4": "video/mp4",
8577
+ ".webm": "video/webm",
8578
+ ".mov": "video/quicktime",
8579
+ ".mkv": "video/x-matroska",
8580
+ ".m4v": "video/x-m4v",
8581
+ ".avi": "video/x-msvideo",
8582
+ };
8551
8583
  const MAX_BYTES = 20 * 1024 * 1024; // 20 MB
8552
8584
  const resolved = [];
8553
8585
  /** Oversized items that took the /view reference route instead (#648). */
@@ -8601,7 +8633,7 @@ export function buildPanelToolDefs() {
8601
8633
  kind = "image";
8602
8634
  }
8603
8635
  else if (VIDEO_EXTS.has(ext)) {
8604
- mime = "video/" + ext.slice(1);
8636
+ mime = VIDEO_MIME[ext];
8605
8637
  kind = "video";
8606
8638
  }
8607
8639
  else {