Load VAE (float32):
Load VAE (float32) loads a variational autoencoder, or VAE, with 32-bit floating-point precision from the moment it is created. A VAE translates images into the compressed representation used by compatible AI models and converts that representation back into images. This node is intended especially for SDR-to-HDR workflows that require float32 encoding and decoding. Instead of loading a VAE at lower precision and changing its precision afterward, it explicitly requests float32 during construction. This distinction addresses a memory-buffer problem documented in the node’s description: when a VAE initially built in bf16 was subsequently converted in place, ComfyUI’s dynamic VRAM handling could retain buffers sized for the smaller format, causing a “Buffer too small” failure. The node also checks whether the loaded VAE is valid before making it available to your workflow. It is a precision-specific loader, not an HDR conversion or image-enhancement operation by itself.
Load VAE (float32) Input Parameters:
vae_name
This required COMBO parameter selects the VAE file to load. Its options come from ComfyUI’s registered VAE file list, obtained through folder_paths.get_filename_list("vae"), so the available choices depend on the files installed in your configured VAE locations. Your selection determines the model architecture and learned image-conversion behavior used for subsequent encoding and decoding; choose a VAE compatible with the generation model and workflow you are using. The node resolves the selected file’s full path, loads its model data and metadata, constructs the VAE with torch.float32, and checks its validity. No explicit default is declared in the schema, and minimum and maximum values do not apply because this is a file-selection menu rather than a numeric setting. Precision is fixed by the node and cannot be changed through this parameter.
Load VAE (float32) Output Parameters:
VAE
This output has the VAE type and contains the loaded, validated VAE object constructed with float32 precision. Connect it to compatible nodes that require a VAE for encoding images into latents or decoding latents into images, including the relevant stages of an SDR-to-HDR workflow. It represents a reusable model component, not an image, latent sample, HDR result, or numerical quality score. Its principal significance is that float32 was requested at construction time rather than applied afterward through an in-place conversion. The node returns this output only after the VAE passes its validity check; however, that check does not guarantee compatibility with every downstream model or latent format.
Load VAE (float32) Usage Tips:
- Use this node when your workflow specifically requires float32 VAE encoding and decoding, particularly for the SDR-to-HDR use case described in the source. It does not provide a general guarantee of better image quality for every workflow.
- Select a VAE intended for your model family. Using the correct precision does not make an otherwise incompatible VAE suitable for your model’s latent representation.
- Where your workflow previously used a standard VAE loader followed by an in-place float32 conversion node, use this loader as the source of the VAE instead. Connect its output to the stages that need float32 processing so they do not accidentally continue using a different, lower-precision VAE.
- Allow additional memory headroom. A float32 value uses four bytes, compared with two bytes for bf16 or float16, so equivalent model data can require roughly twice the storage. Total VRAM consumption also depends on intermediate processing, resolution, batch size, and ComfyUI’s memory management.
- If memory becomes tight during encoding or decoding, reduce batch size or image resolution, close other GPU-heavy applications, or use compatible tiled VAE processing where your workflow supports it. This loader itself has no tiling, resolution, device, or memory-limit controls.
- Add VAE files to a location registered with ComfyUI for VAEs, commonly
ComfyUI/models/vae, and refresh the available model list or restart ComfyUI if a newly installed file does not appear.
Load VAE (float32) Common Errors and Solutions:
“Buffer too small”
- Explanation: This is the error explicitly cited in the node description. It was observed when a VAE initially constructed in bf16 was converted in place to float32 under ComfyUI’s dynamic VRAM handling, leaving buffers sized for the smaller format. This loader is designed to avoid that particular loading-and-conversion sequence, not to prevent every possible buffer error.
- Solution: Load the VAE directly with this node and make sure the affected encode and decode stages use its output. Remove or bypass the previous loader-and-converter path where appropriate. If the problem persists, restart ComfyUI to clear existing loaded state and investigate the failing downstream operation.
VAE file not found — representative error
- Explanation: The node resolves the selected name through ComfyUI’s registered VAE paths. Loading can fail if the file was deleted, renamed, moved, or is no longer accessible after the workflow was saved. The exact error wording depends on ComfyUI.
- Solution: Confirm that the file exists in a registered VAE folder, refresh the model list, and select it again. For a workflow received from someone else, install the required compatible VAE first.
Invalid or unsupported VAE — representative error
- Explanation: The node calls
throw_exception_if_invalid()after constructing the VAE. A file that does not contain a recognizable, supported VAE can fail this check; the provided source does not specify the exact exception message. - Solution: Verify that you selected a supported VAE model file rather than an unrelated checkpoint or other asset. Check the model’s installation instructions and use a ComfyUI version that supports its VAE architecture.
Failed to read model file — representative error
- Explanation: Loading the model data or metadata can fail if the file is incomplete, damaged, unreadable, or stored in an unsupported format. The file-loading utility supplies the actual error message.
- Solution: Download the file again from its trusted source, verify its size or checksum when available, and confirm that ComfyUI has permission to read it.
“CUDA out of memory” — possible runtime error
- Explanation: Float32 increases memory requirements compared with lower-precision formats. Available GPU memory may be insufficient when loading or using the VAE, especially with large images, video batches, or other loaded models. Such an error may occur downstream rather than inside this loader.
- Solution: Free GPU memory, reduce processing resolution or batch size, and use compatible tiled encoding or decoding if available. Do not switch back to lower precision without checking whether your HDR workflow requires float32.
Tensor shape or channel mismatch during encoding or decoding — representative downstream error
- Explanation: A VAE can pass the loader’s validity check while still being incompatible with the latents or model used elsewhere in your workflow. These failures occur during subsequent processing, and the precise message depends on the operation involved.
- Solution: Check which VAE your generation model requires and select the matching file. Confirm that the workflow’s latent-producing and latent-decoding stages belong to compatible model families; changing precision alone cannot resolve an architecture mismatch.
