Nodes/ComfyUI for InstructIR/Loader InstructIR Model
ComfyUI Node

Loader InstructIR Model

The one-knob loader that quietly downloads three models

By zhongpei·Created 3 years ago·Updated 2 years ago· 77
Loader InstructIR Model
    • INSTRUCTIR_MODEL
    devicecuda

    Loaders are the broccoli of ComfyUI. You eat them because the main course needs them, and this one is the entry point to the InstructIR pack (zhongpei/ComfyUI-InstructIR), a port of the ECCV 2024 paper InstructIR: High-Quality Image Restoration Following Human Instructions from mv-lab. It's a tiny pack - just this loader and one process node - built around telling a model what's wrong with a photo ("too dark", "blurry", "make it pop") in plain English and getting a restored image back.

    The node itself is almost insultingly simple: one input, one output. The required device input is an enum with cpu or cuda (default cuda), and the output is INSTRUCTIR_MODEL - the opaque handle you wire into the InstructIRProcess node. Pick cuda without a working GPU and the code quietly falls back to CPU instead of erroring, which is a nice touch for a pack that runs fine on a laptop, just slower.

    The interesting part is what happens the first time you instantiate it, because this "loader" isn't loading a file you placed anywhere. It pulls three things from Hugging Face:

    • im_instructir-7d.pt (~60 MB) - the actual restoration network, saved into the pack's model/ folder
    • lm_instructir-7d.pt (under half a megabyte) - the small head that turns your prompt into a conditioning vector
    • TaylorAI/bge-micro-v2 - a tiny text-embedding model that lands in your global HF cache, not in the pack

    That's the gotcha. The first time you drop this node into a workflow, ComfyUI can look frozen for a minute while ~60 MB downloads and a transformer loads into memory, with no progress bar to show for it. It's not broken - it's the first-run moment everyone hits. Everything after that is instant.

    Install is the standard story. ComfyUI Manager, search "InstructIR" (the pack shows up as "ComfyUI for InstructIR"), or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zhongpei/ComfyUI-InstructIR
    

    then restart ComfyUI. One thing to know: there's no requirements.txt. The pack's __init__.py auto-installs Pillow, huggingface_hub, transformers, PyYAML, and sentence-transformers at startup. So the first launch after install can take extra time, and if another pack has pinned a transformers version you're now rolling the dice on a silent version conflict - the classic custom-node dependency hell.

    Two small quirks before you go. The nodes appear under a menu category the author named "fofo", which is not a typo on your end. And if this loader loads fine but the process node next to it is red, that's a separate problem - update ComfyUI and check the wire between them, since the loader is reliably the "working" half in user reports.

    Categoryfofo

    Inputs (1)

    NameTypeDefaultDescription
    deviceCOMBOcuda2 options: cpu, cuda

    Outputs (1)

    NameTypeDescription
    INSTRUCTIR_MODELINSTRUCTIR_MODEL