CivArchive
    Anima LoRA Trainer for ComfyUI - v1.1
    NSFW
    Preview 137782998
    Preview 129980276
    Preview 125753831
    Preview 125752648
    Preview 125754098
    Preview 125754099

    Anima LoRA Trainer for ComfyUI

    Train Anima LoRAs (also LoKr and LoHa) directly from ComfyUI. No command line needed, and it now works on cards from 6GB up.

    How it works

    Load the wizard workflow, answer 5 questions (what you're training, dataset size, resolution, your VRAM, quality goal) and hit run. The pack installs sd-scripts, downloads the Anima model files and launches training in its own terminal window. If you want full control instead, there's a manual mode where you set every parameter yourself.

    Features

    • One-click model download from HuggingFace. Pick base, aesthetic or turbo, the downloader always grabs the newest version. Base is the default since that's what you should train LoRAs on.

    • VRAM presets from 6GB to 24GB+. Small cards train slower, not worse. The presets are just starting points, everything they set can be changed.

    • VRAM Estimator node: shows the estimated memory usage live while you change settings, before you ever click run. Includes a bar chart of what eats the memory, a fits/too-tight/won't-fit verdict for your card, and suggestions that tell you exactly which setting to change and how much it saves.

    • Dataset check: the pack validates your training folder (structure, captions, repeats) and explains problems in plain language. The launcher refuses to start a run that would find 0 images, which is the most common way trainings used to die.

    • Wizard override fields for resolution, rank, learning rate, batch size and block swap, so you can deviate from the presets without switching to manual mode.

    • Annotated config preview: see the complete TOML with an explanation for every parameter.

    • Resolutions from 512 up to 1536 (Anima's max), resume from checkpoints, sample images during training.

    • Windows, Linux, macOS. No pip dependencies.

    Requirements

    • ComfyUI, Python 3.10+, git

    • GPU with 6GB+ VRAM (12GB+ recommended, below that expect slower training and use 768px on 6GB)

    Dataset setup

    Images go in folders named <repeats>_<concept> (like 10_ohwx) with a matching .txt caption file per image. The dataset check will tell you if something's off.

    Update v1.1

    • Fixed: the model downloader always grabbed the deprecated preview2 build. It now picks the actual latest release and never touches preview builds. New dropdown for base/aesthetic/turbo.

    • New presets for 6GB, 8GB and 10GB cards

    • New VRAM Estimator node with live estimates and a memory breakdown chart

    • Dataset folder validation with a launch gate

    • 1536x1536 resolution preset

    • Wizard force_* overrides

    • Rewrote all tooltips and summaries in plain language

    If you're updating: delete the old folder from custom_nodes, extract the new zip, restart ComfyUI fully and hard-refresh your browser (Ctrl+Shift+R), otherwise the new nodes won't show up.

    Description

    Added LoKR & LoHA parameters

    FAQ

    Comments (45)

    burnera679889Apr 29, 2026
    CivitAI

    I keep on getting this error:

    Traceback (most recent call last): File "_mt19937.pyx", line 180, in numpy.random._mt19937.MT19937._legacy_seedingTypeError: 'str' object cannot be interpreted as an integerDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "my_training_directory\model\_train_wrapper.py", line 7, in <module> runpy.run_path(r"G:\SwarmUI\Models\sd-scripts\anima_train_network.py", run_name="__main__") File "<frozen runpy>", line 291, in run_path File "<frozen runpy>", line 98, in runmodule_code File "<frozen runpy>", line 88, in runcode File "G:\SwarmUI\Models\sd-scripts\anima_train_network.py", line 451, in <module> trainer.train(args) File "G:\SwarmUI\Models\sd-scripts\train_network.py", line 488, in train set_seed(args.seed) File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\accelerate\utils\random.py", line 54, in set_seed np.random.seed(seed) File "numpy\\random\\mtrand.pyx", line 4806, in numpy.random.mtrand.seed File "numpy\\random\\mtrand.pyx", line 250, in numpy.random.mtrand.RandomState.seed File "_mt19937.pyx", line 168, in numpy.random._mt19937.MT19937._legacy_seeding File "_mt19937.pyx", line 188, in numpy.random._mt19937.MT19937._legacy_seedingTypeError: Cannot cast scalar from dtype('<U4') to dtype('int64') according to the rule 'safe'

    7err4
    Author
    Apr 30, 2026

    New version is up — grab the latest and that error should be gone.

    What was going on: the seed field needs to be a number (like 42), but on your end it was arriving as text ("42" — same digits, but treated as letters). The trainer can't do math with letters, so it crashed before training could start. Most setups never trigger this because the seed stays a number all the way through, but a few workflow paths (extra nodes wired into the seed input, certain saved-workflow imports) can quietly turn it into text. The new version checks for that and converts it back to a number before anything starts, so the same workflow that broke before should just work now.

    burnera679889May 3, 2026

    @7err4 ah thanks, so i just update it in comfyui?

    burnera679889May 4, 2026

    Well I just updated and now im getting this error

    20:02:30.645 [Warning] [ComfyUI-0/STDERR] Traceback (most recent call last):

    20:02:30.647 [Warning] [ComfyUI-0/STDERR] File "G:\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 535, in execute

    20:02:30.648 [Warning] [ComfyUI-0/STDERR] output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)

    20:02:30.650 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    20:02:30.652 [Warning] [ComfyUI-0/STDERR] File "G:\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 335, in get_output_data

    20:02:30.653 [Warning] [ComfyUI-0/STDERR] return_values = await asyncmap_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)

    20:02:30.654 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    20:02:30.655 [Warning] [ComfyUI-0/STDERR] File "G:\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 309, in asyncmap_node_over_list

    20:02:30.655 [Warning] [ComfyUI-0/STDERR] await process_inputs(input_dict, i)

    20:02:30.656 [Warning] [ComfyUI-0/STDERR] File "G:\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 297, in process_inputs

    20:02:30.660 [Warning] [ComfyUI-0/STDERR] result = f(**inputs)

    20:02:30.661 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^

    20:02:30.662 [Warning] [ComfyUI-0/STDERR] File "G:\SwarmUI\dlbackend\comfy\ComfyUI\custom_nodes\ComfyUI-Anima-LoRA-Training\nodes\config_preview.py", line 69, in preview

    20:02:30.663 [Warning] [ComfyUI-0/STDERR] config = generate_training_config(

    20:02:30.664 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^^^^^^^

    20:02:30.665 [Warning] [ComfyUI-0/STDERR] File "G:\SwarmUI\dlbackend\comfy\ComfyUI\custom_nodes\ComfyUI-Anima-LoRA-Training\utils\config_generator.py", line 255, in generate_training_config

    20:02:30.666 [Warning] [ComfyUI-0/STDERR] network_type_lower = network_type.lower().strip()

    20:02:30.667 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^

    20:02:30.668 [Warning] [ComfyUI-0/STDERR] AttributeError: 'int' object has no attribute 'lower'

    20:02:30.669 [Warning] [ComfyUI-0/STDERR]

    7err4
    Author
    May 4, 2026

    @burnera679889 

    New version is up

    Heads-up on the bigger picture: Your setup is using SwarmUI as a frontend (with ComfyUI as the backend). SwarmUI saves workflow values in a slightly different format than native ComfyUI does - for example, dropdown choices like the network type get stored as numbers (0 / 1 / 2) instead of names ("LoRA" / "LoKr" / "LoHa"), and a few number fields can come through as text. The trainer wasn't expecting those formats and crashed early.

    I went through the affected fields and made all of them tolerant to both formats - so anything that follows this pattern will now be normalized on the fly before training starts.

    I don't have SwarmUI installed myself, so I can't reproduce these issues directly - if you hit any more crashes, please post the error and I'll patch it.

    burnera679889May 5, 2026

    Thanks for the update, now it doesn't produce any errors in swarmui, but for some reason it also doesn't launch the resulting .bat from swarmui so I had to do so myself. I got these errors, which im not sure are a result of the .bat or because I dont have bits and bytes installed:


    Traceback (most recent call last):

    File "G:\Training\model\_train_wrapper_20260504_202011.py", line 7, in <module>

    runpy.run_path(r"G:\SwarmUI\dlbackend\comfy\ComfyUI\sd-scripts\anima_train_network.py", run_name="__main__")

    File "<frozen runpy>", line 291, in run_path

    File "<frozen runpy>", line 98, in runmodule_code

    File "<frozen runpy>", line 88, in runcode

    File "G:\SwarmUI\dlbackend\comfy\ComfyUI\sd-scripts\anima_train_network.py", line 451, in <module>

    trainer.train(args)

    File "G:\SwarmUI\dlbackend\comfy\ComfyUI\sd-scripts\train_network.py", line 1442, in train

    optimizer.step()

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\accelerate\optimizer.py", line 178, in step

    self.optimizer.step(closure)

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\torch\optim\lr_scheduler.py", line 124, in wrapper

    return func.__get__(opt, opt.__class__)(*args, **kwargs)

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\torch\optim\optimizer.py", line 485, in wrapper

    out = func(*args, **kwargs)

    ^^^^^^^^^^^^^^^^^^^^^

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context

    return func(*args, **kwargs)

    ^^^^^^^^^^^^^^^^^^^^^

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\bitsandbytes\optim\optimizer.py", line 291, in step

    self.update_step(group, p, gindex, pindex)

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context

    return func(*args, **kwargs)

    ^^^^^^^^^^^^^^^^^^^^^

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\bitsandbytes\optim\optimizer.py", line 569, in update_step

    F.optimizer_update_8bit_blockwise(

    File "G:\SwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\bitsandbytes\functional.py", line 1817, in optimizer_update_8bit_blockwise

    optim_func = str2optimizer8bit_blockwise[optimizer_name][0]

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

    NameError: name 'str2optimizer8bit_blockwise' is not defined

    7err4
    Author
    May 5, 2026

    @burnera679889 

    Quick fix you can try first: in the wizard, change the quality preset from "balanced (recommended)" to "high quality (slower)". That preset uses plain AdamW instead of AdamW8bit, so it skips bitsandbytes entirely - no install fix needed on your side. The trade-off is ~2× more VRAM on the optimizer state and a slightly longer training run, but it should run end-to-end on your setup.

    If that goes through, let me know - I'll patch the launcher so it auto-detects when bitsandbytes is broken and falls back to the non-8bit optimizer with a warning, instead of crashing 30 seconds in. Then future runs on the "balanced" default won't hit this either.

    burnera679889May 7, 2026

    @7err4 Alright, setting it to high seems to have gotten around that error. Ill have to wait about 2 hours to see if it works.

    burnera679889May 7, 2026· 1 reaction

    Looks like it works perfectly now, the only gripe I have is that I cant seem to set the epoch save frequency. I am assuming I might be able to edit the config JSON to change that though, so thank you for updating it.

    7err4
    Author
    May 7, 2026

    @burnera679889  Glad to help.

    I patched a bitsandbytes detector so you can use the other quality presets again if you want.

    Save-every-N-epochs used to be driven by the dataset_size preset; it's now configurable through new optional fields on the wizard.

    burnera679889May 7, 2026

    @7err4 Thanks, ill have to try it out. This workflow is a lot handier than the Kohaya SS port I was trying to use.

    burnera679889Jun 3, 2026

    I updated to the most recent version and now im getting this error

    09:29:53.227 [Info] Sent Comfy backend direct prompt requested to backend #0 (from user local)

    09:29:54.042 [Warning] [ComfyUI-0/STDERR] AttributeError: 'int' object has no attribute 'lower'

    09:29:54.043 [Warning] [ComfyUI-0/STDERR]

    I am assuming one of the fields in the training wizard isnt casting to int properly in SwarmUI again.

    7err4
    Author
    Jun 3, 2026

    @burnera679889 the bug likely reappered, since I recently made adjustments towards building the config for LoKR training, i updated the package to harden for SwarmUI again - try again with the latest version please

    burnera679889Jun 8, 2026

    @7err4 Thanks for fixing the casting error, it is somehow taking my sample prompt as some sort of argument and giving an error.

    2026-06-08 01:30:30 WARNING Could not find the bitsandbytes CUDA binary at cextension.py:89 WindowsPath('G:/SwarmUI/dlbackend/comfy/python_embeded/Lib/site-packages/b

    itsandbytes/libbitsandbytes_cuda128.dll')

    WARNING The installed version of bitsandbytes was compiled without GPU support. cextension.py:96 8-bit optimizers, 8-bit multiplication, and GPU quantization are

    unavailable.

    usage: anima_train_network.py [-h] [--console_log_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

    [--console_log_file CONSOLE_LOG_FILE] [--console_log_simple] [--v2]

    [--v_parameterization] [--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH]

    [--tokenizer_cache_dir TOKENIZER_CACHE_DIR] [--metadata_title METADATA_TITLE]

    [--metadata_author METADATA_AUTHOR] [--metadata_description METADATA_DESCRIPTION]

    [--metadata_license METADATA_LICENSE] [--metadata_tags METADATA_TAGS]

    [--metadata_usage_hint METADATA_USAGE_HINT] [--metadata_thumbnail METADATA_THUMBNAIL]

    [--metadata_merged_from METADATA_MERGED_FROM]

    [--metadata_trigger_phrase METADATA_TRIGGER_PHRASE]

    [--metadata_preprocessor METADATA_PREPROCESSOR]

    [--metadata_is_negative_embedding METADATA_IS_NEGATIVE_EMBEDDING]

    [--train_data_dir TRAIN_DATA_DIR] [--cache_info] [--shuffle_caption]

    [--caption_separator CAPTION_SEPARATOR] [--caption_extension CAPTION_EXTENSION]

    [--caption_extention CAPTION_EXTENTION] [--keep_tokens KEEP_TOKENS]

    [--keep_tokens_separator KEEP_TOKENS_SEPARATOR]

    [--secondary_separator SECONDARY_SEPARATOR] [--enable_wildcard]

    [--caption_prefix CAPTION_PREFIX] [--caption_suffix CAPTION_SUFFIX] [--color_aug]

    [--flip_aug] [--face_crop_aug_range FACE_CROP_AUG_RANGE] [--random_crop]

    [--debug_dataset] [--resolution RESOLUTION] [--cache_latents]

    [--vae_batch_size VAE_BATCH_SIZE] [--cache_latents_to_disk] [--skip_cache_check]

    [--enable_bucket] [--min_bucket_reso MIN_BUCKET_RESO]

    [--max_bucket_reso MAX_BUCKET_RESO] [--skip_image_resolution SKIP_IMAGE_RESOLUTION]

    [--bucket_reso_steps BUCKET_RESO_STEPS] [--bucket_no_upscale]

    [--resize_interpolation {lanczos,nearest,bilinear,linear,bicubic,cubic,area}]

    [--token_warmup_min TOKEN_WARMUP_MIN] [--token_warmup_step TOKEN_WARMUP_STEP]

    [--alpha_mask] [--dataset_class DATASET_CLASS] [--train_inpainting]

    [--caption_dropout_rate CAPTION_DROPOUT_RATE]

    [--caption_dropout_every_n_epochs CAPTION_DROPOUT_EVERY_N_EPOCHS]

    [--caption_tag_dropout_rate CAPTION_TAG_DROPOUT_RATE] [--reg_data_dir REG_DATA_DIR]

    [--in_json IN_JSON] [--dataset_repeats DATASET_REPEATS] [--output_dir OUTPUT_DIR]

    [--output_name OUTPUT_NAME] [--huggingface_repo_id HUGGINGFACE_REPO_ID]

    [--huggingface_repo_type HUGGINGFACE_REPO_TYPE]

    [--huggingface_path_in_repo HUGGINGFACE_PATH_IN_REPO]

    [--huggingface_token HUGGINGFACE_TOKEN]

    [--huggingface_repo_visibility HUGGINGFACE_REPO_VISIBILITY]

    [--save_state_to_huggingface] [--resume_from_huggingface] [--async_upload]

    [--save_precision {None,float,fp16,bf16}] [--save_every_n_epochs SAVE_EVERY_N_EPOCHS]

    [--save_every_n_steps SAVE_EVERY_N_STEPS] [--save_n_epoch_ratio SAVE_N_EPOCH_RATIO]

    [--save_last_n_epochs SAVE_LAST_N_EPOCHS]

    [--save_last_n_epochs_state SAVE_LAST_N_EPOCHS_STATE]

    [--save_last_n_steps SAVE_LAST_N_STEPS]

    [--save_last_n_steps_state SAVE_LAST_N_STEPS_STATE] [--save_state]

    [--save_state_on_train_end] [--resume RESUME] [--train_batch_size TRAIN_BATCH_SIZE]

    [--max_token_length {None,150,225}] [--mem_eff_attn] [--torch_compile]

    [--dynamo_backend {eager,aot_eager,inductor,aot_ts_nvfuser,nvprims_nvfuser,cudagraphs,ofi,fx2trt,onnxrt,tensort,ipex,tvm}]

    [--xformers] [--sdpa] [--vae VAE] [--max_train_steps MAX_TRAIN_STEPS]

    [--max_train_epochs MAX_TRAIN_EPOCHS]

    [--max_data_loader_n_workers MAX_DATA_LOADER_N_WORKERS]

    [--persistent_data_loader_workers] [--seed SEED] [--gradient_checkpointing]

    [--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS]

    [--mixed_precision {no,fp16,bf16}] [--full_fp16] [--full_bf16] [--fp8_base]

    [--ddp_timeout DDP_TIMEOUT] [--ddp_gradient_as_bucket_view] [--ddp_static_graph]

    [--clip_skip CLIP_SKIP] [--logging_dir LOGGING_DIR] [--log_with {tensorboard,wandb,all}]

    [--log_prefix LOG_PREFIX] [--log_tracker_name LOG_TRACKER_NAME]

    [--wandb_run_name WANDB_RUN_NAME] [--log_tracker_config LOG_TRACKER_CONFIG]

    [--wandb_api_key WANDB_API_KEY] [--log_config] [--noise_offset NOISE_OFFSET]

    [--noise_offset_random_strength] [--multires_noise_iterations MULTIRES_NOISE_ITERATIONS]

    [--ip_noise_gamma IP_NOISE_GAMMA] [--ip_noise_gamma_random_strength]

    [--multires_noise_discount MULTIRES_NOISE_DISCOUNT]

    [--adaptive_noise_scale ADAPTIVE_NOISE_SCALE] [--zero_terminal_snr]

    [--min_timestep MIN_TIMESTEP] [--max_timestep MAX_TIMESTEP]

    [--loss_type {l1,l2,huber,smooth_l1}] [--huber_schedule {constant,exponential,snr}]

    [--huber_c HUBER_C] [--huber_scale HUBER_SCALE] [--lowram] [--highvram]

    [--sample_every_n_steps SAMPLE_EVERY_N_STEPS] [--sample_at_first]

    [--sample_every_n_epochs SAMPLE_EVERY_N_EPOCHS] [--sample_prompts SAMPLE_PROMPTS]

    [--sample_sampler {ddim,pndm,lms,euler,euler_a,heun,dpm_2,dpm_2_a,dpmsolver,dpmsolver++,dpmsingle,k_lms,k_euler,k_euler_a,k_dpm_2,k_dpm_2_a}]

    [--config_file CONFIG_FILE] [--output_config] [--prior_loss_weight PRIOR_LOSS_WEIGHT]

    [--conditioning_data_dir CONDITIONING_DATA_DIR] [--masked_loss] [--deepspeed]

    [--zero_stage {0,1,2,3}] [--offload_optimizer_device {None,cpu,nvme}]

    [--offload_optimizer_nvme_path OFFLOAD_OPTIMIZER_NVME_PATH]

    [--offload_param_device {None,cpu,nvme}]

    [--offload_param_nvme_path OFFLOAD_PARAM_NVME_PATH] [--zero3_init_flag]

    [--zero3_save_16bit_model] [--fp16_master_weights_and_gradients]

    [--optimizer_type OPTIMIZER_TYPE] [--use_8bit_adam] [--use_lion_optimizer]

    [--learning_rate LEARNING_RATE] [--max_grad_norm MAX_GRAD_NORM]

    [--optimizer_args [OPTIMIZER_ARGS ...]] [--lr_scheduler_type LR_SCHEDULER_TYPE]

    [--lr_scheduler_args [LR_SCHEDULER_ARGS ...]] [--lr_scheduler LR_SCHEDULER]

    [--lr_warmup_steps LR_WARMUP_STEPS] [--lr_decay_steps LR_DECAY_STEPS]

    [--lr_scheduler_num_cycles LR_SCHEDULER_NUM_CYCLES]

    [--lr_scheduler_power LR_SCHEDULER_POWER] [--fused_backward_pass]

    [--lr_scheduler_timescale LR_SCHEDULER_TIMESCALE]

    [--lr_scheduler_min_lr_ratio LR_SCHEDULER_MIN_LR_RATIO]

    [--dataset_config DATASET_CONFIG] [--min_snr_gamma MIN_SNR_GAMMA]

    [--scale_v_pred_loss_like_noise_pred] [--v_pred_like_loss V_PRED_LIKE_LOSS]

    [--debiased_estimation_loss] [--weighted_captions] [--cpu_offload_checkpointing]

    [--no_metadata] [--save_model_as {None,ckpt,pt,safetensors}] [--unet_lr UNET_LR]

    [--text_encoder_lr [TEXT_ENCODER_LR ...]] [--fp8_base_unet]

    [--network_weights NETWORK_WEIGHTS] [--network_module NETWORK_MODULE]

    [--network_dim NETWORK_DIM] [--network_alpha NETWORK_ALPHA]

    [--network_dropout NETWORK_DROPOUT] [--network_args [NETWORK_ARGS ...]]

    [--network_train_unet_only] [--network_train_text_encoder_only]

    [--training_comment TRAINING_COMMENT] [--dim_from_weights]

    [--scale_weight_norms SCALE_WEIGHT_NORMS] [--base_weights [BASE_WEIGHTS ...]]

    [--base_weights_multiplier [BASE_WEIGHTS_MULTIPLIER ...]] [--no_half_vae]

    [--skip_until_initial_step] [--initial_epoch INITIAL_EPOCH]

    [--initial_step INITIAL_STEP] [--validation_seed VALIDATION_SEED]

    [--validation_split VALIDATION_SPLIT] [--validate_every_n_steps VALIDATE_EVERY_N_STEPS]

    [--validate_every_n_epochs VALIDATE_EVERY_N_EPOCHS]

    [--max_validation_steps MAX_VALIDATION_STEPS] [--cache_text_encoder_outputs]

    [--cache_text_encoder_outputs_to_disk]

    [--text_encoder_batch_size TEXT_ENCODER_BATCH_SIZE] [--disable_mmap_load_safetensors]

    [--weighting_scheme {sigma_sqrt,logit_normal,mode,cosmap,none,uniform}]

    [--logit_mean LOGIT_MEAN] [--logit_std LOGIT_STD] [--mode_scale MODE_SCALE]

    [--blocks_to_swap BLOCKS_TO_SWAP] [--qwen3 QWEN3] [--llm_adapter_path LLM_ADAPTER_PATH]

    [--llm_adapter_lr LLM_ADAPTER_LR] [--self_attn_lr SELF_ATTN_LR]

    [--cross_attn_lr CROSS_ATTN_LR] [--mlp_lr MLP_LR] [--mod_lr MOD_LR]

    [--t5_tokenizer_path T5_TOKENIZER_PATH]

    [--qwen3_max_token_length QWEN3_MAX_TOKEN_LENGTH]

    [--t5_max_token_length T5_MAX_TOKEN_LENGTH] [--discrete_flow_shift DISCRETE_FLOW_SHIFT]

    [--timestep_sampling {sigma,uniform,sigmoid,shift,flux_shift}]

    [--sigmoid_scale SIGMOID_SCALE] [--attn_mode {torch,xformers,flash,sageattn,sdpa}]

    [--split_attn] [--vae_chunk_size VAE_CHUNK_SIZE] [--vae_disable_cache]

    [--unsloth_offload_checkpointing]

    anima_train_network.py: error: unrecognized arguments: ph0t0an1ma,upper body shot of a man wearing a tuxedo in a forest

    Training finished with exit code 2

    Press any key to continue . . .



    7err4
    Author
    Jun 8, 2026

    @burnera679889 it seems you put your sample prompt into the extra args field (ex used for --clip_skip 2). Put it into the correct sample prompt field and the error should be gone

    burnera679889Jun 8, 2026

    @7err4 I thought it was in the sample prompt section but maybe it messed up when I updated. Im still using the same workflow as the prior version so if changing the prompt doesnt work ill try the newest workflow

    burnera679889Jun 9, 2026· 1 reaction

    I see what went wrong, the update switched the extra args and sample prompt boxes, my bad.

    pxmannMay 6, 2026· 1 reaction
    CivitAI

    yea brah just make tutorial lol im trying to make a lighting style lora

    cubby_aiMay 13, 2026· 1 reaction
    CivitAI

    I keep getting this error

    G:\ComfyUI\.venv\Lib\site-packages\torch\distributed\distributed_c10d.py:1763: UserWarning: Attempted to get default timeout for nccl backend, but NCCL support is not compiled timeout = getdefault_timeout(backend)Traceback (most recent call last): File "G:\Forge\stable-diffusion-webui-forge\outputs\LoraTraining\neonnights\examples\_train_wrapper_20260513_085448.py", line 7, in <module> runpy.run_path(r"G:\ComfyUI\sd-scripts\anima_train_network.py", run_name="__main__") File "<frozen runpy>", line 287, in run_path File "<frozen runpy>", line 98, in runmodule_code File "<frozen runpy>", line 88, in runcode File "G:\ComfyUI\sd-scripts\anima_train_network.py", line 451, in <module> trainer.train(args) File "G:\ComfyUI\sd-scripts\train_network.py", line 592, in train accelerator = train_util.prepare_accelerator(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\ComfyUI\sd-scripts\library\train_util.py", line 5636, in prepare_accelerator accelerator = Accelerator( ^^^^^^^^^^^^ File "G:\ComfyUI\.venv\Lib\site-packages\accelerate\accelerator.py", line 461, in init self.state = AcceleratorState( ^^^^^^^^^^^^^^^^^ File "G:\ComfyUI\.venv\Lib\site-packages\accelerate\state.py", line 901, in init PartialState(cpu, **kwargs) File "G:\ComfyUI\.venv\Lib\site-packages\accelerate\state.py", line 227, in init torch.distributed.init_process_group(backend=self.backend, **kwargs) File "G:\ComfyUI\.venv\Lib\site-packages\torch\distributed\c10d_logger.py", line 83, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "G:\ComfyUI\.venv\Lib\site-packages\torch\distributed\c10d_logger.py", line 97, in wrapper func_return = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "G:\ComfyUI\.venv\Lib\site-packages\torch\distributed\distributed_c10d.py", line 1806, in init_process_group store, rank, world_size = next(rendezvous_iterator) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\ComfyUI\.venv\Lib\site-packages\torch\distributed\rendezvous.py", line 270, in envrendezvous_handler rank = int(_get_env_or_raise("RANK")) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\ComfyUI\.venv\Lib\site-packages\torch\distributed\rendezvous.py", line 255, in getenv_or_raise raise enverror(env_var)ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable RANK expected, but not setTraining finished with exit code 1Press any key to continue . . .

    7err4
    Author
    May 14, 2026

    @cubby_ai - I updated the package.

    What was happening: something else on your system (probably another LoRA training tool, or a previous accelerate config run) had set your environment to "multi-GPU mode". That setting can't actually work on Windows at all - the multi-GPU communication library it needs (NCCL) is Linux-only and was never compiled into your PyTorch. So that config was never going to deliver multi-GPU training on your machine anyway; it just sat there waiting to crash anything that respected it.

    The new version writes its own settings file for each training run that explicitly says "single GPU", so my pack will work regardless. But I'd also recommend deleting the broken global config, otherwise the same crash will keep hitting any other Python tool on your system that uses HuggingFace's accelerate (kohya_ss, OneTrainer, ai-toolkit, plain accelerate launch, etc.). The file lives at:

    %USERPROFILE%\.cache\huggingface\accelerate\default_config.yaml

    Just delete it. The next tool that needs accelerate will auto-create a sane default, or you can run accelerate config default from any Python venv to regenerate one explicitly.

    cubby_aiMay 14, 2026

    @7err4 Thank you I will try again

    cubby_aiMay 14, 2026

    @7err4 Sorry, but to update do I just redownload your workflow? It looks like it's not available for download anymore here

    ArtificialSweetener_May 14, 2026· 1 reaction
    CivitAI

    This is very nice of you to put together, but it's really not a good way to release custom nodes! If you need help or advice on using git and the comfy registry hmu on here or on discord (artificialsweetener), I don't mind walking you through it.

    I hope you're not offended I'm just assuming you don't know, my apologies if not releasing to comfy or github was a conscious choice.

    7err4
    Author
    May 14, 2026· 1 reaction

    Appreciate the offer - no offense taken at all. It's actually a conscious choice. I'm keeping things off GitHub / the Comfy registry for personal discretion and privacy reasons, so the Civitai zip drop is the trade-off I'm making even though I know it's not the cleanest distribution path.

    @7err4 Alright, alright. It's a shame because this could end up becoming critical infrastructure! Thanks for putting in the work.

    meikerAI3dMay 23, 2026· 1 reaction
    CivitAI

    Я пробовал в Comfyui тренировать как то Illustrious модели. Почему то выходило на тесте хорошо в sample. А при использованные была каша. Незнаю в чем дело но с того случая я использую старый добрый kohya_ss

    sharmarockon2000271Jun 8, 2026
    CivitAI

    help, how do i fix this - D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\cuda\__init__.py:63: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.

    import pynvml # type: ignore[import]

    Traceback (most recent call last):

    File "D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\output\_train_wrapper_20260608_142047.py", line 21, in <module>

    runpy.run_path(r"D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\sd-scripts\anima_train_network.py", run_name="__main__")

    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "<frozen runpy>", line 287, in run_path

    File "<frozen runpy>", line 98, in runmodule_code

    File "<frozen runpy>", line 88, in runcode

    File "D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\sd-scripts\anima_train_network.py", line 8, in <module>

    from accelerate import Accelerator

    ModuleNotFoundError: No module named 'accelerate'

    7err4
    Author
    Jun 8, 2026

    Quick explanation of what's happening: the trainer needs a piece of software called accelerate to run, but it isn't installed in your ComfyUI's Python yet. ComfyUI itself doesn't use it, so it doesn't ship with it. It's something the SD-Scripts Manager node in this pack is supposed to install for you the first time it runs. For some reason that didn't happen on your install.

    Fastest fix: in your workflow, run the SD-Scripts Manager node with action = install_or_update once and watch its status output for any "pip install failed" warning. That node installs accelerate and the rest of the missing pieces. If the node isn't in your workflow, the example workflow that ships with the pack has it wired correctly. Drop that one in and run it.

    If the Manager runs but you still get the same error after, install the missing pieces manually. Open Command Prompt and paste this:

    D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install -r

    D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\sd-scripts\requirements.txt

    If that succeeds, training should run after. If it shows its own error message, paste it here and I'll take a look.

    artyenjoyer3638Jun 12, 2026

    @7err4 I am also using the portable version of comfyui have a similar issue with the accelerator, and in the console I get: [Anima LoRA Training] WARNING: bitsandbytes is installed but its CUDA backend failed to load (the str2optimizer8bit_blockwise symbol is missing). Falling back from AdamW8bit to AdamW so training can still run. Trade-off: ~2x more VRAM on the optimizer state. To restore the 8-bit path, repair bitsandbytes — this is usually a CUDA version mismatch with your PyTorch build.

    Well, I went and checked the pytorch build being used by comfyui portable and it is v2.12.0, which is no longer apparently supported by bitsandbytes. This issue might be specific to the portable version of comfui, but I am not sure.

    Also, I did run a check and all the requirements apparently installed correctly.

    7err4
    Author
    Jun 12, 2026

    @artyenjoyer3638 
    Please check the sd-scripts folder inside of your comfyui directory

    Look for a folder called venv (or .venv). If you see one, that's what's causing the missing accelerate error.

    You have two options:

    Option A (easiest): Delete the venv folder. The trainer will then automatically use ComfyUI's own Python, which already has everything installed. Nothing else needed, just re-run your training workflow.

    Option B: Keep the venv but install the missing pieces into it.
    <your sd-scripts path>\venv\Scripts\python.exe -m pip install -r <your sd-scripts path>\requirements.txt

    If you don't see a venv or .venv folder anywhere inside sd-scripts, then the cause is different and I'd need more details to dig in further.

    About the bitsandbytes warning you also saw: that one is not actually a problem. bitsandbytes is only used for an optional optimizer called AdamW8bit that uses a bit less VRAM. When the pack detects that bitsandbytes isn't working on your system, it automatically switches to the regular AdamW optimizer and continues training without any issues. The only difference is the optimizer uses slightly more VRAM, which on most cards doesn't matter at all. You can safely ignore that warning, the pack is handling it for you.

    artyenjoyer3638Jun 13, 2026

    @7err4 Didn't find a venv folder anywhere even with a search, but I did run the requirements installation manually, which then gives me a new error (progress?):

    File "<frozen runpy>", line 287, in run_path

    File "<frozen runpy>", line 98, in runmodule_code

    File "<frozen runpy>", line 88, in runcode

    File "C:\ComfyUI_windows_portable\ComfyUI\sd-scripts\anima_train_network.py", line 26, in <module>

    from library.dataset import DatasetGroup, MinimalDataset

    File "C:\ComfyUI_windows_portable\ComfyUI\sd-scripts\library\dataset.py", line 38, in <module>

    import imagesize

    ModuleNotFoundError: No module named 'imagesize'

    Training finished with exit code 1

    7err4
    Author
    Jun 14, 2026

    @artyenjoyer3638 

    This means sd-scripts' requirements list is missing one piece (imagesize). It's a quirk on the sdscripts side, not the comfyui workflow itself.

    ex. >> C:\ComfyUI_windows_portable\python_embeded\python.exe -m pip install imagesize

    Run your training workflow after. If another ModuleNotFoundError: No module named '<something>' shows up, install that one the same way (replace imagesize with whatever name the error shows).

    artyenjoyer3638Jun 16, 2026· 1 reaction

    @7err4 I had to do what you said for both 'imagsize' and 'voluptuous' afterwards, but it works. Cheers, amazing tool

    kim_chen_inJun 15, 2026
    CivitAI

    где можно глянуть как выглядят датасеты? и как их автоматически описывать?

    wakko20233Jun 21, 2026
    CivitAI

    worked perfectly thank you :)

    wakko20233Jun 21, 2026· 1 reaction
    CivitAI

    with this one been a success would you have one for illustrious

    PotatoesAIJul 3, 2026· 1 reaction
    CivitAI

    It worked for me.

    https://civitai.red/models/2429840/twinflame413

    Thanks a lot for bringing the training INSIDE ComfyUI.

    VioletCrowJul 9, 2026
    CivitAI

    I am sorry if this is a dumb question but is it at all posibble to run this with just 10 gb of vram for Anima training? Thanks!

    WalnutphysicsJul 12, 2026· 1 reaction

    That's more than enough, not sure about this exact workflow but another popular trainer is designed for at least 6GB VRAM.

    VioletCrowJul 12, 2026

    @Walnutphysics Awesome! Thank you!

    naruto12b3480Jul 11, 2026
    CivitAI

    This worked very great

    MilawaJul 31, 2026
    CivitAI

    The training doesn't start, it only print :

    "[AnimaVRAMEstimator] peak estimate report generated (verdict: fits)

    [INFO] Prompt executed in 15.06 seconds"

    The Config Preview (Anima) node says that everything is fine, there no error so i don't understand. The .toml file is downloaded in the output folder and that's it.

    7err4
    Author
    Jul 31, 2026

    The .toml being created means everything up to the launch worked. Right before opening the training window, the launcher checks if sd-scripts' dependencies are installed in your ComfyUI Python. If that fails, it currently stops without showing you the error. Most likely the requirements didn't install properly on your setup.

    What to do:

    Run the SD-Scripts Manager node with action = install_or_update and install_requirements = true, then try again.

    Still nothing? Set dry_run = true on the launcher, run once, then double-click the launch_training_....bat in your output folder. The window stays open and shows the real error. Paste it here and I'll help.

    MilawaJul 31, 2026

    @7err4 It did create another folder, but once again no error is displayed:

    #!/bin/bash cd "/content/drive/MyDrive/ComfyUI/sd-scripts" /usr/bin/python3 /content/drive/MyDrive/ComfyUI/sd-scripts/anima_train_network.py --config_file /content/drive/MyDrive/ComfyUI/models/loras/training_config_20260731_200220.toml echo "Training complete. Press Enter to close." read

    I'm using ComfyUI through Google Colab. For some reason, it just doesn't seem to work there.

    7err4
    Author
    Jul 31, 2026

    I published a fix.

    Quick explanation of what went wrong: on a normal PC the launcher opens a new terminal window for training. This doesn't work on Colab, so that step failed on your setup.

    The error message ended up in a node output that the default workflow never displays, which is why you saw nothing at all.

    Both is fixed now: the launcher detects headless setups like Colab and runs training in the background instead, writing everything to a training_log_....txt in your output folder.

    The launcher now shows its status directly on the node, so nothing fails silently anymore.

    Grab the new version and let me know if it works!

    Workflows
    Anima

    Details

    Downloads
    1,542
    Platform
    CivitAI
    Platform Status
    Available
    Created
    3/29/2026
    Updated
    8/25/2026
    Deleted
    -

    Files

    animaLoraTrainerFor_v10.zip

    Mirrors

    HuggingFace (1 mirrors)
    CivitAI (1 mirrors)

    animaLoraTrainerFor_v10.zip

    Mirrors

    HuggingFace (1 mirrors)
    CivitAI (1 mirrors)

    animaLoraTrainerFor_v10.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v11.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v10.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v10.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v10.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v11.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v11.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v11.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v11.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v10.zip

    Mirrors

    CivitAI (1 mirrors)

    animaLoraTrainerFor_v10.zip

    Mirrors

    CivitAI (1 mirrors)