Load PIL Image
The image loader for ComfyUI-Attention-Distillation
- image
This is a Load Image node with a more honest name. ComfyUI's native Load Image reads a file and hands you back a tensor; this one is built around Python's PIL (Pillow) image handling internally, because the pack it belongs to - ComfyUI-Attention-Distillation - wraps a diffusers pipeline that expects images the diffusers way, not necessarily the way ComfyUI's own image nodes assume. On the graph, though, it behaves like you'd expect: pick a file, get an IMAGE out.
Where it fits
This pack does style transfer and style-specific text-to-image generation by manipulating attention features between images, and both of its main nodes - ADOptimizer (style transfer) and ADSampler (style-specific generation) - need at least one reference image (a style input, plus content for ADOptimizer). Load PIL Image is how you get those pictures onto the graph. If you're feeding it a reference photo or art piece for style transfer, this is the node you start from - often paired right after with Resize Image to get it to a working resolution before it hits the distiller.
Use ComfyUI's regular Load Image node for anything that doesn't need to enter this pack's pipeline; there's no functional reason to use this one outside of Attention Distillation workflows.
The one input, and the output
image- a dropdown listing image files, the same pattern as native Load Image: it enumerates whatever's sitting in ComfyUI'sinput/directory. Upload a file through the UI (drag-and-drop onto the node, or the browse button) and it appears in this list.
Output is IMAGE - standard ComfyUI image tensor, so it plugs into Resize Image, or directly into ADOptimizer's content/style or ADSampler's style input.
Installing it
Part of the same pack as every other Attention Distillation node - no standalone install.
ComfyUI Manager - search "ComfyUI-Attention-Distillation" and install.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/zichongc/ComfyUI-Attention-Distillation
cd ComfyUI-Attention-Distillation
pip install -r requirements.txt
Restart ComfyUI afterward. You don't need a diffusion model downloaded just to use this node in isolation, but you will for anything it feeds into - see Load Distiller's model requirements before you build a full workflow around it.
Common issues
Dropdown is empty or your file isn't listed. Same cause as the native Load Image node: it only sees files already present in ComfyUI's input/ folder. Upload through the node UI rather than dropping a file straight into the folder on disk and expecting it to appear without a refresh.
Unusual formats or color modes trip it up. Because this goes through PIL rather than ComfyUI's usual image-loading path, an image with an unexpected mode (CMYK scans, some PNGs with odd palettes) is more likely to misbehave here than in the native loader. If a specific file fails and a plain RGB export of the same image works fine, that's your answer - re-save it as a standard RGB PNG or JPEG before loading.
Everything after it fails, but this node "worked." Check sizing before you blame this node. The pack ships a dedicated Resize Image node right next to this one, and both ADOptimizer and ADSampler take explicit height/width parameters - that's a strong hint you're meant to normalize your content and style images to a working resolution before they hit the distiller, not feed it whatever dimensions your upload happened to have.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |