KJNodes/imagegenerated

Image Upscale With Model Batched(ImageUpscaleWithModelBatched)

This node technically first converts the input image data into a tensor format suitable for model processing, then batches the images according to the user-defined `per_batch` value and feeds them into the specified super-resolution model for processing.

Image Upscale With Model Batched

upscale_model
images
IMAGE
per_batch
16
downscale_ratio
1.00
downscale_method
lanczos
precision
float32
KJNodes

The Image Upscale With Model Batched node technically first converts the input image data into a tensor format suitable for model processing. It then feeds the images in batches into the specified super-resolution model for processing, based on the user-defined per_batch value.

Image Upscale With Model Batched is an image super-resolution processing node that utilizes pre-trained AI models to upscale input images and enhance their resolution. Compared to native nodes, its core advantage lies in allowing users to set the sub-batch size, thereby effectively controlling VRAM usage. This makes it suitable for processing large batches of images or working at high resolutions.

Node Functionality

Technically, this node first converts the input image data into a tensor format suitable for model processing. It then feeds the images in batches into the specified super-resolution model for processing, based on the user-defined per_batch value. It supports multiple numerical precisions (e.g., float32, float16) to balance speed and quality. It also optionally scales down the results after upscaling, providing various downsampling algorithms such as nearest-exact and lanczos for selection.

Node Parameter Description - Image Upscale With Model Batched

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
upscale_modelUPSCALE_MODELYes--Specifies the AI model used for image super-resolution upscaling. This parameter determines the algorithm and quality of image upscaling.
imagesIMAGEYes--Input the image(s) or batch of images to be upscaled. Supports processing single or multiple images simultaneously.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
per_batchINTYes161 - 4096 (Step: 1)Sets the number of images processed per batch, ranging from 1 to 4096. Used to control VRAM usage; this value can be lowered when processing large batches of images.
downscale_methodCOMBONolanczos"nearest-exact", "bilinear", "area", "bicubic", "lanczos"-
precisionCOMBONofloat32"float32", "float16", "bfloat16"-
downscale_ratioFLOATNo1.00.01 - 1.0 (Step: 0.01)-

Output

Parameter NameData TypeDescription
IMAGEIMAGEOutputs the image(s) after processing by the model for upscaling.

Usage Scenarios

In an actual workflow, after obtaining a batch of low-resolution images from a "Load Image" node, you can connect this node and select a super-resolution model such as ESRGAN. By adjusting the per_batch parameter, you can avoid VRAM overflow when processing high-resolution images like 4K. Finally, the upscaled images are output to subsequent nodes like "Preview Image" or "Save Image" for viewing or storage.

Notes

Please note that the node's processing speed and quality are affected by the selected super-resolution model, batch size, and computational precision. A batch size that is too small may reduce processing efficiency, while a batch size that is too large may lead to insufficient VRAM.

The Image Upscale With Model Batched node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…