Nodes/Magic Hour/Magic Hour · Face Swap (Photo)
ComfyUI Node

Magic Hour · Face Swap (Photo)

Two images in, one out

By RhythmP28·Created about a month ago·Updated about a month ago· 0
Magic Hour · Face Swap (Photo)
  • target_image
  • source_face
  • IMAGE
api_key

Magic Hour · Face Swap (Photo) is the smallest node in the pack and arguably the best demonstration of why API nodes exist: two IMAGEs in, one IMAGE out, nothing else. No model dropdown, no prompt, no InsightFace install, no ONNX weights to fight a licensing headache over. It uploads your images to Magic Hour, runs their hosted face swap, and drops the result back into your graph as a tensor.

There's a real local world here, and it's good - ReActor/InsightFace and ACE++ do pixel-level swaps on your own GPU for free. If you have the card and the patience, that's the privacy-preserving route. What this node is for: the machine without a GPU, the person who doesn't want to babysit a face-detector stack, or a quick swap that needs to feed the rest of your graph (drop the result into the pack's Image to Video node and you've animated a swapped face - that pipeline gets weirdly fun).

How it works

Both images are uploaded to Magic Hour, a face-swap-photo job is submitted, and the node polls until it completes - same blocking behavior as the video nodes, but much faster since we're talking a still image. The result comes back as a normal ComfyUI IMAGE tensor, ready for a Save node or whatever comes next.

One thing the source code makes clear: this node always runs Magic Hour's face swap in all-faces mode. There's no "just the first face" toggle exposed. Feed it a group photo and you get every face in the target replaced with the source's identity. For a single-person portrait that behaves exactly like the classic swap you're picturing.

The inputs that matter

  • target_image - the photo whose face(s) get replaced.
  • source_face - the face whose identity gets swapped in. Feed it a clean, front-facing, well-lit shot; the swap quality tracks how good the source reference is.
  • api_key - the usual optional field, only needed if you haven't set the env var.

Both inputs are IMAGE, so they can come from anywhere in the graph - a loaded photo, a generated portrait, a frame pulled out of a video. The single output, IMAGE, is what you save or pass on.

Installing and your first run

ComfyUI Manager: search "Magic Hour" → install. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/RhythmP28/comfyui-magic-hour

Restart ComfyUI. Just requests, pillow, and numpy - no models, no weights.

Free API key (no card, 400 credits plus 100/day) at magichour.ai/developer. Either paste it into the node or set it once:

export MAGIC_HOUR_API_KEY="your_key_here"

Where people get burned

The honest caveat is the one that applies to the whole pack: the faces leave your machine. When the images are real people - especially you, or someone who didn't sign up to be swapped - that's a real privacy decision, not a formality. This node is the cheapest thing in the pack credit-wise and the least likely to hit a plan wall (it's a still image, no resolution gating to speak of), so the practical failure modes are mostly the shared ones: no key set, or out of credits, both of which error clearly. Failed jobs are auto-refunded.

If you're on a machine that can run it, ReActor is the free, local, uncensored answer and you should weigh that first. If you're not, or you want the swap wired into a bigger hosted pipeline, this is about as frictionless as the task gets.

CategoryMagic Hour

Inputs (3)

NameTypeDefaultDescription
target_imageIMAGE
source_faceIMAGE
api_keyoptSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE