ποΈπΎπ 2D View Save Load
Cache Them to Disk
- bc
- nm
- pos
- bc_out
- nm_out
- pos_out
- full_batch
- IMAGE
- MASK
What it's actually for
Texture-projection and PBR workflows run on view sets: six camera angles, each with base colour, normal, and position passes. Re-generating them every iteration is the single biggest time sink in a 3D texturing graph. This node caches them.
Point it at a folder, feed it bc/nm/pos batches, and it writes numbered PNGs - view_bc_1.png, view_nm_2.png, and so on. On a later run, with nothing connected, it loads them back from disk and hands them downstream. Same node does both jobs, and the mode tells it which one.
How it works
The mode selector is the whole API:
- Auto (Load if empty) - saves if any of bc/nm/pos is connected, loads if none are. This is the one you leave it on: it means the first run writes the cache and every subsequent run reads it.
- Save Only - always writes, incrementing through each image in the batch.
- Load Only - reads
{filename}_{bc|nm|pos}_*.pngfrom the folder, filtered byindex_list. - Preview - renders an atlas image into ComfyUI's temp directory instead of touching your output folder: one row per channel, one column per view.
The atlas generation is worth knowing about because it explains odd-looking previews. It stacks bc, nm and pos as rows, pads each into a uniform grid, and shows you all six views at once. That's the "did my projection land" check without opening twenty files.
There's a real HDR path here too. If filename ends in .exr, the node stops treating your data as 0-1 sRGB: it loads EXR through cv2 (with OPENCV_IO_ENABLE_OPENEXR set before import) or imageio, keeps the float values above 1.0, and writes real float EXR on save. Previewing an HDR image requires tone mapping, so it applies a percentile-based auto exposure (median mapped toward 0.18) times your exr_exposure, a soft Reinhard curve, and a gamma 2.2 pass - then saves a PNG next to nothing in particular, purely for display. Your float data on disk is untouched by that; the exposure multiplier is applied on save only if exr_exposure isn't 1.0.
One caveat about the .png branch: if filename ends in .png, the naming skips the channel suffix and uses the filename as given (with _N appended per batch item). The channel-suffix pattern only applies to the other branches, which is a subtle inconsistency that bites when you mix conventions mid-project.
The inputs that matter
- path and filename - a raw filesystem folder and a base name. Note the default path,
L:/AI_3d/output- that's the author's drive. Change it, or you'll spend ten minutes wondering where your files went. - index_list (default
1,2,3,4,5,6) - which view numbers to load back, comma or space separated. This is how you pull a subset of views rather than all of them. - mode - see above.
Auto (Load if empty)is the right default and the right setting 95% of the time. - exr_exposure / seed / save_toggle -
exr_exposurescales the HDR values on save and the preview exposure;save_togglelets Preview also write files;seedexists to force re-execution.
Outputs: bc_out, nm_out, pos_out, full_batch, IMAGE and MASK. The first four are the passthrough channels; the duplicate IMAGE is the first available channel (pos preferred, then nm, then bc), and MASK is generated as all-ones for HDR/shape reasons rather than extracted from alpha. Don't wire MASK expecting a real alpha channel.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Antonioilev/ComfyUI_Antonioilev_Lightpack.git
# restart ComfyUI
Manager search: "Antonioilev Light Pack". No requirements.txt; import failures are caught by __init__.py and reported as a node count. The EXR half needs optional extras, and degrades quietly without them:
pip install opencv-python imageio imageio-ffmpeg
Where people get burned
- The default path is not ComfyUI's output folder. This node writes wherever you tell it. A relative path lands relative to the ComfyUI working directory, which isn't always what you expect.
- Ties to
index_listmismatching your actual filenames are the top "loads nothing" cause. If you saved with a customfilename, the loader has to see that same base name. - Loading gives you 8-bit PNG data unless you're on the EXR path. If you need HDR position or normal passes for a projection, use
.exrfilenames end-to-end - mixing PNG out and EXR in doesn't work. - EXR writing can fail silently if neither cv2 nor imageio can write EXR. It prints
[EXR] !!! FAILED to saveand deletes the zero-byte file. Watch the console rather than the folder.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | L:/AI_3d/output | β |
| filename | STRING | view | β |
| index_list | STRING | 1,2,3,4,5,6 | β |
| mode | COMBO | 4 options: Auto (Load if empty), Save Only, Load Only, Preview | |
| bcopt | IMAGE | β | |
| nmopt | IMAGE | β | |
| posopt | IMAGE | β | |
| save_toggleopt | BOOLEAN | true | β |
| seedopt | INT | 00β18446744073709550000 | β |
| exr_exposureopt | FLOAT | 1.000.01β100 | β |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| bc_out | IMAGE | β |
| nm_out | IMAGE | β |
| pos_out | IMAGE | β |
| full_batch | IMAGE | β |
| IMAGE | IMAGE | β |
| MASK | MASK | β |