Nodes/ComfyUI-LZNodes/LZ Checkpoint Loader & Encode
ComfyUI Node

LZ Checkpoint Loader & Encode

LZ Checkpoint Loader Loads and Encodes in a Single Step

By liz-ils·Created 8 months ago·Updated 14 days ago· 2
LZ Checkpoint Loader & Encode
    • MODEL
    • CLIP
    • VAE
    • positive
    • negative
    • positive_text
    • negative_text
    • lz_pipe
    • ckpt_name
    • ckpt_hash
    ◄ckpt_name▾►
    ◄positive►
    ◄negative►

    A stock ComfyUI graph needs three nodes to get a checkpoint moving: CheckpointLoaderSimple, then one CLIP Text Encode for the positive and another for the negative. LZCheckpointLoader - displayed as LZ Checkpoint Loader & Encode - does all three jobs in one box, and then hands you a bundle you can drag around as a single wire. If you write your prompts on the loader and never touch them again, that's three nodes off every workflow you build.

    How it works

    Under the hood it's the same call the core loader makes: comfy.sd.load_checkpoint_guess_config, with VAE and CLIP extraction enabled. "Guess" is the operative word - the checkpoint file itself declares what it is, so this works on any full checkpoint with a text encoder baked in (SD 1.5, SDXL, Illustrious, Pony, and friends). It then tokenizes your two prompts with that same CLIP and runs encode_from_tokens_scheduled, which is ComfyUI's own multi-chunk encode path, so 77-token chunking and BREAK behave exactly as they do in a stock text encoder. Textual-inversion embeddings resolve too, because the embeddings folder is passed through.

    The extra thing it does is hash the checkpoint file: stream it through SHA-256, keep the first 10 characters, cache that against the file's mtime. That's the ckpt_hash output - the one identifier that survives a renamed file, and the thing hosts key model auto-linking on.

    The inputs and outputs that matter

    Three inputs, no hidden ones: ckpt_name (your dropdown of models/checkpoints), and the positive / negative text boxes. Both default to empty strings, which is deliberate - leaving negative blank is perfectly valid and the node won't complain.

    The outputs are where this gets interesting, because there are ten of them. MODEL, CLIP and VAE are the plain loader outputs, and the positive / negative CONDITIONING sockets wire straight into an ordinary KSampler. If you ignore lz_pipe, this is just a loader with the encode step folded in.

    lz_pipe is the pack's context bus: one wire carrying model, clip, vae, both conditionings, both prompt strings, the checkpoint name and hash. Feed it to LZPipePack, LZKSamplerDecode or LZSaveImageAndLog and the rest of the graph stays readable instead of turning into noodles. positive_text and negative_text are the raw strings for logging or filename templates, and ckpt_name / ckpt_hash let a save node stamp the log with nothing else wired.

    The catch with any context bus is that it hides which version of a value is inside it. A pipe is a snapshot taken when the loader ran, so re-encode a prompt downstream and the pipe still carries the old conditioning.

    Installing it

    The whole pack is one clone and a restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/liz-ils/ComfyUI-LZNodes
    

    Or search ComfyUI-LZNodes in ComfyUI Manager - the publisher id is liz-ils. There is no requirements.txt in the repo at all: everything it imports is Python standard library plus ComfyUI's own comfy.sd / folder_paths. Nothing to pip install, no model files to download beyond the checkpoints you already have. (Some other nodes in the pack, like LZKrea2Loader, want ComfyUI v0.26.0 or newer. This one doesn't care.)

    Where people get burned

    It's not where you expect in the menu. Every node in the pack lands under the MyCustomNodes/ category - this one is MyCustomNodes/Loaders. Search "LZ" instead of scrolling the Loaders folder.

    No clip skip. There's no clip_skip input, and because the encode happens inside the node you can't bolt a CLIPSetLastLayer in front of it. Anime SDXL checkpoints that want CLIP skip -2 need the stock two-node route instead.

    It's for checkpoints, not for repackaged split models. If your model is a diffusion model plus a separate text encoder (Flux-style, Anima, Krea 2), the conditioning this node builds won't match - that's what the pack's dedicated loaders exist for.

    A negative prompt is dead weight at CFG 1. On guidance-distilled models (Turbo, Lightning, Hyper, and the Krea/Turbo presets in this pack's own sampler) the unconditional pass isn't even computed, so whatever you type in negative does nothing. Don't spend an afternoon tuning it; write constraints as presence in the positive instead.

    The hash costs a full file read once. First run on a 7 GB checkpoint spends a few seconds streaming the file. It's cached by mtime after that, so you only pay it once per model - but if a workflow feels slow to start, that's a candidate.

    The prompt lives on the loader, so editing text re-runs the node. Weights stay in ComfyUI's model cache, so you're not re-reading gigabytes each time, just re-encoding. That's the honest price of folding three nodes into one.

    CategoryMyCustomNodes/Loaders

    Inputs (3)

    NameTypeDefaultDescription
    ckpt_nameCOMBO0 options:
    positiveSTRING—
    negativeSTRING—

    Outputs (10)

    NameTypeDescription
    MODELMODEL—
    CLIPCLIP—
    VAEVAE—
    positiveCONDITIONING—
    negativeCONDITIONING—
    positive_textSTRING—
    negative_textSTRING—
    lz_pipeLZ_PIPE—
    ckpt_nameSTRING—
    ckpt_hashSTRING—