LLS Flux2Klein Edit Text Encode
Flux2Klein edit conditioning in one node — main image plus up to two references
- clip
- vae
- image1
- image2
- image3
- mask
- conditioning
- latent
- custom_output
- main_image
- mask
Flux 2 Klein is the distilled small-model line that became the default local image editor in early 2026 - one checkpoint does text-to-image, single-reference editing, and multi-reference editing. The catch: a proper Klein edit workflow in ComfyUI is a small assembly line of CLIP encoding, reference latents, and latent construction. LLS Flux2Klein Edit Text Encode collapses that into one node, in the style of the PainterFluxImageEdit wrappers.
The model of the node is simple: image1 is the main edit image, image2 and image3 are optional reference images, and the node explicitly never concatenates them - they stay separate inputs to the conditioning. That's the key mechanical detail: multi-image Klein editing is about feeding the model multiple references, not gluing the pixels together.
What you get out
Five outputs, designed to hand off to a KSampler chain:
conditioning- the prompt and vision conditioning, with the reference latents attached.latent- the edit latent (an empty Flux2 latent on the official path, or an image-derived reference latent on the fallback path, depending on your VAE's channel count).custom_output- a structuredLLS_FLUX2KLEIN_OUTPUTpayload with the details, for workflows that want the metadata.main_imageandmask- the prepared main image and mask, passed back out for inspection or downstream use.
The inputs
clip and vae come from your loader. prompt is a plain instruction. ref_longest_edge (default 1024) sets the reference image scale, and resize_mode (longest_edge / keep_original) controls how image1 is prepped. mask_mode (none / use_mask / invert_mask) optionally attaches a mask - with a mask input - so the node can emit a noise-masked latent for masked Klein editing. That's the same "true masked inpainting with Klein" path the inpainting discourse converged on, packaged into one node.
Where it fits
Straightforward wiring: load Klein's model/CLIP/VAE with the LLS loader, load your edit image, encode with this node, then sample with LLS Simple KSampler (which knows how to route FLUX2-family sampling), VAE-decode, and you're done. The pack ships a Flux2Klein e-commerce background-swap workflow as a reference.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/Gin3601/LLS-node
# restart ComfyUI
Or ComfyUI Manager → search "LLS-node". No pip deps - but Klein is a real model with real weight. The 4B variant runs on ~8GB and is Apache 2.0; the 9B needs more and is non-commercial. And mind the KB's warning: Klein distilled is happiest at 4–8 steps with CFG 1 - the LLS Generation Config defaults go the quality route (20 steps, CFG 1), which is fine but slower.
Gotchas
Both clip and vae are required and it will error if either is missing. If you're using a VAE whose latent channels don't match what the node expects for the official Flux2 path, it quietly falls back to the reference-latent path - check custom_output if your edits look off. And don't mix Klein LoRAs across the 4B and 9B sizes; the KB flags that as a real source of breakage.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| vae | VAE | — | |
| image1 | IMAGE | — | |
| prompt | STRING | — | |
| ref_longest_edge | INT | 1024256–4096 | — |
| resize_mode | COMBO | longest_edge | 2 options: longest_edge, keep_original |
| mask_mode | COMBO | none | 3 options: none, use_mask, invert_mask |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| latent | LATENT | — |
| custom_output | LLS_FLUX2KLEIN_OUTPUT | — |
| main_image | IMAGE | — |
| mask | MASK | — |