Nodes/Text Encode (Krea2)/Text Encode (Krea2)
ComfyUI Node

Text Encode (Krea2)

Feed a reference image into your Krea 2 prompt

By ethanfel·Created 2 months ago·Updated 2 months ago· 96
Text Encode (Krea2)
  • clip
  • image1
  • mask1
  • CONDITIONING
prompt
system_prompt
vision_megapixels1.0
mask_padding0.00
vision_positionbefore prompt
print_promptfalse

Krea 2 already runs fine on stock ComfyUI - native support landed in 0.25.0, so plain text-to-image is just CLIPLoader (type: krea2) into UNETLoader, no custom nodes at all. So why this one? Because Krea 2's text encoder is Qwen3-VL, a vision-language model, and that means you can push a reference image through its vision path and make the conditioning aware of what's in the picture. Prompt from a photo, basically. This node is the clean way to do that.

The reason it exists is that people were reaching for the core TextEncodeQwenImageEdit node to pull the same trick, and it doesn't fit Krea 2. Two things go wrong there. First, the VAE input does nothing - Krea 2's DiT builds its token sequence as text plus noisy image patches, with no slot for a reference latent, so a connected VAE just produces a reference_latents entry the model silently throws away. Second, with an image attached the core node falls back to Qwen3-VL's plain image template instead of the Krea 2 descriptor template the model was actually conditioned on. This node fixes both: it forces the descriptor template even with images, and it drops the VAE input entirely.

Set your expectations right, though. This is not image editing and it's not inpainting. Krea 2 has no reference-latent pathway, so you can't do pixel-faithful edits the way Qwen-Image-Edit does - no concat, no "regenerate this masked region." What you get is vision-aware conditioning: the VLM looks at your image, and that understanding steers a fresh generation. Think "in the style and content of this," not "change the hat in this exact photo."

How it works

Your prompt and any reference images get assembled into a Qwen3-VL chat turn - image tokens plus your text - and the encoder turns that into a CONDITIONING the Krea 2 sampler cross-attends to. If you attach a mask to an image, the image gets cropped to the mask's bounding box before it hits the vision encoder, so the model only sees the region you care about. That's reference masking, not inpainting - the mask never reaches the model, it just decides what the VLM looks at.

The inputs that matter

  • clip - load it with CLIPLoader set to type krea2. Same encoder your base Krea 2 workflow already uses; no extra model files.
  • prompt - your text, as usual.
  • image1 (optional) - your reference. Wire one in and a fresh image2/mask2 pair appears, so you can stack several.
  • mask1 + mask_padding - optional per-image mask that crops to its bounding box; mask_padding grows that box (0 = tight, ~0.1 keeps a 10% margin of surrounding context).
  • system_prompt - a connectable input, not a widget. This is the important one; see below.
  • vision_megapixels (default 1.0) and vision_position (before prompt / after prompt) - downscale cap for references and where the image tokens sit in the turn. Defaults are fine to start.

Output is a single CONDITIONING - straight into your Krea 2 KSampler. With no image connected, it just works as a plain Krea 2 text encoder. (print_prompt dumps the assembled Qwen3-VL prompt to the console if you want to see what's actually being sent.)

The gotcha everyone hits

By default the VLM is only told to describe the reference. So your prompt and the image end up sitting side by side rather than blending - and this trips people up hard. One user on r/StableDiffusion put it exactly right: the node is excellent at describing the reference and making good images, but "I can't seem to change the subject's appearance... even if I explicitly prompt 'she has long blonde hair,' the output still keeps locking the hairstyle from the reference." That's not a bug. It's the default descriptor doing its job. To make the prompt actually override or combine with the reference, wire the Krea2 System Prompt node (ships in this same pack) into system_prompt - that swaps in an instruct-style instruction. Heads up that it's experimental / out-of-distribution, since Krea 2 was trained on the fixed descriptor, so A/B it against the default.

Install

ComfyUI Manager: search Text Encode (Krea2) and install. Or manually:

cd ComfyUI/custom_nodes && git clone https://github.com/ethanfel/ComfyUI-Krea2TextEncoder

Then restart ComfyUI. No model downloads of its own - it rides on the Krea 2 CLIP (the Qwen3-VL encoder) you're already loading. If a reference image seems ignored on faces or emotions, that's usually Krea 2's baked-in alignment filter flattening things, not this node.

Categorymodel/conditioning/krea2

Inputs (9)

NameTypeDefaultDescription
clipCLIP
promptSTRING
system_promptoptSTRINGOptional system-instruction input. Wire a text node to override how the VLM frames the reference + your prompt; leave unconnected to use Krea2's trained descriptor (in-distribution). Use an instruct/edit-style instruction (see README) to fuse the prompt with the image. The node adds the chat-template scaffolding; provide just the instruction text.
image1optIMAGE
mask1optMASK
vision_megapixelsoptFLOAT1.00.1–8Maximum size (in megapixels) for each reference before the Qwen3-VL vision encoder. References larger than this are downscaled; smaller ones (e.g. a tight mask crop) are kept at native size, never upscaled.
mask_paddingoptFLOAT0.000–1Context kept around the mask before cropping, as a fraction of the image size added on EACH side. 0 = tight crop to the mask; 0.1 = ~10% margin of surroundings. Only applies when a mask is connected.
vision_positionoptCOMBObefore promptWhere the image (vision) tokens sit in the user turn relative to your text. 'before prompt' = image then text (default); 'after prompt' = text then image. No effect without an image. Experimental.
print_promptoptBOOLEANfalsePrint the full assembled prompt sent to the Qwen3-VL encoder (system instruction + vision placeholders + your text) to the ComfyUI console.

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING