Text Encode LongCat Image Edit
Editing an image by talking about it — with up to three references, sort of
- clip
- vae
- image1
- image2
- image3
- conditioning
This is the node that makes LongCat's edit pipeline work - the thing that got people excited about the model in the first place. Instead of masking and inpainting, you hand it an image and a sentence like "make the background a beach," and it figures out what to keep and what to change. That's because LongCat's text encoder is a vision-language model: it actually looks at the reference image, then reads your instruction on top of it.
TextEncodeLongCatImageEdit takes a clip (from LongCatCLIPLoader - specifically the edit-capable checkpoint that includes the image encoder) and a multiline prompt. The rest is optional: a vae, plus image1, image2, and image3 sockets. Here's the catch in the fine print - if you connect any image, a vae becomes mandatory, and the node will throw a ValueError if you skip it. That VAE is needed because the reference gets encoded into image latents that join the denoise loop.
Mechanically it embeds each reference image into the edit chat template as image-pad tokens, runs the text encoder over text-plus-image, and produces conditioning that carries the images and the VAE through to LongCatSampler. The sampler then encodes the refs, concatenates their latents with the noise, and lets the model attend to both.
Before you get carried away with all three image sockets, some honesty. The plugin's own README marks this node as partially implemented, and the underlying LongCat family shipped with single-image editing - multi-image editing was announced as a priority for the next release. So treat image2/image3 as aspirational rather than guaranteed to behave. Also feed it a properly sized reference: run the image through LongCatImageResizer first (pick the same bucket you're generating into) or you're handing the editor an off-bucket image.
The workflow shape it's reaching for:
LongCatCLIPLoader→ clipLongCatVAELoader→ vaeLongCatImageResizer→ reference at a supported size- This node → conditioning (with prompt, image, vae)
LongCatSizePicker+LoadLongCatModel+ conditioning →LongCatSampler
The catch with negative prompts in edit mode: you typically want a single conditioning here, since the negative guidance mostly applies to the global denoise, not the edit intent. And the pack-level caveat still stands - it's a one-commit early port, so expect rough edges and check the console when something doesn't do what the demo suggests.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| vaeopt | VAE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |