ComfyUI > Nodes > VNCCS - Visual Novel Character Creation Suite > VNCCS Character Sheet Cropper

ComfyUI Node: VNCCS Character Sheet Cropper

Class Name

CharacterSheetCropper

Category
VNCCS/Util
Author
MIUProject (Account age: 1115days)
Extension
VNCCS - Visual Novel Character Creation Suite
Latest Updated
2025-12-14
Github Stars
0.39K

How to Install VNCCS - Visual Novel Character Creation Suite

Install this extension via the ComfyUI Manager by searching for VNCCS - Visual Novel Character Creation Suite
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter VNCCS - Visual Novel Character Creation Suite 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

VNCCS Character Sheet Cropper Description

Specialized node for extracting character images from composite sheets, maintaining aspect ratio and resizing for various applications.

VNCCS Character Sheet Cropper:

The CharacterSheetCropper is a specialized node designed to process character sheets by extracting individual character images from a larger composite image. This node is particularly useful for artists and developers working with sprite sheets or character sheets, where multiple character images are arranged in a grid format. The primary function of the CharacterSheetCropper is to identify and isolate each character or object within the sheet using contour detection on a provided mask. It then crops these characters, ensuring that each extracted image maintains its original aspect ratio while being resized to a specified target height. This process is essential for creating uniform character images that can be used in various applications, such as game development or animation. The node handles various edge cases, such as zero-sized arrays or degenerate bounding boxes, ensuring robust performance even with imperfect input data.

VNCCS Character Sheet Cropper Input Parameters:

image

The image parameter is a tensor representing the character sheet from which individual characters will be extracted. This input is crucial as it provides the visual data that the node processes to isolate and crop each character. The image should be in a format compatible with PyTorch tensors, typically with dimensions corresponding to height, width, and color channels.

mask

The mask parameter is a tensor that acts as a guide for the node to identify the contours of each character within the sheet. It is a binary or grayscale image where the presence of a character is marked by non-zero values. The mask helps the node determine the boundaries of each character, ensuring accurate cropping. Like the image parameter, the mask should be formatted as a PyTorch tensor.

min_size

The min_size parameter specifies the minimum width and height, in pixels, that a character must have to be considered for cropping. This parameter helps filter out noise or very small objects that are not relevant, ensuring that only significant characters are processed. The default value is 64 pixels, but it can be adjusted based on the specific requirements of the character sheet being processed.

target_height

The target_height parameter defines the height, in pixels, to which each cropped character image will be resized. This resizing maintains the original aspect ratio of the character, ensuring that the width is adjusted proportionally. The default target height is 3072 pixels, which can be modified to suit different output size requirements.

VNCCS Character Sheet Cropper Output Parameters:

all_cropped_images

The all_cropped_images output is a list of tensors, each representing a cropped character image extracted from the original sheet. These images are processed to maintain their aspect ratio and are resized to the specified target height. This output is essential for users who need individual character images for further use in projects such as game development or animation.

VNCCS Character Sheet Cropper Usage Tips:

  • Ensure that the mask accurately represents the contours of the characters in the image to achieve precise cropping results.
  • Adjust the min_size parameter to filter out unwanted small objects or noise, focusing only on significant characters.
  • Set the target_height according to the desired output size for your project, keeping in mind that the aspect ratio will be preserved.

VNCCS Character Sheet Cropper Common Errors and Solutions:

Warning: No valid character crops were generated for any item in the batch. Returning empty list.

  • Explanation: This warning indicates that the node did not find any valid characters to crop from the provided batch of images and masks.
  • Solution: Check the mask to ensure it correctly outlines the characters. Verify that the min_size is not set too high, which might exclude valid characters.

Warning: Zero-sized array after slicing for contour {contour_idx} in item {i}. Skipping this character.

  • Explanation: This warning occurs when the node attempts to crop a character but ends up with an empty or zero-sized array, possibly due to incorrect mask contours.
  • Solution: Inspect the mask for accuracy and completeness. Ensure that the contours are correctly defined and that the mask aligns with the characters in the image.

Warning: Mask for item {i} has unexpected shape {mask_np_raw.shape}. Skipping this item.

  • Explanation: This warning suggests that the mask provided does not have the expected dimensions or format, leading to processing issues.
  • Solution: Verify that the mask is formatted correctly as a PyTorch tensor and matches the dimensions of the image. Adjust the mask preparation process if necessary.

Warning: Degenerate bounding box (w={char_w}, h={char_h}) for contour {contour_idx} in item {i}. Skipping this character.

  • Explanation: This warning indicates that the bounding box calculated for a character is invalid, possibly due to incorrect contour detection.
  • Solution: Review the mask to ensure it accurately represents the character boundaries. Adjust the contour detection parameters if needed to improve accuracy.

VNCCS Character Sheet Cropper Related Nodes

Go back to the extension to check out more related nodes.
VNCCS - Visual Novel Character Creation Suite
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 Models, enabling artists to harness the latest AI tools to create incredible art.