Z-Image Save Text Encoder
Bake your patched Qwen text encoder to disk so you never re-patch it
- raw_clip
Z-Image's text encoder is Qwen3-4B - 4 billion parameters, a huge chunk of the model's footprint, and increasingly the thing people patch. If you've ever loaded a text-encoder LoRA, baked a patched CLIP through the pack's ZImageComfyUninjector, or just want the same Qwen encoder available to every workflow without rebuilding it, this is the node that makes the result permanent. It takes a RAW_CLIP and writes it to disk as a standalone safetensors text encoder.
How it works
It's an output node with exactly two inputs:
raw_clip(RAW_CLIP) - the patched state dict, fresh from a Zlycoris loader or uninjector.filename_prefix- defaultqwen_patched, no extension needed.
That's it. The node saves the state dict to ComfyUI/output/text_encoders/<prefix>.safetensors and returns nothing. The next time you want that encoder, load it with any standard text encoder loader instead of re-running your whole patch pipeline. Because the Qwen TE is a big model, baking it once and loading it cold is meaningfully faster than re-patching every run - and it makes your workflow exportable, since the heavy lifting is now just a file.
This is the text-encoder half of the pack's saving story. There's a sibling ZImageSaveTransformer node that does the same thing for the diffusion transformer (RAW_MODEL → output/diffusion_models/), in case the two get mixed up.
When you'd chain it
The natural flow is: ZImageLoaderAndPatcher (or the AITK loader) applies your LyCORIS/LoRA patches to the raw Qwen state dict → ZImageSaveTextEncoder writes the result → done, forever. Same idea with a standard-LoRA workflow: apply the LoRA with the regular Load LoRA, pull the baked model back to raw with ZImageComfyUninjector, then save. The pattern that motivates this whole pack is "patch once, reuse everywhere," and this node is the reusable artifact at the end.
Install
ComfyUI Manager (search ComfyUI-Zlycoris) or:
cd ComfyUI/custom_nodes
git clone https://github.com/TripleHeadedMonkey/ComfyUI-Zlycoris.git
Restart ComfyUI. No model downloads - this is tooling, not weights.
Gotchas
- Empty input is silently ignored. If
raw_clipisNone(say, you only loaded a transformer upstream), the node does nothing and quietly returns. No error, no file. If you save and find nothing inoutput/text_encoders/, check that a realRAW_CLIPreached the input. - It's a state-dict dump, not a quantization step. What you save is exactly what the raw wrapper held. A GGUF-derived raw clip was already dequantized by the loader, so you'd be saving a full-precision file - big, but valid.
- File lands in
output/, notmodels/. If you want it in thetext_encodersfolder that dropdowns read from, move it there once and re-scan. The node only ever writes to output. - The default prefix is
qwen_patched, so if you save multiple variants without changing it, later runs overwrite earlier ones. Set the prefix to something meaningful likeqwen3_te_character_lorathe first time.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| raw_clip | RAW_CLIP | — | |
| filename_prefix | STRING | qwen_patched | — |
Outputs (0)
No outputs