imagegenerated

Image Prep For ICLora(ImagePrepForICLora)

This node receives a reference image and allows the user to specify the target output width, height, and border width.

Image Prep For IC Lora

reference_image
latent_image
latent_mask
reference_mask
IMAGE
MASK
output_width
1024
output_height
1024
border_width
0
KJNodes

The Image Prep For ICLora node receives a reference image and allows users to specify the target output width, height, and border width.

The Image Prep For ICLora node is an image preprocessing tool specifically designed to prepare input images for the ICLora model. Its core functionality is to resize the reference image and process related masks, ensuring the image format meets the requirements for subsequent model processing.

Node Functionality

This node receives a reference image and allows users to specify the target output width, height, and border width. Internally, it intelligently scales the image based on the aspect ratio of the reference image and supports precise control over the effective image area through optional mask parameters. The node outputs the resized and mask-processed image along with its corresponding mask.

Node Parameter Description - Image Prep For ICLora

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
reference_imageIMAGEYes--reference_image (Input Parameter): The reference image used as the processing baseline. The node will perform resizing and mask application based on this image.
latent_imageIMAGENo--latent_image (Input Parameter): An optional latent image used to determine the batch size of the output image.
latent_maskMASKNo--latent_mask (Input Parameter): An optional mask for controlling regions of the latent image.
reference_maskMASKNo--reference_mask (Input Parameter): An optional mask used to define the effective area to be retained in the reference image.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
output_widthINTYes10241 - 4096 (Step: 1)output_width (Input Parameter): Sets the width of the output image, ranging from 1 to 4096 with a step of 1.
output_heightINTYes10241 - 4096 (Step: 1)output_height (Input Parameter): Sets the height of the output image, ranging from 1 to 4096 with a step of 1.
border_widthINTYes00 - 4096 (Step: 1)border_width (Input Parameter): Sets the width of the border to be added to the image, ranging from 0 to 4096 with a step of 1.

Output

Parameter NameData TypeDescription
IMAGEIMAGEIMAGE (Output Parameter): The final image after resizing and mask processing.
MASKMASKThe mask processed in the same way.

Usage Scenarios

In image generation or style transfer workflows, when you need to combine a reference image (e.g., a portrait photo) with a latent image (e.g., a scene sketch), you can use this node. First, connect the reference image and the latent image to the node, set the desired output dimensions. The node will output a processed image that can be directly fed into the ICLora model to guide the generation of new images that incorporate features from the reference image.

Notes

Please note that this node has specific logic for handling the batch size of input images. If a latent image is provided and its batch size differs from that of the reference image, the node will automatically replicate the reference image to match the batch size of the latent image.

The Image Prep For ICLora node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…