ComfyUI Node

IA3 Arguments

IA3's settings, for when you want the cheapest adapter that still works

By heshengtao·Created 2 years ago·Updated 2 years ago· 7
IA3 Arguments
    • peft_args
    num_virtual_tokens20
    token_dim768
    num_transformer_submodules1
    num_attention_heads12
    num_layers12
    ia3_alpha32.0
    ia3_dropout0.10
    is_enabletrue

    IA3_Arguments builds the PEFT IA3Config for the LLM School trainer's IA3 method. IA3 (Infused Adapter by Inhibited and Amplified inner Activations) is the sleeper pick in the parameter-efficient tuning lineup: instead of adding low-rank matrices like LoRA, it learns a small set of scaling vectors that multiply the activations inside the attention and feedforward layers. It's cheaper than LoRA on trainable parameters and frequently competitive on quality - which is why it's a favorite in research papers and a mystery to most people in the UI.

    If you've already got a working LoRA recipe on this pack, this node is the "same idea, fewer parameters, different flavor" experiment. It's not the node to learn the pack on - LoRA's defaults are better documented and this node, as you're about to see, needs a source patch to run at all.

    The inputs that matter

    • ia3_alpha - default 32. The scaling applied to the learned vectors, filling the same role as lora_alpha. The "alpha ≈ 2×r" instinct doesn't transfer here because there's no rank; 32 is PEFT's own default and a fine starting point.
    • ia3_dropout - default 0.1. Regularization on the IA3 parameters. Leave it.
    • num_virtual_tokens, token_dim, num_transformer_submodules, num_attention_heads, num_layers - the usual PEFT-config defaults surfaced as inputs. For IA3 they're mostly structural noise; the one that matters is token_dim if your model isn't GPT-2-shaped (set it to your model's hidden size).
    • is_enable - the pack's standard off switch; false returns None, and the trainer then skips PEFT entirely.

    The bug you'll hit immediately

    Same flaw as P_or_Prompt_Arguments: the node's Argument() method requires a task_type parameter that isn't in the node's inputs. Executing the node raises TypeError: Argument() missing 1 required positional argument: 'task_type'. There's no UI workaround - you must edit train.py. Give the parameter a default (task_type="CAUSAL_LM") or delete it from the signature and the args dict it builds. One-line change, and it's the difference between this node existing and this node working.

    Install

    Same as every node in the pack - ComfyUI Manager, search "comfyui_LLM_schools":

    cd ComfyUI/custom_nodes
    git clone https://github.com/heshengtao/comfyui_LLM_schools
    

    then restart, with Manager installing huggingface_hub, datasets, transformers, peft.

    Other things that'll trip you up

    • The trainer's fine_tuning_method must be exactly IA3 for this node's output to be consumed, and the pack's default full_fine_tuning raises ValueError in the current code anyway.
    • Missing config.ini in the pack folder (copy config.ini.exampleconfig.ini) silently breaks node loading.
    • IA3Config's alpha argument changed names across PEFT versions (alphaia3_alpha). The node uses ia3_alpha, which matches current PEFT - but if you see a TypeError: IA3Config.__init__() got an unexpected keyword argument 'ia3_alpha', your PEFT is old; update it.

    The honest take: IA3 is the pack's most interesting method and its least finished node. If you're up for a source patch and a PEFT version check, it's worth trying - the parameter savings are real. If not, LoRA is the path of least resistance.

    Category大模型学校(llm_schools)/模型训练(Model Training)

    Inputs (8)

    NameTypeDefaultDescription
    num_virtual_tokensINT201–100
    token_dimINT7681–4096
    num_transformer_submodulesINT11–12
    num_attention_headsINT121–16
    num_layersINT121–24
    ia3_alphaFLOAT32.00–100
    ia3_dropoutFLOAT0.100–1
    is_enableBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    peft_argsARGS