kohya
The entire kohya training UI, moved to the cloud
- model
- api_config
- moderation_status
- epochs
- sample_images_prompts
- sample_input_images
- stored_as_assets
- eta
- workflow_id
- raw_json
If you've ever trained a LoRA with kohya's GUI, you know the feeling of staring at a screen full of fields that each sound like a personal attack: num_repeats, network_alpha, min_snr_gamma, keep_tokens... This node is that entire form, lifted into a ComfyUI node and run on Civitai's servers. Same knobs, same names, same tooltips (the tooltips here are kohya's own words - "Num Repeats defines how many times each individual image gets put into VRAM" - which tells you exactly where this recipe came from). The only difference is you're not renting a GPU to run it; Civitai's farm does, and you pay in Buzz.
The audience is clear: the person who knows exactly what they want from kohya-style SD/SDXL LoRA training but doesn't have the rig or the patience for a local kohya setup. If you've never touched kohya, start with this node's simpler siblings and come back when you need the control.
Inputs and outputs
Required, same as all training nodes: model (CIVITAI_AIR from a Civitai Model Selector), training_data (URL), training_data_images_count. Then the kohya firehose, and the ones that actually matter for a beginner:
max_train_epochs(default 5) - the tooltip is genuinely generous: it saves up to 20 epochs, evenly distributed, all downloadable. More epochs = more chances to pick a good checkpoint, more cost.num_repeats(default 8) - how many times each image enters training. This andtrain_batch_size(default 1) control effective training volume; the tooltip explains the distinction clearly.resolution(default 512) - max training image resolution; images get scaled down to fit.network_dim/network_alpha(both default 1) - the rank/alpha pair the KB's training doc covers in depth: dim is capacity, alpha is how hard you apply it. The tooltip's 16/32 → 0.5 example is the whole concept in one sentence.clip_skip(default 1) - "for anime, use 2. For everything else, 1." Straight from the tooltip, and the fastest way to burn a run is to ignore it.unet_lr/text_encoder_lr(5e-05 each),lr_scheduler,min_snr_gamma,noise_offset,optimizer_type,shuffle_caption,keep_tokens,flip_augmentation,enable_bucket(default true),target_steps- the rest of the kohya surface, and the tooltips are the best documentation you'll get.
Outputs: the training status set - moderation_status, epochs, sample_images_prompts, sample_input_images, stored_as_assets, eta, workflow_id, raw_json.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/civitai/civitai-comfy-nodes.git
pip install -r civitai-comfy-nodes/requirements.txt
Or ComfyUI Manager → "Civitai Comfy Nodes" → Install → restart. Authenticate; this is the most expensive training node in the pack when you use it fully.
Gotchas
The tooltips are not decoration - they're kohya's actual documentation, and this node's authors kept them because they're the right answer to half the questions you'd ask. The real gotcha is that every one of those knobs multiplies cost, and max_train_epochs at 20 with num_repeats at 8 is a much bigger bill than the defaults suggest. Start at defaults, train one, look at sample_images_prompts, then touch knobs one at a time - same discipline as local kohya, just with a meter running. And remember the data leaves your machine to a URL Civitai can fetch. Early preview, so expect the recipe surface to shift between releases.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| model | CIVITAI_AIR | The primary model to train upon. | |
| training_data | STRING | A url referring data to use in training. | |
| training_data_images_count | INT | 00–2147483647 | The number of images embedded in this training data. This is used to calculate the cost of training. |
| lora_nameopt | STRING | my-lora | The desired lora name. |
| sample_prompts_jsonopt | STRING | A selection of sample prompts. | |
| negative_promptopt | STRING | An optional negative prompt that will get applied when generating samples | |
| max_train_epochsopt | INT | 50–20 | An epoch is one set of learning. By default, we will save a maximum of 20 epochs (evenly distributed), and they are all available for download. |
| num_repeatsopt | INT | 81–5000 | Num Repeats defines how many times each individual image gets put into VRAM. As opposed to batch size, which is how many images are placed into VRAM at once. |
| train_batch_sizeopt | INT | 11–9 | Batch size is the number of images that will be placed into VRAM at once. A batch size of 2 will train two images at a time, simultaneously. |
| resolutionopt | INT | 512512–1024 | Specify the maximum resolution of training images. If the training images exceed the resolution specified here, they will be scaled down to this resolution |
| enable_bucketopt | BOOLEAN | true | Sorts images into buckets by size for the purposes of training. If your training images are all the same size, you can turn this option off, but leaving it on has no effect. |
| shuffle_captionopt | 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–3 | 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 Tags option is off. |
| clip_skipopt | INT | 11–4 | Determines which layer's vector output will be used. There are 12 layers, and setting the skip will select "xth from the end" of the total layers. For anime, we use 2. For everything else, 1. |
| 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. |
| unet_lropt | FLOAT | 0.000–1 | Sets the learning rate for U-Net. This is the learning rate when performing additional learning on each attention block (and other blocks depending on the setting) in U-Net |
| text_encoder_lropt | FLOAT | 0.000–1 | Sets the learning rate for the text encoder. The effect of additional training on text encoders affects the entire U-Net. |
| 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. | |
| lr_scheduler_num_cyclesopt | INT | 31–4 | This option specifies how many cycles the scheduler runs during training. It is only used when "cosine_with_restarts" or "polynomial" is used as the scheduler. |
| min_snr_gammaopt | INT | 00–20 | Learning is performed by putting noise of various strengths on the training image, but depending on the difference in strength of the noise on which it is placed, learning will be stable by moving closer to or farther from the learning target. Min SNR gamma was introduced to compensate for that. When learning images have little noise, it may deviate greatly from the target, so try to suppress this jump. |
| 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. |
| optimizer_typeopt | STRING | 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" or "Adafactor" for SDXL. | |
| target_stepsopt | INT | 00–2147483647 | — |
| api_configopt | CIVITAI_CONFIG | Optional Civitai Auth connection; defaults to CIVITAI_API_TOKEN or stored OAuth login. |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| moderation_status | STRING | — |
| epochs | STRING | — |
| sample_images_prompts | STRING | — |
| sample_input_images | STRING | — |
| stored_as_assets | STRING | — |
| eta | STRING | — |
| workflow_id | STRING | — |
| raw_json | STRING | — |