Nodes/ComfyUI_LC123_nodes/LC Model Optimizer ⚡
ComfyUI Node

LC Model Optimizer ⚡

The Loader That Picks Your Files For You

By lonecatone23·Created 3 months ago·Updated about 23 hours ago· 46
LC Model Optimizer ⚡
    • model
    • clip
    • vae
    • summary
    ◄base_modelKrea 2 (Turbo)►
    ◄goalOptimal►
    ◄model_file★ Recommended►
    ◄text_encoder★ Recommended►
    ◄vae★ Recommended►
    ◄speed_upsAuto►
    ◄attentionauto►
    ◄fp16_accumulationauto►
    ◄step_cacheauto►
    ◄torch_compileoff►
    ◄qwen21_cacheauto►
    ◄clip_typeauto►
    ◄spectrumauto►

    The hardest part of ComfyUI in 2026 isn't prompting. It's the file menu. Anima wants qwen_3_06b_base, Krea 2 wants a Qwen3-VL 4B, Klein 9B wants a Qwen3 8B, and the diffusion model itself could be bf16, fp8, nvfp4, INT8 ConvRot or a GGUF at Q8/Q6/Q4/Q2 - with the text encoder as a second VRAM budget you have to fit alongside it. Get it wrong and you either OOM or quietly run a mismatched encoder.

    LC Model Optimizer is a loader that answers the "which file, and does it fit?" question for you. It replaces your model, text encoder and VAE loaders with one node, and it picks based on a report actually measured on your card.

    How it decides

    The node leans on the pack's System & Model Optimization Report (Settings → LC123 Settings ⚙️ → Optimization, or right-click the empty canvas). That report tests your hardware - GPU, VRAM, RAM, page file, drive speed, PCIe link - and actually runs the speed-up stack rather than looking it up: Sage, Triton, Sol-Attn, Comfy Kitchen, fp8/int8/nvfp4, llama-cpp. It takes about ten seconds.

    You pick two things:

    • base_model - Krea 2 Turbo, Krea 2 Raw, Qwen-Image 2.1, Z-Image Turbo, Flux.2 Klein base 9B, Ideogram 4, Anima, SDXL 1.0, Illustrious XL, Pony Diffusion V6 XL, or Custom. The SDXL family loads as one all-in-one checkpoint, so its text encoder and VAE come from the checkpoint.
    • goal - Quality (closest to bf16), Optimal (fast and near identical), or Fast (fastest that still looks right). This is the same Quality/Optimal/Fast ladder the report uses when it tells you what file type to get.

    Every file widget then defaults to ★ Recommended, which names the exact file the report picked for your machine. No report yet? It falls back to Comfy's own default files and shows a 💡 telling you to run it. The pickers browse your model folders with search, offer ⬇ Download entries for recommended files you don't have yet (downloaded on the first run), list what's already on disk for that model - including versioned finetunes like Krealism and Animosity - and then show all your folders, so third-party merges work too.

    summary is a STRING output describing what it loaded, which is worth wiring to a Show Text node when you're debugging a new model.

    Speed-ups, and why auto is usually right

    The interesting half is the switch panel at the bottom:

    • attention - auto picks the fastest backend that passed the report's test (pytorch, sage, sage3, flash, xformers, comfy_kitchen_int8). Note the word "tested": a Sage build that runs and outputs grey noise gets flagged, not trusted. Given how many machines Sage Attention silently corrupts on - Z-Image Base the loudest case - handing that decision to something that measures beats copying a config off Reddit.
    • fp16_accumulation - faster fp16 math with a small quality cost. auto = Fast goal only.
    • step_cache - EasyCache, which skips steps that barely change. auto = Fast goal, 20+ steps.
    • torch_compile - off by default. Needs Triton; first run is slow.
    • qwen21_cache - Qwen-Image 2.1 only: where the KV cache lives and how it's stored. int8 halves it at roughly bf16 accuracy; int4 quarters it at about double the per-step error.

    Set speed_ups to Manual and you choose each one yourself.

    Install

    The pack has no requirements.txt - it runs on the torch and numpy ComfyUI already ships.

    cd ComfyUI/custom_nodes
    git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes.git
    

    Restart, or install via ComfyUI Manager by searching ComfyUI LC123 Nodes. Optional companions: ComfyUI-GGUF if you want quantized files (the node falls back to the calcuis gguf pack if a GGUF is refused), and Triton if you want torch_compile.

    Where people get burned

    Downloads are the fragile bit. The ⬇ entries pull from Hugging Face on first queue. Gated repos - MiniMax H3 and friends - require you to accept the licence on the repo page and be logged in locally, otherwise the run dies with a "this repo is gated" error mid-queue. Expect the first run after picking a download to look like a hang; it's a multi-gigabyte fetch with a progress line in the console.

    A mismatched encoder won't stop you. If you hand it a text encoder that doesn't belong to the base model - Qwen3 8B on Krea 2, say - it reads the file header and shows a ⚠️ hint. It still runs it. That's deliberate: finetunes and odd merges are legitimate, and the check costs one header read rather than a model load. But the warning is information, not decoration.

    Custom means custom. On base_model: Custom, recommendations, estimates and file checks all say unsupported, and clip_type becomes your job - that's how the encoder gets loaded, the same value as CLIPLoader's type (chroma, for instance, on Chroma). auto handles it when the encoder's shape matches a known model.

    CategoryLC123/optimizer

    Inputs (13)

    NameTypeDefaultDescription
    base_modelCOMBOKrea 2 (Turbo)The model family. Picks the recommended files and the checks.
    goalCOMBOOptimalQuality = closest to bf16. Optimal = fast and near identical. Fast = fastest that still looks right.
    model_fileCOMBO★ Recommended88 options: ★ Recommended, From checkpoint, None, ⬇ Download: anima-base-v1.0.safetensors, ⬇ Download: anima-base-v1.0-fp8.safetensors, ⬇ Download: anima-base-v1.0-int8convrot.safetensors, +82
    text_encoderCOMBO★ Recommended27 options: ★ Recommended, From checkpoint, None, ⬇ Download: qwen_3_06b_base.safetensors, ⬇ Download: qwen_3_8b.safetensors, ⬇ Download: qwen_3_8b_fp8mixed.safetensors, +21
    vaeCOMBO★ Recommended8 options: ★ Recommended, From checkpoint, None, ⬇ Download: qwen_image_vae.safetensors, ⬇ Download: flux2-vae.safetensors, ⬇ Download: flux2-vae_small.safetensors, +2
    speed_upsCOMBOAutoAuto = from the System & Model Optimization Report. Manual = choose each one below.
    attentionCOMBOautoAttention backend. auto = the fastest one that passed the report's test.
    fp16_accumulationCOMBOautoFaster fp16 math with a small quality cost. auto = Fast goal only.
    step_cacheCOMBOautoEasyCache: skips steps that barely change. auto = Fast goal, 20+ steps.
    torch_compileCOMBOoffCompiles the model: the first run is slow, later runs are faster. Needs Triton.
    qwen21_cacheCOMBOautoQwen-Image 2.1 only (Qwen Image 2.1 Cache): where the KV cache lives and how it is stored. auto = lossless, int8 on the Fast goal or cards under 16 GB. int8 halves the cache at about bf16 accuracy, int4 quarters it but roughly doubles the per-step error. RAM costs little speed. off = slowest.
    clip_typeCOMBOautoCustom only: how the text encoder is loaded (CLIPLoader's type). auto = from the encoder's shape when it matches one known base model. Ignored for the other base models and for a checkpoint's own encoder.
    spectrumoptCOMBOautoMOSS Image and Krea 2: Spectrum forecasts some steps instead of running them, with no visible change in our tests (MOSS about 1.7x, Krea 2 Turbo about 1.35x, Raw about 1.6x). Built in, nothing to install. auto = Optimal and Fast goals; the first 20% of the steps always run (the layout forms there) and it sits out runs under 8 steps. off = opt out (works with speed_ups on Auto too). Replaces the step cache when on.

    Outputs (4)

    NameTypeDescription
    modelMODEL—
    clipCLIP—
    vaeVAE—
    summarySTRING—