Magic Hour: AI Image Editor
Nano Banana and friends, wired straight into your graph
- image
- image_2
- image_3
- image
- image_paths
- credits_charged
The AI Image Editor is the node in this pack that actually changes what you can do, rather than just moving an operation off your GPU. It's a text-prompt image editor with a model dropdown, and that dropdown contains a list of names that have no open weights: nano-banana, nano-banana-2, nano-banana-pro, gpt-image-2, gpt-image-2.5-flare, krea-2, qwen-edit, qwen-image-2.1, flux-2-klein, and a few more. These are instructions-only edits - "make the jacket red", "remove the person on the left", "turn this into a watercolour" - running on someone else's hardware.
That's the entire value proposition, and it's the same one the KB's API-node essay describes: for the closed frontier there is no local option at any VRAM, so the choice isn't local-vs-cloud, it's cloud-or-nothing.
The free-plan tip the author put in the node description
model = flux-2-klein with resolution = 640px is the combination the author calls out as the free-plan route. It's in the node description itself, which is a nice bit of honesty - most wrappers would let you discover that by watching a 402 appear.
The general rule that tip encodes: model choice and resolution both move the price, and they're independent dials. flux-2-klein at 640px is cheap. nano-banana-pro at 2k is not. Get the edit right at the cheap end, then re-run the winning prompt at the resolution you actually want.
How it works
image becomes a temp PNG. If you've connected the optional image_2 and image_3, the request switches from a single-image asset to a multi-image asset list - that's how you do "put the jacket from this picture on the person in that picture" style edits, and it's the reason those extra sockets exist rather than being decoration. Your prompt goes in the style block, along with aspect_ratio and image_count.
resolution and model are only sent when they're not auto/default - so leaving them alone means Magic Hour picks, which is a reasonable default and also means the price isn't fully in your hands until you set them explicitly.
image_count runs from 1 to 4. Four variations of the same edit in one call is usually better value than four calls, and the results come back as one IMAGE batch - four frames, so you can eyeball them in one Preview.
Inputs and outputs
Required: image, prompt, model, aspect_ratio (auto, 1:1, 16:9, 9:16, 4:3, 3:2, 2:3, 4:5), resolution (auto, 640px, 1k, 2k, 4k), image_count (1–4). Optional: image_2, image_3.
Outputs: image (batch of up to four edited images), image_paths (STRING, newline-joined paths), credits_charged (INT).
The model list is read from the installed SDK at import time rather than hardcoded, which is why it'll grow as Magic Hour adds models - and why the list you see can differ from the list in a tutorial written a month ago.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/magichourhq/comfyui-magic-hour
pip install -r comfyui-magic-hour/requirements.txt
Restart. Dependency: magic-hour>=0.87.1 and nothing else. No weights, no VRAM, no GPU pass. ComfyUI Manager users can search "Magic Hour".
export MAGIC_HOUR_API_KEY=your_key_here
before launching, or a plain api_key.txt in the pack folder. Never in a widget - widget values are serialised into the workflow JSON.
Prompts here are not diffusion prompts
This is the mistake people make coming from local Flux or SDXL. You're talking to an instruction-following image model, so write a sentence with a verb in it: "change the background to a snowy street at night, keep the subject lit the same way". Weighted token soup - (masterpiece:1.2), 8k, best quality - does nothing useful and can actively confuse it. The KB's prompt-engineering doc's point about knowing which encoder you're talking to applies in full.
Also: preserve-what-matters instructions are worth the words. "Keep the face and hair exactly as they are" measurably helps with identity drift on the weaker models.
Where it goes wrong
422. The chosen model/resolution/aspect combination isn't supported. Drop to auto on resolution and retry.
Fewer images than you asked for. Check image_paths - sometimes the batch is shorter than image_count, and the string tells you what actually landed.
Batch in, first frame out. As with every image input in this pack, only the first image of an incoming batch is uploaded. Loop in the graph if you need many.
402 on 4k. Credits. The node's error text distinguishes "needs a paid plan" from "out of credits", so read it.
If you already pay for nano-banana through Comfy's own API nodes, this is redundant. If you don't, this is a cheap way to have the closed frontier in the same graph as your local masking and upscaling - which is the actual reason people bother with these wrappers.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | — | |
| model | COMBO | default | 15 options: default, flux-2-klein, gpt-image-2, gpt-image-2.5-flare, krea-2, nano-banana, +9 |
| aspect_ratio | COMBO | auto | 8 options: auto, 1:1, 16:9, 9:16, 4:3, 3:2, +2 |
| resolution | COMBO | auto | 5 options: auto, 640px, 1k, 2k, 4k |
| image_count | INT | 11–4 | — |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_paths | STRING | — |
| credits_charged | INT | — |