Loading Images
LoadImage
Loads an image from the input directory. Category:image
The image file to load (supports upload)
IMAGE: The loaded image in RGB formatMASK: Alpha channel mask (if present)
- PNG (with alpha channel support)
- JPEG
- WebP
- GIF (first frame only)
- TIFF
- BMP
LoadImageMask
Loads an image and extracts a specific channel as a mask. Category:mask
The image file to load
Which channel to extract. Options:
alpha, red, green, blueMASK: The extracted channel as a mask
Saving Images
SaveImage
Saves images to the output directory. Category:image
The images to save
Prefix for the saved filename. Supports formatting like
%date:yyyy-MM-dd% or %node_name.parameter%%date:yyyy-MM-dd%: Current date%date:HH-mm-ss%: Current time%Empty Latent Image.width%: Reference node parameters%batch_num%: Batch number for multiple images
PreviewImage
Displays images in the UI without saving to output. Category:image
The images to preview
Image Scaling
ImageScale
Resizes an image to specific dimensions. Category:image/upscaling
The image to scale
Interpolation method. Options:
nearest-exact, bilinear, area, bicubic, lanczosTarget width. Range: 0 to 16384. Set to 0 to maintain aspect ratio.
Target height. Range: 0 to 16384. Set to 0 to maintain aspect ratio.
Cropping method. Options:
disabled, centerIMAGE: Resized image
nearest-exact: Fastest, pixelated lookbilinear: Fast, smooth but slightly blurryarea: Best for downscalingbicubic: Good quality, balancedlanczos: Highest quality, slower, sharp edges
ImageScaleBy
Resizes an image by a scale factor. Category:image/upscaling
The image to scale
Interpolation method
Scale multiplier. Range: 0.01 to 8.0
IMAGE: Scaled image
ImageUpscaleWithModel
Upscales an image using an AI upscale model. Category:image/upscaling
The upscale model to use (e.g., RealESRGAN, ESRGAN)
The image to upscale
IMAGE: Upscaled image
- RealESRGAN_x4plus: General purpose 4x upscaling
- RealESRGAN_x2plus: 2x upscaling
- ESRGAN_4x: Anime/illustration focused
- Various specialized models for faces, anime, etc.
Image Processing
ImageInvert
Inverts the colors of an image. Category:image
The image to invert
IMAGE: Inverted image
ImagePadForOutpaint
Expands an image’s canvas for outpainting. Category:image
The image to expand
Pixels to add on left. Range: 0 to 16384, step 8
Pixels to add on top. Range: 0 to 16384, step 8
Pixels to add on right. Range: 0 to 16384, step 8
Pixels to add on bottom. Range: 0 to 16384, step 8
Feathering amount at edges for smooth blending. Range: 0 to 16384
IMAGE: Padded image with gray fillMASK: Mask marking the new areas (white = generate, black = preserve)
EmptyImage
Creates a blank colored image. Category:image
Image width. Range: 1 to 16384
Image height. Range: 1 to 16384
Number of images. Range: 1 to 4096
RGB color value (hex). Range: 0 to 0xFFFFFF
IMAGE: Blank colored image
Batch Operations
ImageBatch
Combines two images into a batch. Category:image (Deprecated)
First image
Second image
IMAGE: Combined batch
Workflow Examples
Basic Image Generation
Image to Image
Upscaling with Model
Outpainting
Image Formats
ComfyUI internally uses images in the format:- Shape:
[batch, height, width, channels] - Data type:
float32 - Range:
0.0 to 1.0 - Color space: RGB (not BGR)
Tips
Memory Usage
- Pixel-space operations use more memory than latent operations
- For large images, consider working in latent space when possible
- Use tiled VAE encoding/decoding for very large images
Quality Settings
- PNG compression level is set to 4 by default (balance of size/speed)
- Metadata is embedded in saved PNGs (disable with
--disable-metadataflag) - Preview images use lower compression for faster display
File Organization
- Input images go in
input/directory - Output images save to
output/directory - Preview images save to
temp/directory - Use
filename_prefixto organize outputs into subdirectories