Nodes/ComfyUI for InstructIR/InstructIR Process Image
ComfyUI Node

InstructIR Process Image

Tell it what's wrong with your photo and it'll have a go

By zhongpei·Created 3 years ago·Updated 2 years ago· 77
InstructIR Process Image
  • model
  • image
  • IMAGE
promptenhance the colors
custom_prompt

The whole reason to install the InstructIR pack lives in this one node. Wire in a model from LoadInstructIRModel, feed it an image, type a plain-English complaint, and out the other side comes a cleaned-up version of the same photo. No denoise math, no manual sliders. When the pack launched on r/comfyui, the top reaction was "finally, a make-it-pretty button" - and honestly, that's the pitch.

Here's what's actually happening under the hood, because it's not magic. This is a port of InstructIR (ECCV 2024, mv-lab), and the model is a NAFNet restoration backbone with extra "Instruction Condition Blocks" spliced in. Your prompt is embedded by a tiny language model, pushed through a small head that outputs a conditioning vector plus a guess at which degradation class you're dealing with - noise, blur, rain, haze, low-light, enhancement, or upsampling, seven in all. That conditioning then gates and modulates the network's features at every scale. It's one deterministic pass: no diffusion, no sampler, no seed. Same input, same result, every time.

The inputs that matter, out of four total:

  • image (IMAGE) - any resolution, processed at native size, so no resizing needed on your end.
  • custom_prompt (STRING) - if you type anything here, it overrides the preset dropdown. This is the one you'll actually live in.
  • model (INSTRUCTIR_MODEL) comes from the loader node; prompt is just an enum of five starter phrases ("enhance the colors", "my image is too dark, can you fix it?", and friends), defaulting to "enhance the colors".

The output is a single IMAGE, the same resolution as the input, ready to plug into a preview, a save node, or anything downstream.

Prompting is where people misread this node. The README hands you example phrasings for every task - denoise, deblur, dehaze, derain, low-light, SR, general polish - and the model genuinely is trained to cope with loose language, so "make it pop" or "this photo's an eyesore" are legitimate. But it is not an instruction executor. One of the first users found that "too dark, decrease exposure" brightened the image exactly like "too light, improve exposure." That's expected behavior: the text mostly picks a restoration direction, it doesn't dial in fine-grained values. Keep prompts short and aimed at the problem - "too dark", "blurry", "rain on the window" - rather than trying to fine-tune exposure or saturation.

The trap worth flagging: the SR / upscaling preset does not upscale. The forward pass returns the same height and width it received - this port restores at native resolution and hands you zero extra pixels. If you want the image actually bigger, treat this node as the polish step and send its output to a real upscaler for the resolution. Different job entirely.

Install and first-run gotchas are shared with the loader in this pack: ComfyUI Manager (search "InstructIR") or a git clone, no requirements.txt - dependencies auto-install at startup - and the first queue click can look dead for a minute while ~60 MB of weights download from Hugging Face. CPU works but is slow; use cuda if you've got a GPU.

And if the node renders red in your graph, you're reliving the pack's earliest days. That red-node report is old and the usual culprits are an outdated ComfyUI core or a missing wire from the loader - confirm both inputs are connected, update ComfyUI, and run it again before you blame the install.

Categoryfofo

Inputs (4)

NameTypeDefaultDescription
modelINSTRUCTIR_MODEL
imageIMAGE
promptCOMBOenhance the colors5 options: please I want this image for my photo album, can you edit it as a photographer, my image is too dark, can you fix it?, How can I remove the fog and mist from this photo?, enhance the colors, I need to enhance the size and quality of this image.
custom_promptSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE