Nodes/ComfyUI-Zlycoris/Z-Image Save Transformer
ComfyUI Node

Z-Image Save Transformer

When a LoRA deserves to be part of the file

By TripleHeadedMonkey·Created 7 months ago·Updated 7 months ago· 4
Z-Image Save Transformer
  • raw_model
    filename_prefixz_image_patched

    Most ComfyUI nodes are cogs inside a generation. This one is the exit ramp. Z-Image Save Transformer takes a RAW_MODEL - the raw state dict that Zlycoris's other nodes have been poking at - and writes it to disk as a .safetensors in output/diffusion_models/. Two inputs, zero outputs, and no sampler anywhere in sight. If this node is in your graph, the real work is already done; this is the save button.

    It's the natural endpoint of Zlycoris's "raw patching" philosophy. Where normal ComfyUI applies a LoRA as a live patch on top of a loaded model, this pack deliberately steps outside that abstraction: it loads weight tensors directly, bakes LoRAs in, merges checkpoints, dequantizes, and passes results around as RAW_MODEL / RAW_CLIP. This node is what turns all that invisible surgery into a file you can load, share, or feed into GGUF conversion later.

    Why would you want that? The big one is permanence. Bake a LoRA into Z-Image (Alibaba's 6B model that became the 12GB-card darling) and you stop worrying about loader compatibility, the Base-trained-LoRA-needs-2.0-strength-on-Turbo mismatch saga, or multi-LoRA stacking collapse - the weights are already fused. It's also the clean way to export the result of a raw merge (TIES, vector, plain additive) as a concrete checkpoint instead of a dangling in-memory object.

    The inputs - and that's the whole list:

    • raw_model (RAW_MODEL): any Zlycoris node that emits RAW_MODEL, like the Universal LoRA Loader, Loader & Patcher, or the merge nodes. The socket only accepts this pack's type, so you can't hang a standard ComfyUI MODEL off it.
    • filename_prefix (STRING, default z_image_patched): becomes the file name.

    The node is flagged as an output node, so it has to be in the graph for the workflow to execute - and it passes nothing onward.

    How it works: dead simple under the hood. It calls save_file(raw_model.sd, path), where path is output/diffusion_models/{filename_prefix}.safetensors, creating the folder if it doesn't exist. That's the whole mechanism, and it's reliable precisely because it is.

    Gotchas: there's no dedupe. Re-run with the same prefix and it happily overwrites your earlier file, so give prefixes real names. After saving, the file appears in your diffusion-model loader dropdown - refresh ComfyUI's file list if it doesn't show up right away. A sibling node, Z-Image Save Text Encoder, does the same for the raw_clip side into text_encoders/, in case you baked the Qwen3-4B encoder too.

    Install: the pack installs as a whole - ComfyUI Manager (search "ComfyUI-Zlycoris") or cd ComfyUI/custom_nodes && git clone https://github.com/TripleHeadedMonkey/ComfyUI-Zlycoris.git, then restart. No model files to download; your existing folders are the source. The pack's requirements.txt is heavy (transformers, diffusers, gguf, lycoris, accelerate…), though this specific node only actually needs torch and safetensors under the hood. It's a niche tool for people who already like merging and baking - but if that's you, it's exactly the node you want at the end of the line.

    CategoryZ-Image/Saving

    Inputs (2)

    NameTypeDefaultDescription
    raw_modelRAW_MODEL
    filename_prefixSTRINGz_image_patched

    Outputs (0)

    No outputs