<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://ainjuzen.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://ainjuzen.github.io/" rel="alternate" type="text/html" hreflang="zh-CN" /><updated>2026-11-08T16:41:25+00:00</updated><id>https://ainjuzen.github.io/feed.xml</id><title type="html">痒局长</title><subtitle>被卡住了，才动手写的小工具</subtitle><entry><title type="html">Manager 装好了，打开是空的</title><link href="https://ainjuzen.github.io/2026/11/08/manager-blank.html" rel="alternate" type="text/html" title="Manager 装好了，打开是空的" /><published>2026-11-08T16:15:00+00:00</published><updated>2026-11-08T16:15:00+00:00</updated><id>https://ainjuzen.github.io/2026/11/08/manager-blank</id><content type="html" xml:base="https://ainjuzen.github.io/2026/11/08/manager-blank.html"><![CDATA[<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ComfyUI-Manager 已安装 ✓
点开 Model Manager
→ 一片空白
→ 控制台：Failed to get external model list
</code></pre></div></div>

<p><strong>它默认去 <code class="language-plaintext highlighter-rouge">raw.githubusercontent.com</code> 拿节点清单。那个域名，在很多网络里是连不上的。</strong></p>

<p><strong>不是 Manager 写错了，是这个默认值对一部分人不成立。</strong></p>

<hr />

<h2 id="我一开始写了个一键修复脚本">我一开始写了个「一键修复」脚本</h2>

<p>四个步骤，跑完就重启，能用。</p>

<p><strong>然后我意识到一个问题：Manager 一升级，它就被顶掉了。</strong></p>

<p><strong>用户不知道要重跑一次，于是列表又空了，然后他会觉得「这工具坏了」。</strong></p>

<hr />

<h2 id="所以换了个形态诊断器优先">所以换了个形态：诊断器优先</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>--check     只诊断：Manager 哪一版、哪些地址没走镜像、镜像通不通
--fix       改（幂等，可反复跑）
--verify    只验：真去把清单拉一遍
</code></pre></div></div>

<p><strong><code class="language-plaintext highlighter-rouge">--check</code> 是主角，<code class="language-plaintext highlighter-rouge">--fix</code> 是配角。</strong></p>

<p><strong>为什么？因为「改官方源码」这件事一定会随版本失效。
但即使失效，<code class="language-plaintext highlighter-rouge">--check</code> 也应该准确地告诉你「我修不了」，而不是静默失败。</strong></p>

<p><strong>一个会说「我修不了」的工具有用；
一个假装修好了的工具有害。</strong></p>

<hr />

<h2 id="它到底改什么四处都列出来">它到底改什么（四处，都列出来）</h2>

<table>
  <thead>
    <tr>
      <th>#</th>
      <th>改哪</th>
      <th>改成什么</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td><code class="language-plaintext highlighter-rouge">user\__manager\channels.list</code></td>
      <td>6 个频道地址加镜像前缀</td>
    </tr>
    <tr>
      <td>2</td>
      <td><code class="language-plaintext highlighter-rouge">user\__manager\config.ini</code></td>
      <td><code class="language-plaintext highlighter-rouge">channel_url</code> 指向镜像</td>
    </tr>
    <tr>
      <td>3</td>
      <td><code class="language-plaintext highlighter-rouge">custom_nodes\ComfyUI-Manager</code> 里 <code class="language-plaintext highlighter-rouge">.py</code> / <code class="language-plaintext highlighter-rouge">.template</code> 中写死的地址</td>
      <td>加镜像前缀</td>
    </tr>
    <tr>
      <td>4</td>
      <td><code class="language-plaintext highlighter-rouge">glob\manager_downloader.py</code></td>
      <td>模型下载默认走 hf-mirror</td>
    </tr>
  </tbody>
</table>

<p><strong>每个改动的文件旁边留一份 <code class="language-plaintext highlighter-rouge">.bak_managerfix</code>，原样可回滚。</strong></p>

<hr />

<h2 id="两个技术上的坑">两个技术上的坑</h2>

<p><strong>① 幂等不能靠「跑两次结果一样」，要靠正则</strong></p>

<p>镜像地址里包含原始地址：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://ghfast.top/https://raw.githubusercontent.com/...
                 ↑ 这一段会被下次替换再包一层
</code></pre></div></div>

<p><strong>不处理的话，第二次跑就变成 <code class="language-plaintext highlighter-rouge">ghfast.top/ghfast.top/https://...</code>。</strong></p>

<p><strong>解决办法是负向后视断言，只在「还没被包过」的位置替换，再加一条折叠正则兜底。</strong></p>

<p><strong>② 自动找 ComfyUI 目录比想象中难</strong></p>

<p><strong>桌面版把实例放在 <code class="language-plaintext highlighter-rouge">installPath\ComfyUI\</code>——往下还有一层。</strong></p>

<p><strong>第一版只查了一层，结果在真机上「找不到 ComfyUI」。</strong></p>

