Nodes/FL PixelGen/FL PixelGen Training Config
ComfyUI Node

FL PixelGen Training Config

The config bundle that decides whether your LoRA trains or cooks

By filliptm·Created 6 months ago·Updated 4 months ago· 13
FL PixelGen Training Config
    • config
    lora_rank8
    lora_alpha16
    lora_dropout0.10
    learning_rate0.0001
    epochs100
    batch_size1
    gradient_accumulation4
    save_every10
    max_grad_norm1.0
    seed42
    warmup_steps100
    feat_loss_weight0.5
    lpips_weight1.0
    dino_weight1.0
    percept_ratio1.0
    noise_gating_threshold0.00
    cfg_dropout0.10
    output_dir./output/pixelgen

    This node doesn't generate anything. It's the settings bundle for the pack's training side: one node, roughly seventeen knobs, and a single PIXELGEN_TRAINING_CONFIG output that you plug into FL PixelGen Train. Think of it as the trainer's control panel, deliberately centralized so you don't hunt for hyperparameters across half a dozen nodes. Its tooltips are genuinely good - read them; the author wrote real advice in there, not placeholder text.

    The LoRA section - the ones a beginner actually sets:

    • lora_rank - default 8. The tooltip says it plainly: start at 8, go 16–32 for complex styles. Higher rank = more expressive, slower, bigger files. For a character or style LoRA on a small dataset, 8–16 is the sane zone.
    • lora_alpha - default 16. The tooltip's advice ("typically 2x the rank") is the classic guidance, and it still holds here.
    • lora_dropout - 0.1 default; bump to 0.2–0.3 if your dataset is tiny so it doesn't memorize.
    • learning_rate - 1e-4 default. Too high and it destabilizes, too low and it learns nothing; drop to 5e-5 if the loss is noisy.
    • epochs - 100 default. Watch the live loss curve; when it plateaus or rises you're overfitting, not making progress.
    • batch_size and gradient_accumulation - batch 1 + accumulation 4 gives an effective batch of 4 while barely touching VRAM. That's the right reflex on a 12GB card: raise accumulation, not batch size.

    The REPA section is the interesting, pack-specific part. "REPA" is representation alignment: on top of the flow-matching velocity loss, training also pushes the denoiser's features to match DINOv2 (cosine alignment), adds LPIPS perceptual loss, and adds DINO multi-layer feature matching. The weights for each: feat_loss_weight (0.5), lpips_weight (1.0), dino_weight (1.0), plus percept_ratio as a global multiplier over the perceptual losses. Then noise_gating_threshold (0.0) limits perceptual losses to less-noisy timesteps, and cfg_dropout (0.1) randomly drops text conditioning during training to make classifier-free guidance work at inference. If that all sounds like a lot: it is, and the defaults are a reasonable starting point. Tune the four weight sliders only after your first baseline run.

    The rest: warmup_steps (100), save_every (10 - also triggers validation), max_grad_norm (1.0), seed (42), and output_dir (defaults to ./output/pixelgen). Under the hood the config is bundled into three groups - lora, training, repa - with target modules (qkv_x, kv_y, proj, w12, w3, qkv) already chosen for you.

    Install is the pack default (Manager search "FL PixelGen", or clone + pip install -r requirements.txt). This node itself has no model downloads; the heavy lifting happens when the Train node first runs and pulls DINOv2, LPIPS, and the text encoder.

    Where people get burned: mostly by assuming the training knobs transfer from SDXL-era guides. A 1e-4 LR with accumulation is fine here; rank tables from the SDXL days don't port, and neither does "train the text encoder" - this pipeline freezes it and caches captions instead. If your loss curve is a hockey stick, lower the LR before you touch the REPA weights. And if the whole thing feels intimidating, that's the honest state of training-in-a-node-graph: the config is the easy part, the dataset is the real work.

    CategoryFL/PixelGen/Training

    Inputs (18)

    NameTypeDefaultDescription
    lora_rankINT81–128Number of low-rank dimensions per adapter. Higher rank = more expressive but slower training and larger files. Start with 8, increase to 16-32 for complex styles.
    lora_alphaINT161–256Scaling factor for LoRA weights. Typically set to 2x the rank. Higher values make the LoRA effect stronger during training.
    lora_dropoutFLOAT0.100–0.5Randomly drops LoRA connections during training to prevent overfitting. 0.1 is a good default; increase to 0.2-0.3 for very small datasets.
    learning_rateFLOAT0.00010.000001–0.01How fast the model learns. Too high causes instability, too low learns nothing. 1e-4 is a solid starting point; lower to 5e-5 if loss is noisy.
    epochsINT1001–10000Number of full passes through the dataset. More epochs = more training. Watch the loss curve — if it plateaus or rises, you're overfitting.
    batch_sizeINT11–8Images processed in parallel per step. Higher values give smoother gradients but use more VRAM. Effective batch = batch_size x gradient_accumulation.
    gradient_accumulationINT41–32Simulates a larger batch by accumulating gradients across multiple steps before updating weights. Increase this instead of batch_size to save VRAM.
    save_everyINT101–1000Save a checkpoint every N epochs. Lower values give more recovery points but use more disk space. Also triggers validation inference if a prompt is set.
    max_grad_normFLOAT1.00.1–10Clips large gradients to prevent training explosions. 1.0 is standard. Only increase if training is very stable and loss is stalling.
    seedINT420–18446744073709550000Random seed for reproducibility. Same seed + same settings = same training run.
    warmup_stepsoptINT1000–10000Gradually ramps up the learning rate from 10% to full over this many steps. Prevents early instability. 100 steps is a safe default.
    feat_loss_weightoptFLOAT0.50–10Weight for cosine feature alignment between denoiser and DINOv2 features (REPA). Higher values push the model to match DINOv2's semantic understanding.
    lpips_weightoptFLOAT1.00–10Weight for LPIPS perceptual loss. Encourages outputs that look perceptually similar to the target. Higher values prioritize visual quality over exact pixel matching.
    dino_weightoptFLOAT1.00–10Weight for DINO multi-layer feature matching loss. Guides the model to capture high-level structure and object features from DINOv2.
    percept_ratiooptFLOAT1.00–10Global multiplier for all perceptual losses (LPIPS + DINO). Scale this to balance perceptual quality vs flow matching fidelity.
    noise_gating_thresholdoptFLOAT0.000–1Only apply perceptual losses when timestep t >= this threshold. Focuses perceptual guidance on less noisy samples where image structure is visible. 0 = always apply.
    cfg_dropoutoptFLOAT0.100–1Probability of dropping text conditioning during training. Teaches the model to generate without text guidance, improving classifier-free guidance quality at inference.
    output_diroptSTRING./output/pixelgenDirectory where training checkpoints and validation images are saved.

    Outputs (1)

    NameTypeDescription
    configPIXELGEN_TRAINING_CONFIG