Flux 2 Pro Generator
Flux 2 Pro in ComfyUI — rent the model nobody can run locally
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- image_9
- image_10
- IMAGE
- DEBUG_PAYLOAD
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 pickcustom, 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.txtraises 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.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| prompt | STRING | — | |
| aspect_ratio | COMBO | 1:1 | 8 options: custom, 16:9, 9:16, 1:1, 4:3, 3:4, +2 |
| width | INT | 1024256–2048 | — |
| height | INT | 1024256–2048 | — |
| resolution | COMBO | 1 MP | 4 options: 4 MP, 2 MP, 1 MP, 0.25 MP |
| seed | INT | 00–18446744073709550000 | — |
| safety_tolerance | INT | 21–5 | — |
| output_quality | INT | 801–100 | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| image_6opt | IMAGE | — | |
| image_7opt | IMAGE | — | |
| image_8opt | IMAGE | — | |
| image_9opt | IMAGE | — | |
| image_10opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| DEBUG_PAYLOAD | STRING | — |