ComfyUI Node

CLIP Save Qwen

Save a Qwen text encoder without the key-prefix mess

By easygoing0114·Created 12 months ago·Updated 5 days ago· 5
CLIP Save Qwen
  • clip
    filename_prefixqwen_2.5_vl_merged

    Qwen-2.5-VL-7B is the text encoder doing the heavy lifting in Qwen-Image workflows - and the same CLIP shows up as the standalone text encoder in a lot of split-encoder setups - and ComfyUI loads it with an internal qwen25_7b.transformer. prefix slapped on every key. That prefix is invisible to you - it's a bookkeeping detail of the loader - but the moment you try to save the thing back out as a file you'd load again, it becomes your problem. A file full of qwen25_7b.transformer.* keys won't match what the standard loader expects. CLIP Save Qwen exists to fix exactly that.

    It's a save node, the dead-simple output end of the Qwen CLIP tooling in this pack. Wire in the CLIP you just finished editing - say, the output of CLIP Scale Qwen Block - give it a filename, and it writes a .safetensors to ComfyUI's output folder with the prefix stripped, so the keys line up the way the loader wants them on the next load.

    What you actually set

    Two inputs, that's it:

    • clip - the CLIP object to save. Usually the output of one of the CLIP scale/merge nodes in this pack, or a CLIP you built in the graph.
    • filename_prefix - the base name, defaulting to qwen_2.5_vl_merged. The node appends a counter (_00001_ style) so you never overwrite a previous save.

    There are no outputs, and that's correct: it's an output node, the last stop on the line.

    How the save works

    Under the hood it pulls clip.get_sd() and walks every key. Anything starting with qwen25_7b.transformer. gets that whole prefix chopped off; keys starting with just qwen25_7b. get the shorter prefix stripped too; everything else passes through untouched. Then it writes the file with save_torch_file, embedding the current prompt as metadata unless you've disabled metadata. The mechanism is deliberately conservative - it only rewrites the prefixes, it never renames or reorders anything else.

    This pairs naturally with the pack's other Qwen-CLIP node: scale some layers, inspect the result, save it, and you've got a custom text encoder you can reuse in other workflows instead of re-running the scale every time.

    Install

    The pack is registered in the ComfyUI Registry, so the easy path is the Manager: open it, search Easygoing, install. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/easygoing0114/ComfyUI-easygoing-nodes.git
    

    Then restart ComfyUI. Two things to know up front: there are no extra pip dependencies to download (the pack leans on ComfyUI's bundled torch, safetensors, and friends), and it needs a reasonably current ComfyUI build - the nodes are written against the V3 node API (comfy_api.latest), so on an old ComfyUI they simply won't register. If they don't show up after install, update ComfyUI first and look again.

    Gotchas

    The saved file lands in ComfyUI/output, not models/ - that trips people up. And remember what you saved: it's a text encoder, not a full checkpoint. Load it back with a CLIP loader that expects the Qwen-2.5-VL layout, then feed it into a CLIP Text Encode node. If you see "clip input is invalid" style errors later, it's usually a loading mismatch, not a save bug.

    Categoryadvanced/model_merging/model_specific

    Inputs (2)

    NameTypeDefaultDescription
    clipCLIP
    filename_prefixSTRINGqwen_2.5_vl_merged

    Outputs (0)

    No outputs