ComfyUI > Nodes > ComfyUI-CoCoTools_IO > Image Loader

ComfyUI Node: Image Loader

Class Name

ImageLoader

Category
COCO Tools/Loaders
Author
Conor-Collins (Account age: 522days)
Extension
ComfyUI-CoCoTools_IO
Latest Updated
2025-05-30
Github Stars
0.04K

How to Install ComfyUI-CoCoTools_IO

Install this extension via the ComfyUI Manager by searching for ComfyUI-CoCoTools_IO
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-CoCoTools_IO in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Image Loader Description

Facilitates loading, processing various image formats, transformations, conversion for AI applications, handling bit depths, color channels, metadata preparation.

Image Loader:

The ImageLoader node, specifically the coco_loader class, is designed to facilitate the loading and processing of various image formats such as JPG, PNG, TIF, AVIF, and WEBP. Its primary purpose is to read images from a specified file path, apply necessary transformations like EXIF orientation correction, and convert them into a format suitable for further processing in AI applications. This node is particularly beneficial for AI artists who need to handle images with different bit depths and color channels, as it automatically detects these attributes and converts the images into tensors. Additionally, it manages alpha channels and normalizes the image data if required, ensuring that the images are ready for use in machine learning models or other creative processes. The node also prepares metadata about the image, which can be useful for tracking and managing image data within larger workflows.

Image Loader Input Parameters:

image_path

The image_path parameter specifies the file path of the image you wish to load. It is crucial as it directs the node to the exact location of the image file on your system. The path should be a valid string pointing to an image file in one of the supported formats (JPG, PNG, TIF, AVIF, WEBP). There are no specific minimum or maximum values for this parameter, but it must be a valid path to an existing file.

normalize

The normalize parameter is a boolean flag that determines whether the loaded image tensors should be normalized. Normalization is a process that adjusts the range of pixel values, typically to a standard range like 0 to 1, which can be beneficial for certain types of image processing and machine learning tasks. The default value for this parameter is True, meaning normalization will be applied unless specified otherwise.

node_id

The node_id parameter is an optional identifier for the node instance. It can be used to track or differentiate between multiple instances of the node within a workflow. This parameter does not affect the image loading process directly but can be useful for organizational purposes. There are no specific constraints on the value of this parameter.

Image Loader Output Parameters:

rgb_tensor

The rgb_tensor output is a tensor representation of the loaded image, converted to the RGB color space. This output is crucial for further image processing tasks, as it provides a standardized format that can be easily manipulated or fed into machine learning models. The tensor includes the pixel data of the image, adjusted for any EXIF orientation and converted to the appropriate bit depth.

alpha_tensor

The alpha_tensor output represents the alpha channel of the image, if present. This tensor is important for handling transparency in images, allowing you to manage and process images with varying levels of opacity. If the image does not have an alpha channel, this tensor will be filled with ones, indicating full opacity.

metadata

The metadata output is a string containing information about the loaded image, such as the file path, tensor shape, and image format. This metadata is useful for tracking and managing image data, providing context and details that can be referenced in larger workflows or for debugging purposes.

Image Loader Usage Tips:

  • Ensure that the image_path is correct and points to a valid image file to avoid errors during loading.
  • Use the normalize parameter to prepare images for machine learning models, as normalized data often leads to better model performance.
  • Utilize the metadata output to keep track of image details, which can be helpful for organizing and managing large datasets.

Image Loader Common Errors and Solutions:

Error loading image <image_path>: <error_message>

  • Explanation: This error occurs when the node fails to load the specified image, possibly due to an incorrect file path, unsupported file format, or file corruption.
  • Solution: Verify that the image_path is correct and points to a valid, supported image file. Check the file for corruption and ensure it is accessible from the system running the node.

Image Loader Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-CoCoTools_IO
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.