Nodes/ComfyUI-Flux2proReplicate/Flux 2 Pro Generator
ComfyUI Node

Flux 2 Pro Generator

Flux 2 Pro in ComfyUI — rent the model nobody can run locally

By mamorett·Created 9 months ago·Updated 9 months ago· 1
Flux 2 Pro Generator
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • IMAGE
  • DEBUG_PAYLOAD
api_key
prompt
aspect_ratio1:1
width1024
height1024
resolution1 MP
seed0
safety_tolerance2
output_quality80

The best Flux 2 that exists is the one you can't download. Flux 2 Pro is Black Forest Labs' flagship, and unlike Dev or Klein it never shipped as weights - it lives on BFL's API and on Replicate, billed per image. This node is the bridge. It drops a full Flux 2 Pro generation into your ComfyUI graph with no local model, no download, and no GPU requirement, for the price of an API call.

If you watched the Flux 2 launch, you know the backstory. Dev landed as a 32B rectified flow transformer plus a 24B Mistral-3 vision-language encoder - roughly 56GB of weights - and the community's verdict was "great model, who's supposed to run this?" Klein fixed the hardware complaint a couple of months later, but the ceiling stayed behind the paywall. Flux 2 Pro is that ceiling. If your machine is a 6GB laptop or a Mac, or you just want the strongest prompt adherence without babysitting a 35GB fp8 quant download, this is how you get it from inside ComfyUI.

How it works

The pack is a thin client, and the code tells the whole story. You feed it an API key, a prompt, and some options; it builds the same JSON payload you'd POST to Replicate by hand, sets your token as an environment variable, calls replicate.run("black-forest-labs/flux-2-pro", input=...), downloads the returned image, and hands you a normal IMAGE tensor. Nothing heavy runs on your machine - just the plumbing. Your prompt and images do head out over the wire, so keep anything sensitive out.

It also returns a second output, DEBUG_PAYLOAD - the exact request JSON it sent (image data shown as <Image Data N> placeholders). The first time the API rejects something, that string tells you what went out; keep it until you're confident, then drop it.

The inputs that actually matter

  • api_key - the token from the Flux Replicate Auth node (or a string literal, though that's exactly what the auth node exists to avoid).
  • prompt - multiline. Flux 2's encoder is an LLM, so write sentences, not tag soup.
  • aspect_ratio - presets from 16:9 to 9:21, or custom, which unlocks width/height (256–2048, step 16). Here's the trap: when you pick custom, the resolution field (0.25 / 1 / 2 / 4 MP) is silently ignored - pick one path or the other.
  • seed - reproducibility, from 0 up to a very large number.
  • safety_tolerance (1–5) - how aggressively Replicate's server-side filter scrubs the output before it reaches you. Default 2.
  • output_quality (1–100) - a JPEG-style quality slider, except the payload hardcodes output_format: png, so it's largely a no-op here. Set it and forget it.
  • image_1 … image_10 - optional input images for image-to-image and multi-reference guidance.

Outputs

  • IMAGE - a normal ComfyUI tensor. Wire it into Save Image or Preview Image and you're done.
  • DEBUG_PAYLOAD - the request JSON as a string.

Install

Via ComfyUI Manager, search the pack title and install. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/mamorett/ComfyUI-Flux2proReplicate
cd ComfyUI-Flux2proReplicate
pip install -r requirements.txt

The only real dependencies are replicate and requests. Then restart ComfyUI and create the key file:

# inside ComfyUI-Flux2proReplicate/
echo "r8_YourReplicateToken" > replicate_api_key.txt

Grab the token from replicate.com/account/api-tokens. The file is gitignored, so updating the pack in place won't wipe it - but a fresh clone won't include it either.

Where people get burned

  • It costs real money, per run. Every queue execution is a fresh Replicate call and a fresh bill. Batch-generating at 4MP adds up fast.
  • The key file must exist. A missing replicate_api_key.txt raises a FileNotFoundError with a helpful message; an empty file raises ValueError. Both point at the pack folder.
  • Each image input only sends its first frame. The node takes tensor[0], so a batched image or video frame collapses to a single image. Fine for stills; surprising if you expected batch behavior.
  • Custom dimensions ignore resolution. Not a bug, but it reads like one when you've set both.
  • It needs internet and it can fail mid-graph. This is a hosted API; a flaky connection means a RuntimeError somewhere in the download step.

Want Flux 2 locally instead? Klein is the open-weights answer and the 4B runs in about 8GB of VRAM - free, no API. This node is for when you want the tier that never left the API.

CategoryFluxReplicate

Inputs (19)

NameTypeDefaultDescription
api_keySTRING
promptSTRING
aspect_ratioCOMBO1:18 options: custom, 16:9, 9:16, 1:1, 4:3, 3:4, +2
widthINT1024256–2048
heightINT1024256–2048
resolutionCOMBO1 MP4 options: 4 MP, 2 MP, 1 MP, 0.25 MP
seedINT00–18446744073709550000
safety_toleranceINT21–5
output_qualityINT801–100
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE
image_9optIMAGE
image_10optIMAGE

Outputs (2)

NameTypeDescription
IMAGEIMAGE
DEBUG_PAYLOADSTRING