<p><strong>修法是：拿到候选目录后，自己也查一次，再查它的 <code class="language-plaintext highlighter-rouge">ComfyUI</code> 子目录。</strong></p>

<hr />

<h2 id="一句话">一句话</h2>

<blockquote>
  <p><strong>会碎不是不发的理由，是要发出一个碎的时候会说实话的版本。</strong></p>
</blockquote>]]></content><author><name></name></author><category term="comfyui" /><category term="manager" /><category term="镜像" /><summary type="html"><![CDATA[它默认拉 raw.githubusercontent.com。这个域名在很多网络里连不上。]]></summary></entry><entry><title type="html">下了模型，然后站在目录前面发呆</title><link href="https://ainjuzen.github.io/2026/11/08/which-folder.html" rel="alternate" type="text/html" title="下了模型，然后站在目录前面发呆" /><published>2026-11-08T16:12:00+00:00</published><updated>2026-11-08T16:12:00+00:00</updated><id>https://ainjuzen.github.io/2026/11/08/which-folder</id><content type="html" xml:base="https://ainjuzen.github.io/2026/11/08/which-folder.html"><![CDATA[<p>迅雷把文件拽到桌面了。<code class="language-plaintext highlighter-rouge">moss_image_edit.safetensors</code>，5 GB。</p>

<p>然后呢？</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>checkpoints？vae？loras？diffusion_models？
</code></pre></div></div>

<p><strong>放错了，ComfyUI 里就看不到它；更糟的是，看到了但加载报错。</strong></p>

<hr />

<h2 id="网上的答案看文件名">网上的答案：看文件名</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>带 vae 的放 vae
带 lora 的放 loras
带 clip 的放 text_encoders
</code></pre></div></div>

<p><strong>新模型根本不在文件名里写这些。</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>krea2_turbo_fp8_scaled.safetensors     ← 名字里没有任何结构线索
moss_image_edit.safetensors            ← 看着像主干，其实是 LoRA
z_image_turbo_bf16.safetensors         ← 看不出是 DiT
</code></pre></div></div>

<p><strong>光靠文件名，这三个我一个都放不对。</strong></p>

<hr />

<h2 id="换个思路读文件内部">换个思路：读文件内部</h2>

<p><code class="language-plaintext highlighter-rouge">.safetensors</code> 的头里写着每个张量的名字。<strong>那些名字就是结构的指纹。</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>encoder.down.* + decoder.up.*        →  VAE
blocks.0.attn.wq/wk/wv + mlp.gate    →  DiT 主干（Krea / Chroma 那类）
layers.0.proj.k.lora_A / lora_B      →  LoRA（哪怕文件名里没有 lora）
model.language_model.*               →  文本编码器（Qwen3-VL 那类）
cap_embedder / noise_refiner         →  DiT（Z-Image 那类）
</code></pre></div></div>

<p><strong>只读头部，通常几百 KB，不加载权重。</strong></p>

<hr />

<h2 id="12-条规则是这么一条条试出来的">12 条规则是这么一条条试出来的</h2>

<p><strong>没有人给我这份表。是我拿本机模型库里每个文件，把它的前几个张量名打出来，一条条对照着写的。</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>MOSS-Image   → layers.N.proj.*     （没有 model.diffusion_model 前缀）
Krea / Chroma → blocks.N.attn.wq   （没有 double_blocks，也不是 layers）
Qwen3-VL     → model.language_model.layers.*  （比 model.layers 多一层）
</code></pre></div></div>

<p><strong>每认出一个新结构，就往表里加一条。加完再跑一遍全库，看有没有把别的判错。</strong></p>

<hr />

<h2 id="现在的成绩">现在的成绩</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>本机模型库 15 个真实文件
判出        15 / 15
与现有目录一致  14 / 15
</code></pre></div></div>

<p><strong>那个「不一致」的，是 <code class="language-plaintext highlighter-rouge">moss_image_edit.safetensors</code>——它现在躺在一个叫 <code class="language-plaintext highlighter-rouge">moss-image-edit\</code> 的非标准目录里。</strong></p>

<p><strong>但它的张量是 <code class="language-plaintext highlighter-rouge">layers.N.proj.k.lora_A/lora_B</code>，它确实是 LoRA。</strong></p>

<p><strong>所以是我的判定对，是那个文件放错了地方。</strong></p>

<hr />

<h2 id="三条我坚持要有的规矩">三条我坚持要有的规矩</h2>

<p><strong>它要移动你的文件，所以：</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>① 绝不覆盖
   同名同大小 → 跳过
   同名不同大小 → 另存 xxx_1.safetensors，原文件不动

② 判不出来就不动
   只说「判断不出来」，不猜、不乱放

③ --dry-run 先看
   报告会放到哪，一个字节都不动
</code></pre></div></div>

<p><strong>「判不出来」比「猜错了」好一百倍。猜错了用户不会知道，直到加载报错。</strong></p>

<hr />

<h2 id="一句话">一句话</h2>

<blockquote>
  <p><strong>文件名是别人起的，张量名是模型自己长的。</strong>
