Nodes/ComfyUI-Zlycoris/Z-Image AITK LoRA Loader (Standard)
ComfyUI Node

Z-Image AITK LoRA Loader (Standard)

The ai-toolkit-native loader for the raw pipeline

By TripleHeadedMonkey·Created 7 months ago·Updated 7 months ago· 4
Z-Image AITK LoRA Loader (Standard)
  • lora_stack
  • RAW_MODEL
  • RAW_CLIP
transformer_name
text_encoder_name
lora_name
strength_model1.00
strength_clip1.00

AI Toolkit (Ostris's trainer) is the default way Z-Image LoRAs get made - it shipped Turbo training two days after the model dropped and Base support almost immediately. So a huge share of the LoRAs you'll grab are AITK format. This node is the raw-pipeline answer to that: ZImageAITKLoRALoader loads the transformer and text encoder as raw state dicts and patches an AITK-format LoRA onto them, with a dedicated key-matching engine for the lora_te. (text encoder) and lora_unet (model) conventions AITK saves.

How it differs from its siblings

It's the same shape as ZImageLoaderAndPatcher - same three dropdowns, same strengths, same optional lora_stack, same RAW_MODEL/RAW_CLIP outputs - but the patching rules are AITK-specific:

  • For the model: lora_unet prefixed keys are stripped and matched against diffusion_model.* / bare keys, including a blockslayers swap.
  • For the CLIP: lora_te.* keys map onto transformer.* / bare weight keys.

Because it applies patches onto the raw state dicts (not through ComfyUI's patch system), it can handle AITK's key layout without the "Load LoRA ignores my LoRA" failure. It also supports the lora_stack chaining, so you can stack AITK LoRAs in order - the structured stacking path for the most common Z-Image LoRA source.

The inputs that matter

  • transformer_name - from models/diffusion_models/.
  • text_encoder_name - from models/text_encoders/.
  • lora_name - from models/loras/.
  • strength_model / strength_clip - default 1.0, range ±100.
  • lora_stack (LYCORIS_STACK, optional) - built with ZImageLycorisStacker, applied before the single lora_name.

Outputs: RAW_MODEL, RAW_CLIP. Sample via ZImageComfyInjector. If you're coming from the Qwen TE loader, note the difference: ZImageQwenTELoRALoader handles the lora_te text-encoder half on a normal ComfyUI-native CLIP; this node does the whole LoRA in the raw pipeline. If your LoRA is AITK and you want the ComfyUI-native two-socket workflow, the TE loader is your pick; if you're already in a raw/merge workflow, this is the one.

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 deps (transformers, diffusers, optimum, lycoris, ...); no model files bundled.

Where people get burned

  • lora_te keys only apply if the CLIP was actually loaded. If text_encoder_name is None, the clip half of the LoRA silently does nothing. AITK LoRAs frequently have both halves, so skipping the TE is a quiet way to lose half your adapter.
  • Key translation is best-effort. Unmatched keys just aren't patched - the console logs how many layers were patched per file, and "0" means the keys didn't match this node's conventions. If that happens, the file may be a DiffSynth LoRA (use ZImageDiffSynthLoader) or a raw LyCORIS file (ZImageLoaderAndPatcher).
  • ±100 strength range is generous and unforgiving. On Z-Image, AITK-trained Base LoRAs genuinely want 1.0–2.0+ on Turbo, so the range exists for real. But it's equally easy to fat-finger 50 and watch the model turn to noise. Render-test at 1.0 first.
  • Raw outputs again - if you feed RAW_MODEL into a KSampler expecting it to work, it won't. Inject first.
CategoryZ-Image/Loaders

Inputs (6)

NameTypeDefaultDescription
transformer_nameCOMBO1 options: None
text_encoder_nameCOMBO1 options: None
lora_nameCOMBO1 options: None
strength_modelFLOAT1.00-100–100
strength_clipFLOAT1.00-100–100
lora_stackoptLYCORIS_STACK

Outputs (2)

NameTypeDescription
RAW_MODELRAW_MODEL
RAW_CLIPRAW_CLIP