Image Batch Test Pattern(ImageBatchTestPattern)
From a technical implementation perspective, this node uses Python's PIL library (Pillow) to draw images based on the specified batch size and starting number.
Image Batch Test Pattern
From a technical implementation perspective, the Image Batch Test Pattern node uses Python's PIL library (Pillow) to draw images based on the specified batch size and starting number.
The Image Batch Test Pattern node is used to batch generate test images with sequential numbers. It creates a series of images on a black background, each containing a number with a randomly generated color. This node is primarily used to create image sequences for testing or demonstration purposes.
Node Functionality
From a technical implementation perspective, this node uses Python's PIL library (Pillow) to draw images based on the specified batch size and starting number. It allows users to customize the overall image dimensions, text position, font, and font size. The text drawing coordinates use the top-left corner of the image as the origin, and support selecting TrueType font files from the kjnodes_fonts folder.
Node Parameter Description - Image Batch Test Pattern
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
font | COMBO | Yes | - | - | font (input parameter): Select the font file from the kjnodes_fonts directory for drawing the numbers. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
batch_size | INT | Yes | 1 | 1 - 4096 (step: 1) | batch_size (input parameter): Specifies the number of images to generate, ranging from 1 to 4096. |
start_from | INT | Yes | 0 | 0 - 4096 (step: 1) | start_from (input parameter): Sets the starting number for the sequence on the images, ranging from 0 to 4096. |
text_x | INT | Yes | 256 | 0 - 4096 (step: 1) | text_x (input parameter): Sets the X-coordinate of the top-left corner of the number text within the image, ranging from 0 to 4096. |
text_y | INT | Yes | 256 | 0 - 4096 (step: 1) | text_y (input parameter): Sets the Y-coordinate of the top-left corner of the number text within the image, ranging from 0 to 4096. |
width | INT | Yes | 512 | 16 - 4096 (step: 1) | width (input parameter): Sets the width of the generated images, ranging from 16 to 4096. |
height | INT | Yes | 512 | 16 - 4096 (step: 1) | height (input parameter): Sets the height of the generated images, ranging from 16 to 4096. |
font_size | INT | Yes | 255 | 8 - 4096 (step: 1) | font_size (input parameter): Sets the font size of the number text, ranging from 8 to 4096. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| IMAGE | IMAGE | The batch of test images with sequential numbers. |
Usage Scenarios
In practical workflows, this node is often used in scenarios requiring batch image input for processing. For example, when testing the batch processing capability of an image upscaling model, this node can first generate a set of test images with uniform dimensions but varying content (numbers). These can then be connected to an upscaling node to observe the model's processing effectiveness and consistency with batch input.
Notes
Please note that the number of generated images is limited by the batch_size parameter (up to 4096) and the starting number start_from (up to 4096); they can be set independently. Additionally, if the text drawing position (text_x, text_y) is set inappropriately, the text may be drawn outside the canvas and become invisible.
Image Batch Test Pattern Node Source Code Link
The Image Batch Test Pattern node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.