ComfyUI-Krea2TextEncoder Introduction
ComfyUI-Krea2TextEncoder provides the Text Encode (Krea2) node for creating prompt conditioning for the Krea2 / K2 image model (kreaturbo.safetensors). Alongside your written prompt, you can provide reference images so the model’s text encoder can take visual details into account.
This can be useful when you want a generated image to draw inspiration from a reference’s colors, shapes, textures, objects, or background. The node also supports an optional mask for each reference image, letting you focus its attention on a particular part of the image.
The author created this node to address two confusing behaviors when using ComfyUI’s TextEncodeQwenImageEdit node with Krea2: its VAE input does not give Krea2 a usable reference image for pixel-faithful editing, and attaching an image changes the prompt format away from the descriptor format used for Krea2. Text Encode (Krea2) keeps that descriptor format when images are connected and does not offer a VAE input that Krea2 would ignore.
How ComfyUI-Krea2TextEncoder Works
Think of the node as preparing a brief for Krea2. Your prompt supplies the written direction, while any connected reference images provide visual information. The node passes both through Krea2’s Qwen3-VL-4B text encoder and outputs conditioning for the Krea2 sampler.
A reference image is visual guidance, not an editable canvas. Krea2 can use information the encoder draws from the image, but this node cannot make the model copy pixels faithfully or replace a specific area of an existing image. Krea2 does not have the reference-latent pathway that would make that kind of editing possible through this node.
If you connect a mask, the node first crops the corresponding reference image around the mask’s bounding box. The vision encoder then sees that crop, rather than the mask itself. For example, masking a vase on a table directs attention toward the vase; adding padding can keep some of the table visible for context. This does not inpaint the output or tell Krea2 where to place the vase in the generated image.
You can also use the node without any images. In that case, it acts as a plain Krea2 text encoder.
ComfyUI-Krea2TextEncoder Features
Reference images and optional masks
Connect an image to image1 to add a visual reference. As you connect images, the node grows to offer another image and mask pair, so you can use multiple references. Each maskN applies to its matching imageN.
A mask crops the input reference to the masked region before encoding. Use mask_padding to control how much of the surrounding image stays in view:
0(the default) makes a tight crop around the mask.0.1adds a margin of approximately 10% of the image size on each side.- Higher values retain more context; sufficiently high values can bring nearly the whole image back into view.
If you instead want to restrict where conditioning applies in the generated output, you can place ComfyUI’s standard ConditioningSetMask downstream of this node. That is separate from reference-image cropping and is not an inpainting feature.
Prompt and system instruction
Enter your image idea in prompt. Leave system_prompt unconnected to use Krea2’s default descriptor instruction—the format the model was trained with. This is the recommended starting point when comparing results.
For a different approach, connect a text node to system_prompt. The extension includes a Krea2 System Prompt node with an editable instruction that asks the encoder to describe the reference and consider how your request should combine with or alter it. This can encourage more interaction between your prompt and the reference, but it is experimental: Krea2 was trained with the fixed descriptor instruction, so results may drift. Try the same workflow with and without the override to see which works better for your image.
Provide only the instruction text to system_prompt; the node adds the required prompt formatting.
Other controls and output
| Control | What it does |
|---|---|
clip | Accepts the encoder loaded with CLIPLoader → type krea2. |
vision_position | Places image information before prompt (default) or after prompt in the user message. Try both if the relationship between your text and reference is not coming through as you expect. |
vision_megapixels | Caps reference-image size before vision encoding. The default is 1.0 megapixel. Images above the cap are downscaled; smaller images are never upscaled by this setting. |
print_prompt | Prints the assembled Qwen3-VL prompt to the ComfyUI console for debugging. It does not create an image preview. |
The node outputs standard conditioning for the Krea2 sampler.
ComfyUI-Krea2TextEncoder Models
This extension is designed for the Krea2 / K2 model (kreaturbo.safetensors). Its text encoder is Qwen3-VL-4B, which can process both text and visual information. The extension does not provide a selection of alternative image-generation models.
Use CLIPLoader with type krea2 for the node’s clip input. The included Krea2 System Prompt is a prompt helper, not another model.
Troubleshooting ComfyUI-Krea2TextEncoder
My reference image does not appear to be copied or edited precisely.
- Treat the image as visual guidance rather than a source of pixels to preserve exactly.
- Describe the details you want in
prompt, and compare the result with Krea2’s default descriptor instruction. - If you want the prompt to explicitly build on or alter the reference, try the Krea2 System Prompt node and compare results.
This node cannot add pixel-faithful reference editing to Krea2.
My mask is not filling or changing a region in the output.
- Check that
maskNis paired with the intendedimageN. - Remember that the mask only chooses what part of the reference image the vision encoder sees.
- Adjust
mask_paddingif the crop needs more surrounding context.
For spatial control over where conditioning applies in the output, use ConditioningSetMask downstream. Reference-image masks are not inpainting masks.
My reference seems to have too little context.
Increase mask_padding from its default of 0. This widens the crop around the selected area, which can help retain nearby objects or background details.
My prompt and reference do not seem to interact.
Start with the default system_prompt setting, then connect Krea2 System Prompt and compare. Its instruction explicitly asks how your written request should combine with the reference. Because this override is experimental for Krea2, the default may still produce a better result. You can also compare the two vision_position options.
Can I use the node without a reference image?
Yes. Leave the image inputs unconnected, and it produces plain Krea2 text conditioning.
What does print_prompt show?
It prints the assembled prompt in the ComfyUI console. Turn it on when you want to inspect the text sent for encoding; it does not display a screenshot or image in the workflow.
