comfy
Train a LoRA on Civitai's GPU fleet, from ComfyUI
- continue_from
- model
- diffusion_model
- text_encoder_model
- vae_model
- api_config
- moderation_status
- epochs
- workflow_id
- raw_json
Training a LoRA is the one job in this pack that's a real commitment, and for a lot of people it's also the one they can't do locally - no VRAM for it, or no desire to babysit a multi-hour run. This node moves the whole thing to Civitai's fleet: you hand over training data and hyperparameters, a hosted job trains your LoRA, and you get back a checkpoint per epoch, billed in Buzz. It's the ai-toolkit training pipeline, exposed as a single ComfyUI node.
What it is
comfy (display name) - CivitaiTrainingComfy - from civitai/civitai-comfy-nodes, under Civitai/Training/comfy. The discriminator pins the engine to comfy, meaning the hosted training backend runs the Comfy-style native training pipeline rather than the legacy AI-toolkit path. The tooltips make the pricing model explicit: training is billed per step, each epoch is a delivered checkpoint plus preview samples, and storage is a per-epoch surcharge on top.
The inputs that matter
The schema is enormous, but the ones that decide your run are few:
training_data_json- required. Your dataset, as JSON. This is where the KB's oldest lesson still rules: dataset curation beats every knob in this node. Caption well, keep the set consistent, and the rest of your settings just don't have to be perfect.steps(1–10,000) andepochs(1–200) - the two ways to set training length. The tooltips describe the dance:stepsis the primary control and determines pricing; when you supply it,epochs(the number of saved checkpoints) is derived from it, and vice versa. Epochs = downloadable models. Want several checkpoints to pick from? Set epochs; want a fixed budget? Set steps.network_dim/network_alpha- rank and alpha. The tooltips are unusually candid: a larger Dim stores more but can learn junk and grows the file; with Alpha 16 and Dim 32 the effective strength is 16/32 = 0.5. Keep them equal to start.lr(0.0001),optimizer_type(the tooltip's honest line: "the most commonly used in LoRA learning is adamw8bit"),lr_scheduler- the learning-rate trio.trigger_word- the word that activates your LoRA in prompts. Only meaningful for certain ecosystems (sd1, sdxl, flux1, chroma, and friends), per the tooltip.train_text_encoder- off by default, and per the KB that's the right instinct for modern models. Turning it on improves prompt understanding but adds time and memory.model-CIVITAI_AIR. The checkpoint to train upon; wire a Model Selector.diffusion_model/text_encoder_model/vae_modelare the split-model overrides for the native Comfy path.continue_from- a previously trained LoRA, to keep training instead of starting from base. Nice for refining.batch_size(1–4),resolution(256–1024, default 1024),noise_offset,flip_augmentation,shuffle_tokens/keep_tokens- the augmentation and efficiency controls.
The outputs
moderation_status- the age-classification / moderation result for your dataset (the node even hasrequires_age_classificationas an input).epochs- the list of trained checkpoints. This is your deliverable.workflow_id/raw_json- the pack standard.
Installing it
ComfyUI Manager → Civitai Comfy Nodes → Install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/civitai/civitai-comfy-nodes.git
pip install -r civitai-comfy-nodes/requirements.txt
Gotchas
- This is the expensive node. Per-step training plus per-epoch storage, all in Buzz.
stepsis literally described as "the primary control over training length and determines pricing" - treat it as your budget dial. - Your data leaves your machine - the entire dataset is uploaded to Civitai's fleet. Training is the one operation here where the "cloud" framing is not a convenience, it's the whole point.
- Epochs are checkpoints, not iterations. Save several and pick the best - the last epoch is often overtrained, the KB's longest-running lesson.
- Credentials required - Civitai Auth node,
CIVITAI_API_TOKEN, or sidebar OAuth. Training with no balance will fail fast, not politely. - It's one node, but it's not a beginner's first run. If this is your first LoRA ever, the KB's advice holds: curate the dataset, don't train the text encoder, and don't trust the last epoch.
Inputs (45)
| Name | Type | Default | Description |
|---|---|---|---|
| training_data_json | STRING | Represents training data in various formats | |
| uses_step_pricing | BOOLEAN | false | Whether this run uses step-based pricing rather than the legacy flat per-epoch price. |
| requires_age_classification | BOOLEAN | false | Whether age classification should run on this training type's dataset. |
| storage_buzz_per_epoch | FLOAT | 0.000–2147483647 | Per-epoch surcharge (buzz). Each epoch is a delivered checkpoint plus its preview samples, billed on top of the per-step training cost — so raising the epoch count raises the price by this much each. Override per ecosystem where per-epoch samples are expensive to compute (e.g. video). |
| default_steps | INT | 00–2147483647 | Default total step budget when neither Civitai.Orchestration.Grains.Workflows.Steps.Training.AIToolkit.AIToolkitTrainingInput.Steps nor Civitai.Orchestration.Grains.Workflows.Steps.Training.AIToolkit.AIToolkitTrainingInput.Epochs is supplied. Override per ecosystem where the default training length differs (e.g. video needs more steps, quickly-overtrained models need fewer). |
| max_batch_size | INT | 00–2147483647 | — |
| samples_jsonopt | STRING | Sample generation configuration for training workflows | |
| ecosystemopt | STRING | — | |
| epochsopt | INT | 11–200 | Number of training epochs — the number of saved checkpoints produced (each epoch yields one downloadable model). When omitted it is derived from Civitai.Orchestration.Grains.Workflows.Steps.Training.AIToolkit.AIToolkitTrainingInput.Steps; when both are supplied, both are honored (epochs = checkpoint count, steps = total). |
| stepsopt | INT | 11–10000 | Total number of training steps. This is the primary control over training length and determines pricing. When supplied, Civitai.Orchestration.Grains.Workflows.Steps.Training.AIToolkit.AIToolkitTrainingInput.Epochs (the number of saved checkpoints) is derived from it; when omitted, steps are derived from epochs. |
| batch_sizeopt | INT | 11–4 | Training batch size. Defaults to 1; raise it up to 4 for this ecosystem to train faster at the cost of more GPU memory. |
| lropt | FLOAT | 0.000–1 | Sets the learning rate for the model. This is the learning rate when performing additional learning on each attention block (and other blocks depending on the setting). |
| text_encoder_lropt | FLOAT | 0.000–1 | Sets the learning rate for the text encoder. Only used when TrainTextEncoder is true. For models with multiple text encoders, this applies to all of them. |
| train_text_encoderopt | BOOLEAN | false | Whether to train the text encoder(s) alongside the model. Enabling this can improve prompt understanding but increases training time and memory usage. |
| lr_scheduleropt | COMBO | You can change the learning rate in the middle of learning. A scheduler is a setting for how to change the learning rate. | |
| optimizer_typeopt | COMBO | The optimizer determines how to update the neural net weights during training. Various methods have been proposed for smart learning, but the most commonly used in LoRA learning is "adamw8bit". | |
| network_dimopt | INT | 11–256 | The larger the Dim setting, the more learning information can be stored, but the possibility of learning unnecessary information other than the learning target increases. A larger Dim also increases LoRA file size. |
| network_alphaopt | INT | 11–256 | The smaller the Network alpha value, the larger the stored LoRA neural net weights. For example, with an Alpha of 16 and a Dim of 32, the strength of the weight used is 16/32 = 0.5, meaning that the learning rate is only half as powerful as the Learning Rate setting. If Alpha and Dim are the same number, the strength used will be 1 and will have no effect on the learning rate. |
| noise_offsetopt | FLOAT | 0.000–1 | Adds noise to training images. 0 adds no noise at all. A value of 1 adds strong noise. |
| flip_augmentationopt | BOOLEAN | false | If this option is turned on, the image will be horizontally flipped randomly. It can learn left and right angles, which is useful when you want to learn symmetrical people and objects. |
| shuffle_tokensopt | BOOLEAN | false | Randomly changes the order of your tags during training. The intent of shuffling is to improve learning. If you are using captions (sentences), this option has no meaning. |
| keep_tokensopt | INT | 00–10 | If your training images have tags, you can randomly shuffle them. However, if you have words that you want to keep at the beginning, you can use this option to specify "Keep the first 0 words at the beginning". This option does nothing if the Shuffle Tokens option is off. |
| trigger_wordopt | STRING | A trigger word that activates the trained LoRA when used in prompts. Only applicable to certain ecosystems (sd1, sdxl, flux1, chroma, zimagebase, zimageturbo, flux2klein). | |
| continue_fromopt | CIVITAI_AIR | Optional previously-trained LoRA to continue training from ("train further"). When set, the first epoch resumes from this model instead of the base model, and the new epochs build on top of it. | |
| resolutionopt | INT | 1024256–1024 | — |
| no_half_vaeopt | BOOLEAN | false | — |
| min_snr_gammaopt | INT | 00–20 | Min-SNR gamma passed through to compatible training backends. |
| modelopt | CIVITAI_AIR | The primary checkpoint to train upon. The model ecosystem drives Comfy training behavior. | |
| diffusion_modelopt | CIVITAI_AIR | Split diffusion model used by native Comfy training nodes. When omitted, checkpoint-backed families load Civitai.Orchestration.Grains.Workflows.Steps.Training.Comfy.ComfyTrainingInput.Model. | |
| text_encoder_modelopt | CIVITAI_AIR | Split text encoder used by native Comfy training nodes. | |
| vae_modelopt | CIVITAI_AIR | Split VAE used by native Comfy training nodes. | |
| training_dtypeopt | STRING | — | |
| lora_dtypeopt | STRING | — | |
| quantized_backwardopt | BOOLEAN | false | — |
| bypass_modeopt | BOOLEAN | false | — |
| grad_accumulation_stepsopt | INT | 00–2147483647 | — |
| loss_functionopt | STRING | — | |
| algorithmopt | STRING | — | |
| checkpoint_depthopt | INT | 00–2147483647 | — |
| offloadingopt | BOOLEAN | false | — |
| clip_typeopt | STRING | — | |
| unet_weight_dtypeopt | STRING | — | |
| model_sampling_shiftopt | FLOAT | 0.000–2147483647 | — |
| dataset_cachingopt | BOOLEAN | false | — |
| api_configopt | CIVITAI_CONFIG | Optional Civitai Auth connection; defaults to CIVITAI_API_TOKEN or stored OAuth login. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| moderation_status | STRING | — |
| epochs | STRING | — |
| workflow_id | STRING | — |
| raw_json | STRING | — |