Flux Kontext (Replicate)
Style transfer without the 24GB model
- image
- image
Flux Kontext is Black Forest Labs' reference-based editing model - the one that looks at an input image and re-renders it to follow your prompt while keeping the subject, composition, and identity. "Make this a 90s cartoon," "turn the sky into a cyberpunk city," "recolor this as a watercolor" - that's Kontext's whole lane. This node runs it on Replicate, so you never download the model; you rent a single inference.
This is the right tool when you want Kontext's "keep this element, change everything else" behavior but your GPU can't fit another 20GB of weights. BFL's Kontext is also, historically, one of the most aggressively safety-tuned models in the family - the KB's community history notes the dev tier got so heavily filtered that people complained it "flat-out refuses to follow the prompt" when it decides something is unsafe. Keep that in mind before you ask it to do much.
How it works
The node calls replicate.run() with the model you picked, passing your image and prompt as inputs. Replicate spins up the hosted model, runs it, and hands back a URL to the result, which the node downloads and converts to a Comfy IMAGE. The model, the weights, the VRAM - all on Replicate's side. All you need is a Replicate token.
The inputs that matter
- image - your source. The whole point of Kontext is that this image's identity is preserved.
- prompt - what to change. Kontext is the model that can be prompted into a genuinely new composition rather than a re-texture, per the community history - it's better than most at "preserve element X of subject A, and ..." phrasing.
- model -
flux-kontext-dev(the default, and the one everyone's LoRAs are trained for),flux-kontext-max, orflux-kontext-pro. Dev is the sensible default; max/pro cost more per run. - aspect_ratio - this is where the good default lives:
match_input_image, which preserves your source's composition instead of recropping. Pick an explicit ratio only if you want to change framing. - output_format -
jpgorpng. JPG is cheaper/smaller; png if you need lossless. - safety_tolerance - 0–6, default 2. This is the Replicate safety knob; lower values mean stricter filtering, higher means looser. If you're getting blocked by the model's baked-in filters, this is the lever - but it only goes so far, because a chunk of Kontext's filtering is trained into the weights, not a Replicate-side preference.
- prompt_upsampling - on/off; upsamples your prompt internally for better detail at a small cost.
- seed / api_key - seed for re-runs; key in the field or as a
.envvariable name (REPLICATE_API_TOKEN).
The output
image - a single IMAGE, into a preview or save node.
Installing it
This is one node in the Aryan185/ComfyUI-ExternalAPI-Helpers pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Aryan185/ComfyUI-ExternalAPI-Helpers.git
cd ComfyUI-ExternalAPI-Helpers
pip install -r requirements.txt
Restart ComfyUI; it lives under image/edit. The only pack dependency that matters here is replicate. You need a Replicate API token from replicate.com/account/api-tokens - paste it in the field or set REPLICATE_API_TOKEN in .env (copy .env.example) and reference the variable name.
Where people get burned
The cost model: Replicate bills per second of GPU time, and Kontext runs aren't instant. A single max-tier run is noticeably more expensive than dev; iterate on dev. And the safety filter is the recurring complaint - the KB notes the mid-2025 Kontext dev was so locked down that even people who liked the model called the censorship "pathetic." If your prompt sits near a filter boundary, you'll get a refusal that looks like a node error but isn't. And while Kontext's local LoRA library is still great, this API node has no LoRA support at all - it's the plain hosted model, period.
Honest take: if you have the VRAM, local Kontext with a LoRA beats this. If you don't, this is a perfectly clean way to rent the capability.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | Make this a 90s cartoon | — |
| api_key | STRING | Directly put Replicate API token or .env variable name (REPLICATE_API_TOKEN) | |
| model | COMBO | flux-kontext-dev | 3 options: flux-kontext-dev, flux-kontext-max, flux-kontext-pro |
| aspect_ratio | COMBO | match_input_image | 14 options: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, +8 |
| output_format | COMBO | jpg | 2 options: jpg, png |
| safety_tolerance | INT | 20–6 | — |
| seed | INT | 691–2147483646 | — |
| prompt_upsampling | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |