心宝❤绑定生成
One context object that keeps your subject consistent across Banana calls
- binding_context
Gemini's image models have a superpower the pack is built around: you can generate a local region of an image and have the model keep everything outside that region identical - same subject, same lighting, same pixels, zero offset. The thing that makes that possible is a "binding context," and this node is how you mint one.
By itself it does almost nothing. It has one input, one output, and no pixels touch it. Its whole job is to produce a binding_context (a BANANA_BINDING object) that other nodes in the pack require before they'll agree to do region work. Think of it as a session token for a binding chain: it tells the Banana node which image's context is authoritative, and it tells the crop/paste nodes which layout the region belongs to.
The one input that matters
force_refresh, a boolean, default off. When off, the node reuses a cached binding context between runs - which is what you want when you're iterating on a region: same context, new crop, the model keeps treating the surrounding pixels as fixed. Turn it on and the node throws the cache away and generates a fresh binding context every run.
Why would you ever refresh? Because the cached context is tied to a particular source image. If you swap the input image in a workflow and don't refresh, the binding still points at the old picture's identity, and your "local fix" gets pasted relative to a ghost. When you change the base image, refresh.
Where it sits in the chain
The README's example of the binding-enhanced chain is:
心宝❤绑定生成 → crop/segment prep → 心宝❤Banana → BananaLocalCropPaste
Concretely: BananaBindingGenerate outputs binding_context, which wires into the binding_context input on the Banana node (the tooltip there says it's only needed when you're using the binding enhancement nodes). The same context also feeds BananaLocalCropPaste, which needs it - alongside the regenerated banana_image and the region_data from the crop preprocess - to paste the new region back in exactly the right place. The LayerMask: MaskBoundingBoxAligned node also takes a binding_context and refuses to run without it, because its whole point is cropping a mask aligned to the binding.
For plain generation, leave this entire chain disconnected - the README is explicit that ordinary text-to-image doesn't need binding_context at all. This node exists for the local-edit workflows (the pack's "100% no-offset" trick) where you're fixing one region and trusting the API not to drift on everything else.
Installing
Same pack as the rest:
cd ComfyUI/custom_nodes
git clone https://github.com/98624017/comfyui-banana-li-linux
Restart ComfyUI. No dependencies beyond the pack's base set - this node is bookkeeping, not compute. There's a chance the compiled binary's caching persists across restarts; if your region edits start drifting after reloading a workflow, the first thing to try is forcing force_refresh once, then turning it back off.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| force_refresh | BOOLEAN | false | 开启后将无视缓存,每次运行都强制生成新的绑定上下文 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| binding_context | BANANA_BINDING | — |