Hi everyone,
I've been working on GCMP for a while and it's now ready for you to use in ComfyUI. GCMP is a replacement for LoRA. You train it with the same Train LoRA node and load it with the same Load LoRA node. The file is 27 to 67 times smaller, and in my tests the quality is the same as LoRA.
I trained GCMP and LoRA on the same 5 corgi photos for 400 steps inside ComfyUI, then generated with the same prompts and seeds:
| Model | GCMP | LoRA r=16 | LoRA r=32 |
| SDXL | 6 MB | 204 MB | 402 MB |
| Krea 2 | 7.3 MB | 235 MB | 470 MB |
| MOSS-Image | 2.9 MB | 78 MB | 155 MB |
On MOSS-Image the held-out loss is 0.805 for GCMP vs 0.804 and 0.805 for the two LoRAs. In the Krea 2 watercolor prompt, GCMP kept the corgi's pointed ears and LoRA turned it into a different dog. The cat prompt without the trigger word stayed clean with both.
GCMP gets merged into the model when it loads, so it uses no extra VRAM and generates at the base model's speed. SDXL was 7.8 s per image vs 8.0 s for the base model, and Krea 2 was 11.1 s vs 11.2 s.
How to use it
1. Install it like any custom node:
cd ComfyUI/custom_nodes
git clone https://github.com/thousandml/training-factory
Restart ComfyUI. You will see a new Load GCMP Adapter node under loaders/GCMP, and the built-in Train LoRA node now has GCMP in its algorithm list.
2. Train. Open the Train LoRA workflow you already have and change three things:
algorithm: GCMP
learning_rate: 5e-5
bypass_mode: on
Everything else stays the same: your dataset nodes, steps, Save LoRA Weights and the loss graph. Rank is ignored with GCMP. The file is saved to output/loras, so move it to models/loras. If you want to start from a ready workflow, drag comfyui/workflows/train_gcmp.json onto the canvas. There are also versions for Krea 2 RAW and MOSS-Image.
3. Generate. Put the file in models/loras and load it with your normal Load LoRA node or a LoRA stack. The strength slider works like it does with LoRA. You can also use Load GCMP Adapter, which has a bypass mode for quantized or offloaded models. For Krea 2, do what Krea recommends: train on RAW, then load the GCMP file onto Turbo.
4. Convert LoRAs you already have (optional). A LoRA's weights can't be translated directly into GCMP, so the script has your LoRA generate images and GCMP learns from those images. You don't need the original training data. With ComfyUI running:
python comfyui/lora_to_gcmp.py --comfy_dir ~/ComfyUI --ckpt sd_xl_base_1.0.safetensors --lora my_character.safetensors --prompts my_prompts.txt
Put your trigger words in 20 to 40 different scenes and styles in my_prompts.txt, plus a few prompts without the trigger. Compare a few images from the original LoRA and the GCMP version before you delete anything.
The honest part
Right now it runs on Linux and WSL2 with Python 3.12. A native Windows build for the portable ComfyUI is what I'm working on next. GCMP trains about 2.2 to 2.5 times slower per step than LoRA, and I'm working on that too. With fp8 weights, Krea 2 trains on a 48 GB GPU.
I have tested SDXL, Krea 2 and MOSS-Image. It goes through ComfyUI's own adapter system, so Flux, Wan, Qwen-Image and others should work, but I haven't tested them yet. MiniMax H3 workflows are included, but I haven't finished testing them. GCMP is free to use during early access.
If you try it on a model I haven't tested, please tell me how it goes, and post the error if it breaks. I'd also like to know which model you want me to test next.
Thanks for reading, feedback appreciated
Repo: github.com/thousandml/training-factory (setup is in comfyui/README.md)
Update: Thanks everyone for the questions and feedback. Here's what changed since I posted.
GCMP now works in AI Toolkit as a network type (network: type: gcmp). It's new and still being tested, and the files load in ComfyUI the same way. GCMP also works with ComfyUI's low-VRAM mode now, and loading adapters is faster.
To be clear about what you're running: this is source-available, not open source. The ComfyUI and AI Toolkit code is readable Python, but the GCMP core and the license check are compiled. I wrote down exactly what the compiled files do and the one network request they make in docs/COMPILED_COMPONENTS.md. There are also checksums so you can confirm you have the files I released.
GCMP may not be used for NSFW content of any kind, or for anything violent or illegal. Before training starts, it checks the training images and captions and refuses to train if anything is flagged.
Next on my list: a comparison against LoKr, which a few people asked for, a longer multi-subject test for character bleed, and faster training.