Nano Banana 2:
The KIE_NanoBanana2_Image node is designed to generate high-quality images using the Nano Banana 2 model. This node allows you to create images based on a text prompt, with the option to include up to 14 reference images to guide the generation process. It also offers the ability to ground the image generation with Google web search results, enhancing the relevance and accuracy of the output. The node supports various aspect ratios and resolutions, providing flexibility in the output format, which can be either JPG or PNG. This makes it a versatile tool for AI artists looking to produce customized and contextually rich images.
Nano Banana 2 Input Parameters:
prompt
The prompt parameter is a required text input that serves as the primary directive for the image generation process. It can be a multiline string, allowing for detailed descriptions up to a maximum length of 20,000 characters. The prompt's content significantly influences the resulting image, as it dictates the themes, objects, and overall style that the Nano Banana 2 model will attempt to render.
images
The images parameter is optional and allows you to provide up to 14 reference images. These images serve as additional context or inspiration for the model, potentially guiding the style or content of the generated image. If more than 14 images are provided, only the first 14 will be used. This parameter is particularly useful for maintaining consistency with existing visual themes or styles.
google_search
The google_search parameter is a boolean option that, when enabled, allows the model to incorporate information from Google web searches into the image generation process. This can enhance the relevance and contextual accuracy of the generated image. The default value is False.
aspect_ratio
The aspect_ratio parameter determines the proportions of the generated image. It offers a variety of options, including "1:1", "16:9", "4:3", and "auto", among others. The default setting is "auto", which allows the model to choose the most suitable aspect ratio based on the prompt and reference images.
resolution
The resolution parameter specifies the output resolution of the generated image, with options including "1K", "2K", and "4K". The default resolution is "1K". Higher resolutions result in more detailed images but may require more processing time.
output_format
The output_format parameter allows you to choose the file format of the generated image, with options being "jpg" and "png". The default format is "jpg". This choice can affect the image's quality and file size, with PNG generally offering higher quality and JPG providing smaller file sizes.
log
The log parameter is a boolean that controls whether detailed logging information is printed to the console during the image generation process. This can be useful for debugging or understanding the node's operation. The default value is True.
Nano Banana 2 Output Parameters:
image
The image output parameter is the result of the image generation process, provided as a ComfyUI image tensor in the BHWC (Batch, Height, Width, Channels) format with float32 values ranging from 0 to 1. This tensor represents the generated image, which can be further processed or saved in the desired format.
Nano Banana 2 Usage Tips:
- To achieve the best results, provide a detailed and specific prompt that clearly outlines the desired elements and style of the image.
- Utilize the
imagesparameter to include reference images that align with your vision, ensuring consistency in style or theme.
Nano Banana 2 Common Errors and Solutions:
Invalid aspect_ratio. Use the pinned enum options.
- Explanation: This error occurs when an unsupported aspect ratio is specified.
- Solution: Ensure that the aspect ratio is one of the predefined options such as "1:1", "16:9", or "auto".
Invalid resolution. Use the pinned enum options.
- Explanation: This error indicates that the specified resolution is not supported.
- Solution: Choose a resolution from the available options: "1K", "2K", or "4K".
Invalid output_format. Use the pinned enum options.
- Explanation: This error arises when an unsupported output format is selected.
- Solution: Select either "jpg" or "png" as the output format.
google_search must be a boolean.
- Explanation: This error occurs if the
google_searchparameter is not set to a boolean value. - Solution: Ensure that
google_searchis eitherTrueorFalse.
