Load LoRA (Z-Image Qwen TE)
Make ai-toolkit text-encoder LoRAs actually stick to Qwen
- model
- clip
- MODEL
- CLIP
If you've trained a Z-Image LoRA with Ostris's AI Toolkit, you've seen this failure: the adapter loads, the diffusion part works, and the text-encoder part silently does nothing. That's because AI Toolkit saves text-encoder LoRA weights with lora_te.model.layers... keys, while ComfyUI's Qwen encoder stores them as qwen3_4b.transformer.model.layers.... Different keys, same weights, and stock Load LoRA can't bridge the gap. This node exists purely to bridge it.
What it does
ZImageQwenTELoRALoader takes a normal MODEL and CLIP (the ComfyUI-native kind - you can wire it straight after your regular loaders), plus a LoRA from models/loras/, and splits the LoRA's state dict in two:
- The non-TE part (the diffusion/transformer weights) gets applied through ComfyUI's standard
load_lora_for_modelspath, exactly like a normal loader. - The
lora_te.*part gets mapped onto the actual Qwen weights inside the CLIP'scond_stage_model. The node infers the Qwen key prefix from the live state dict, builds alora_te.<path>→qwen3_4b.transformer.<path>map, and applies it as patches on the CLIP wrapper. Keys with no match - like anlm_headthat doesn't exist in the encoder - are skipped naturally.
It's Load LoRA, but with a translator for the text-encoder side.
The inputs that matter
model(MODEL),clip(CLIP) - your loaded Z-Image transformer and Qwen encoder.lora_name- dropdown frommodels/loras/.strength_model/strength_clip- default 1.0, range ±20. The TE strength is what thelora_tepart gets; the model strength governs the diffusion half.
Outputs are MODEL and CLIP, ready for the sampler. The node clones the CLIP before patching, so it doesn't corrupt the original.
Why this matters for Z-Image
Z-Image's encoder is Qwen3-4B, and 4B is a real chunk of the model. TE LoRAs let you bend prompting behavior, style token interpretation, or bilingual handling without touching the diffusion weights. But every one of those LoRAs coming out of AI Toolkit (the standard trainer here - it had Z-Image Turbo support two days after release) hits the key-mismatch wall. This node is the removal of that wall. It's also a good example of the pack's general philosophy: it's not inventing new training, it's fixing the plumbing so what you already trained works.
Install
ComfyUI Manager (search ComfyUI-Zlycoris) or:
cd ComfyUI/custom_nodes
git clone https://github.com/TripleHeadedMonkey/ComfyUI-Zlycoris.git
Restart ComfyUI. Heavy first-install dependency list (transformers, diffusers, optimum, lycoris, ...) but no model files to fetch - bring your own LoRA.
Where people get burned
- It needs a real Qwen encoder with
.transformer.model.layerskeys. If the node can't infer the prefix from the state dict, it raises a "Could not infer Qwen prefix" error. That happens when your CLIP isn't actually the Qwen3 TE - so check your text encoder loader before blaming the node. - TE failure is non-fatal. The diffusion half applies first; if the TE patch throws, it logs and keeps going. You get a model where the LoRA half-applied, which looks like "the LoRA is weak" when it's actually "the TE half died." Watch the console.
- The
strength_clipslider governs only the TE part - it's easy to crank the model strength and wonder why your style tweak didn't move. They're independent; check both. - If your LoRA wasn't trained by AI Toolkit with
lora_tekeys, this node has nothing to translate, and it'll behave like a normal loader. DiffSynth LoRAs needZImageDiffSynthLoader; raw LyCORIS files needZImageLoaderAndPatcher.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| lora_name | COMBO | 0 options: | |
| strength_model | FLOAT | 1.00-20–20 | — |
| strength_clip | FLOAT | 1.00-20–20 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CLIP | CLIP | — |