Banana Transparent Generator
The corner-arrow trick behind transparent Gemini PNGs
- image
- output_image
The name is doing a lot of work. Banana Transparent Generator doesn't generate anything, and it doesn't output transparency. It's a pre-processor that builds the input scaffold people feed to Gemini image generation so the API returns actual transparent PNGs: your image pasted dead-center on a huge plain canvas, with four black corner arrows pointing from the image's corners out to the canvas's corners. No AI, no API, no network. It's PIL math in and a tensor out, and it ships in the same banana2 pack as the Banana Gemini Gen node, waiting to be wired into that Gemini call.
Why would a giant canvas with arrows help? The transparent-PNG trick with Gemini is a prompt game. Nano Banana (Gemini 2.5 Flash Image) doesn't reliably respect "give me a transparent background" unless the input is staged so the model knows exactly where your subject ends. The arrows mark that boundary - they tell the model what to keep while it invents a clean background around it. This is the API-era cousin of the "pad the canvas and ask the model to fill it" trick the KB's inpainting doc tracks for outpainting, aimed at product photography instead.
How it works
Read the source and it's refreshingly small. Pick a resolution and the node builds a canvas sized to that target scaled by your image's aspect ratio - so a 3:2 image at 2K gets a 2048×1365-ish canvas - then takes the max with your original dimensions so it never downscales your source. Paste the original, un-resized, centered. Black background. Then draw the four arrows, but only when a border actually exists (no padding, no arrows).
Here's where the name lies twice. It says "transparent" and the code paints black. The class docstring even says "white background" while the constructor arg is 'black'. So don't expect white, and definitely don't expect alpha - the output is plain RGB on black, and no node in this pack can emit a transparent PNG. The transparency comes out of the Gemini API call downstream, not from this node. If you wanted a white canvas, this is the wrong tool.
Inputs and output
Both inputs, that's the whole list:
- image - the tensor to stage
- resolution - 1K / 2K / 4K, mapping to 1024 / 2048 / 4096 (default 2K)
One output: output_image. Wire it into the Banana Gemini Gen node's image1, prompt it to keep the arrowed region and replace the background, and you've got a cutout pipeline.
The trap
Because the canvas is max(proportional_target, original), feeding a source that's already bigger than the target resolution gives you a canvas equal to your image - and zero arrows, since there's no border to draw on. Feed a 4K photo into the 1K setting and you get a copy of your photo back with no markers at all. If the arrows are the whole point of this node, you want your source smaller than the target. That's a classic config gotcha that produces a "why is nothing happening" moment.
Install and fit
Same pack as the Gemini node, so the install is identical: ComfyUI Manager search "Comfyui-banana2", or git clone https://github.com/penposs/Comfyui-banana2 into custom_nodes, then restart. No model downloads, no extra pip packages - it only uses PIL, torch, and numpy, all already in ComfyUI.
One thing to know: the README doesn't document this node at all. It covers the Gemini node and the ratio/scale helpers, but Transparent Image is invisible in the docs - you learn it from the workflow, not the README. That's fine for a utility this simple, but it means the intended arrow semantics live in the community, not the repo. Think of it as the staging half of a two-node product-photography pipeline: photograph your product → this node → Banana Gemini Gen → out comes the cutout, ready for the relight-and-composite stage that the KB's background-removal essay describes as the dominant commercial workflow.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resolution | COMBO | 2K | 3 options: 1K, 2K, 4K |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_image | IMAGE | — |