ComfyUI-T-LoRA
Custom ComfyUI loaders for timestep-masked T-LoRA inference.
Nodes (4)
ComfyUI-T-LoRA
Custom ComfyUI loaders for timestep-masked T-LoRA inference.
- Official T-LoRA reference implementation: https://github.com/ControlGenAI/T-LoRA
- Gold-standard training/inference integration reference (multi-model): https://github.com/bghira/SimpleTuner
- Extensive portable LyCORIS implementation (including T-LoRA training): https://github.com/KohakuBlueleaf/LyCORIS
What This Repo Implements
Two inference paths are provided:
-
Load T-LoRA (Bypass)/Load T-LoRA (Bypass, Model Only)- For official-style attn-processor checkpoints (
...to_q_lora.down.weight, etc.) - Supports SDXL-style and Flux.1-dev-style official T-LoRA key layouts
- Injected with ComfyUI bypass adapters
- Per-step mask applied before UNet forward
- For official-style attn-processor checkpoints (
-
Load T-LoRA (LyCORIS, Bypass)/Load T-LoRA (LyCORIS, Bypass, Model Only)- For LyCORIS-style T-LoRA checkpoints (
q_layer/p_layer/lambda_layer) - LyCORIS modules are parsed, then converted into ComfyUI bypass adapters
- Per-step mask is set via LyCORIS timestep-mask APIs before each denoise step
- For LyCORIS-style T-LoRA checkpoints (
Install
ln -s ~/src/ComfyUI-T-LoRA $COMFYUI_PATH/custom_nodes/ComfyUI-T-LoRA
LyCORIS loader nodes require lycoris-lora with T-LoRA support from upstream main:
pip install -U git+https://github.com/KohakuBlueleaf/LyCORIS.git
Restart ComfyUI after updates.
Quick Usage
- Put base model weights in normal ComfyUI model locations.
- Put T-LoRA checkpoint in
models/loras. - Add one loader node:
- Official checkpoint:
Load T-LoRA (Bypass) - LyCORIS checkpoint:
Load T-LoRA (LyCORIS, Bypass)
- Official checkpoint:
- Feed returned
MODEL(andCLIPwhen using non-model-only node) to your sampler path.
Recommended start params:
strength_model = 1.0max_rank = 0(auto-infer)min_rank = 1alpha = 1.0max_timestep = 0(auto-infer)
Debugging Mask Behavior
Set:
debug = truedebug_every = 1
You should see step logs with computed active rank.
For adapter-level logs, the first adapter call per step reports active dimensions.
At each denoise step, the node computes an active rank:
r = int(((max_timestep - t)/max_timestep)^alpha * (max_rank - min_rank)) + min_rank
Then a binary mask activates ranks [0:r) and suppresses higher ranks for that step.
- Official path: mask is consumed by custom T-LoRA bypass adapters.
- LyCORIS path: mask is set with LyCORIS
set_timestep_mask(...)and consumed by converted adapters.
Official node expects keys like:
...attn1.processor.to_q_lora.down.weight...attn1.processor.to_q_lora.up.weight
LyCORIS node expects T-LoRA module keys (detected by lambda_layer / q_layer / p_layer entries).
Non-T-LoRA LyCORIS modules in a mixed checkpoint are skipped.
Current Limitations
strength_clipis currently ignored for these T-LoRA loaders.- This repo is inference-focused; training is out of scope.
- For broad multi-architecture training workflows, use upstream trainer repos directly (SimpleTuner / LyCORIS).