<strong>信模型自己。</strong></p>
</blockquote>]]></content><author><name></name></author><category term="comfyui" /><category term="safetensors" /><category term="模型" /><summary type="html"><![CDATA[文件名不会告诉你它是什么模型。但 safetensors 头里的张量名会。]]></summary></entry><entry><title type="html">官方那个「下载」按钮，在国内基本按不动</title><link href="https://ainjuzen.github.io/2026/11/08/official-download-button.html" rel="alternate" type="text/html" title="官方那个「下载」按钮，在国内基本按不动" /><published>2026-11-08T16:10:00+00:00</published><updated>2026-11-08T16:10:00+00:00</updated><id>https://ainjuzen.github.io/2026/11/08/official-download-button</id><content type="html" xml:base="https://ainjuzen.github.io/2026/11/08/official-download-button.html"><![CDATA[<p>打开别人分享的工作流，右边红字：<strong>缺失模型</strong>。</p>

<p>点官方的「下载」——它直连 <code class="language-plaintext highlighter-rouge">huggingface.co</code>，转圈，然后没了。</p>

<p>我一开始以为是网速。后来把桌面版拆开数了一遍：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>对 resources\app.asar（64 MB）做字符串统计：
    hf-mirror           0 处
    modelscope          0 处
    HF_ENDPOINT         0 处
    useChineseMirrors   136 处  ← 但它的标签是
                                 "Use Chinese Mirrors (Git &amp; PyPI)"
</code></pre></div></div>

<p><strong>那个开关只管 Git 和 pip，不管模型文件。</strong></p>

<p>所以在国内网络下，模型下载这一块，官方是空的。</p>

<hr />

<h2 id="三条路只有两条通">三条路，只有两条通</h2>

<table>
  <thead>
    <tr>
      <th>通道</th>
      <th>走法</th>
      <th>支不支持镜像</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>桌面版标题栏 Downloads</td>
      <td>Electron 直连 huggingface.co</td>
      <td>❌ 没有开关</td>
    </tr>
    <tr>
      <td>Manager「模型」页</td>
      <td>Python 下载器</td>
      <td>✅ 认 <code class="language-plaintext highlighter-rouge">HF_ENDPOINT</code></td>
    </tr>
    <tr>
      <td>终端 <code class="language-plaintext highlighter-rouge">hf</code></td>
      <td>huggingface_hub</td>
      <td>✅ 认</td>
    </tr>
    <tr>
      <td>迅雷 / aria2c</td>
      <td>你给它的直链</td>
      <td>✅ 换个域名就行</td>
    </tr>
  </tbody>
</table>

<p><strong>问题不是「没有镜像」，是「点了那个按钮走的是不通的那条」。</strong></p>

<hr />

<h2 id="于是做了这个">于是做了这个</h2>

<p>在「缺失模型」面板的同一个位置，加一个 <strong>「镜像补缺」</strong> 按钮：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>扫出缺哪些文件
   ↓
按文件名去镜像反查官方仓库，优先 Comfy-Org/*
   ↓
断点续传下到 models/&lt;type&gt;/
</code></pre></div></div>

<p><strong>它不修改 ComfyUI 任何文件</strong>——因为它是扩展，不是补丁。升级不碎。</p>

<hr />

<h2 id="两个反查上的坑值得写下来">两个反查上的坑，值得写下来</h2>

<p><strong>① 不能用前缀当搜索词</strong></p>

<p><code class="language-plaintext highlighter-rouge">qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors</code> 这个文件，仓库叫 <code class="language-plaintext highlighter-rouge">MiniMax-H3</code>。
用前缀 <code class="language-plaintext highlighter-rouge">qwen3vl</code> 去搜，永远搜不到它。</p>

<p><strong>改成取所有相邻词对</strong>——<code class="language-plaintext highlighter-rouge">minimax_h3</code> 出现在搜索词里，才搜得到。</p>

<p><strong>② 「搜到官方仓库就停」是个陷阱</strong></p>

<p>我当初写了个「已经有 Comfy-Org 的候选就不必再搜」的提前退出。
结果第一个关键词命中了<strong>无关</strong>的 Comfy-Org 仓库（Qwen），于是它再也不搜 <code class="language-plaintext highlighter-rouge">minimax</code>。</p>

<p><strong>四个文件全找不到，两个 bug 叠在一起。</strong></p>

<p>修完之后：35 秒 → 8-11 秒（关键词并行 + 仓库并行探测），四个文件全部命中。</p>

<hr />

<h2 id="一句话">一句话</h2>

<blockquote>
  <p><strong>缺模型不是用户的错，是这个按钮指错了地方。</strong>
<strong>我把按钮指对，剩下的不动。</strong></p>
</blockquote>]]></content><author><name></name></author><category term="comfyui" /><category term="mirror" /><category term="下载" /><summary type="html"><![CDATA[把桌面版拆开数了一遍：hf-mirror 出现 0 次。于是做了个扩展，在同一个位置加一个镜像补缺按钮。]]></summary></entry></feed>