Nodes/ComfyUI-JNodes/Image Format Selector
ComfyUI Node

Image Format Selector

Pick a media format as both a real value and a string

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Image Format Selector
    • format
    • STRING
    format
    mode
    seed0

    This one's a dropdown wearing two hats. You pick a file format from a fixed list - jpg, jpeg, jfif, png, gif, webp, apng, mjpeg, mp4, webm, mov - and the node hands you back that exact value twice: once typed, so it can plug straight into another JNodes node that expects a format, and once as a plain STRING, so you can drop it into a filename, a log line, or a metadata field without a separate conversion step. That's the whole trick, and it's a trick JNodes reuses a lot.

    It belongs to a family the pack's own README calls "Selector Nodes" - ImageFormatSelector sits alongside SamplerSelectorWithString, SchedulerSelectorWithString, CheckpointSelectorWithString, VaeSelectorWithString and a couple of others, all built on the identical pattern. If you've used one, you've used them all.

    How it works

    mode decides how the format gets chosen. select just uses whatever you picked in the widget - the boring, predictable option, and the one you want for anything going to production. seed derives the pick from the seed value, which reads as "random" but is actually deterministic - same seed, same format, every run. index walks the list in order using the seed as a position, which is handy if you're deliberately cycling through formats (say, exporting the same batch as both png and webp across two runs) rather than picking at random.

    The inputs and outputs

    • format (enum, 11 choices) - the format you want when mode is select.
    • mode (select / seed / index) - fixed choice, seed-derived, or stepped.
    • seed (INT) - drives the pick in seed/index modes.
    • format output - the typed value, for wiring into another format-aware node.
    • STRING output - the same value as text, for filenames or display.

    How to install it

    Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JaredTherriault/ComfyUI-JNodes
    pip install -r ComfyUI-JNodes/requirements.txt
    

    then restart ComfyUI. No model downloads - this node has nothing to fetch, it's just a list.

    JNodes itself is Jared Therriault's utility pack, first posted to r/comfyui in June 2024 as a personal project he'd been building in his spare time; it's grown into one of the denser "quality of life" suites in the ecosystem since.

    Common issues & troubleshooting

    Don't confuse this with your save node's own format widget. JNodes_SaveVideoQuick and friends have their own format/codec combos that are populated from what your ComfyUI install can actually encode. This selector's list is fixed and independent - wiring its STRING output into a save node's format field only works if the spelling happens to line up, and it usually doesn't (mp4 here isn't the same string as video/h264-mp4 there). Treat this node as a general-purpose "pick a format, get it as text" utility, not as the source of truth for a specific save node's options.

    A stray UI panel after install isn't this node's fault. Installing the whole JNodes pack (not just this node) turns on an ImageDrawer panel by default, and it's shown up in enough "what is this weird box on my screen" threads that it's worth knowing up front: ComfyUI Settings (the cog icon) → JNodes → Image Drawer → uncheck "Enabled", then reload. It's a real feature, not a bug, but nobody expects it the first time.

    seed/index mode picking a format you didn't want. If your output filenames are switching extensions between runs and you didn't intend that, check mode - it's almost certainly set to seed when you meant select.

    Categorysd

    Inputs (3)

    NameTypeDefaultDescription
    formatCOMBO11 options: jpg, jpeg, jfif, png, gif, webp, +5
    modeCOMBO3 options: select, seed, index
    seedINT0

    Outputs (2)

    NameTypeDescription
    formatjpg,jpeg,jfif,png,gif,webp,apng,mjpeg,mp4,webm,mov
    STRINGSTRING