Nodes/pre_cfg_comfy_nodes_for_ComfyUI/Channel selector for 4 channels
ComfyUI Node

Channel selector for 4 channels

Which latent channels matter? Tell Pre CFG automatic scale with four toggles

By Extraltodeus·Created 2 years ago·Updated about a year ago· 66
Channel selector for 4 channels
    • CHANS
    channel_0true
    channel_1true
    channel_2true
    channel_3true

    Most people never look inside their latent space, and honestly most people don't need to. But when you're using a pre-CFG node like Pre CFG automatic scale, the per-channel logic works on the raw latent channels of your model's noise prediction - and on SD 1.5 and SDXL, that's exactly four of them. Channel selector for 4 channels is the smallest and most relevant member of this pack's selector family: four toggles, one output, and a direct line into how the auto-scale math treats each channel.

    That's the whole node, to be clear. It's a utility, not a processor. You get four channel_0 through channel_3 toggles, all defaulting to on, and it emits a single CHANS output. There's no model input - it doesn't touch your graph's data at all. What it produces is a little boolean list describing which channels you want to operate on, and the only consumer it's designed for is the channels_selection optional input on Pre CFG automatic scale (it can feed any of this pack's nodes that accept CHANS).

    So why would you bother? Because latent channels are not created equal, and the SDXL latent's four channels roughly track coarse layout, color, and detail. If you've ever seen a color cast or a structure problem that one channel of your prediction is clearly responsible for, you can leave that channel out of the auto-scale normalization - flip its toggle off - and let the other three carry the automatic logic. It's surgical, and it's the fastest way to learn which channel is causing the problem: toggle them off one at a time on a fixed seed and watch what changes. That's a genuinely useful diagnostic routine that this 10-second node enables.

    The pack generates the whole selector family from one class, so the 4-, 8-, 16-, 32-, 64-, and 128-channel versions behave identically - they just match how many latent channels your model's predictions have. If you're on SDXL or SD 1.5, four is your number. The bigger ones exist for models with wider latent spaces.

    Install it with the rest of the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Extraltodeus/pre_cfg_comfy_nodes_for_ComfyUI
    

    or via ComfyUI Manager by searching pre_cfg_comfy_nodes_for_ComfyUI, then restart. It's pure Python with zero extra dependencies.

    One small gotcha: the toggle list is fixed at four booleans, so it can't adapt if your model's prediction channel count differs - the CHANS list length just has to line up with what the consuming node expects. On SDXL it always does.

    Don't build a workflow around this node alone. Build it as a companion to Pre CFG automatic scale, and you get a quick, repeatable way to tune which part of the latent drives your result - no prompt engineering required.

    Categorymodel_patches/Pre CFG/channels_selectors

    Inputs (4)

    NameTypeDefaultDescription
    channel_0BOOLEANtrue
    channel_1BOOLEANtrue
    channel_2BOOLEANtrue
    channel_3BOOLEANtrue

    Outputs (1)

    NameTypeDescription
    CHANSCHANS