NO8DKrea2GroundedEncode
The grounded instruction encoder behind Krea2 edit
- clip
- image
- CONDITIONING
Krea 2 is a text-to-image model, not an edit model. So how do you edit with it? The community trick, pioneered by Ostris, is to encode your instruction and the source image together into the conditioning - grounding the prompt in what's actually in the frame, then letting the edit patch push the result. NO8DKrea2GroundedEncode is the encoding half of that: it takes a CLIP, your instruction text, and the source image, and returns a conditioning built from both.
Mechanically, it's built around Krea 2's Qwen3-VL text encoder. The node wraps the instruction in Qwen's chat template with a vision placeholder - a system line ("Describe the image by detailing the color, shape, size, texture, quantity, text, spatial relationships..."), the image tokens, and your text - then tokenizes and encodes it. If the image's longest edge is over 768px it scales it down first, so the encoder isn't fed a giant image it will just downsample internally anyway. That template is exactly how the model was trained to consume image-plus-instruction, which is why the result reads as a grounded instruction rather than a prompt with a loose attachment.
What you set
clip- the Krea 2 CLIP (the Qwen3-VL text encoder).text- the edit instruction ("make this a night market scene, same person").image- the source/reference image to ground the instruction in.
Output is CONDITIONING, ready to feed a sampler - and, in the edit workflow, paired with the model patch from NO8DKrea2ReferenceModel.
The honest picture
This node is flagged DEPRECATED and lives in NO8D-controls/internal, which is the pack's way of saying "not for general consumption." Its real home is inside NO8D-Generate: when that node detects a Krea2 edit model upstream, it builds the grounded conditioning internally using exactly this logic, so you don't need to wire this node yourself. If you're hand-building an Ostris-style Krea2 Edit graph outside NO8D-Generate - using the reference method node and an edit LoRA - this is a working, tested implementation of the encode step you'd otherwise have to assemble from raw pieces, and it's Apache-2.0-derived from the lbouaraba Krea2 edit extension.
Two practical notes. First, the grounding depends on the vision encoder actually seeing the image - feed it the right reference (the thing you want preserved), not a mood board. Second, this is experimental territory: the Krea2-edit community reports the approach can alter the input image and occasionally duplicates subjects depending on the prompt, so the encoded conditioning is a starting point to validate, not a promise. When in doubt, run with and without the edit path and compare - that's what the remove/match nodes in this pack exist for.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/no8d/ComfyUI-NO8D-controls.git
python -m pip install -r requirements.txt
ComfyUI Manager → "NO8D-controls". No models bundled - you supply the Krea 2 model, its Qwen3-VL CLIP, and the VAE. And because it's internal, find it by searching the full class name in the node menu rather than expecting it in the main NO8D-control section.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| text | STRING | — | |
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |