Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > Text Encode (Krea2) > Text Encode (Krea2)

ComfyUI Node: Text Encode (Krea2)

Class Name

TextEncodeKrea2

Category
model/conditioning/krea2
Author
ethanfel (Account age: 3465days)
Extension
Text Encode (Krea2)
Latest Updated
2026-06-27
Github Stars
0.13K

How to Install Text Encode (Krea2)

Install this extension via the ComfyUI Manager by searching for Text Encode (Krea2)
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Text Encode (Krea2) in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Text Encode (Krea2) Description

Encodes text and optional masked image references into Krea2 conditioning via Qwen3-VL vision.

Text Encode (Krea2):

TextEncodeKrea2 creates Krea2 conditioning from your written instructions, optionally using reference images to help frame the result. It sends references through the Qwen3-VL vision path and combines their visual information with your text in a chat-formatted instruction. When you provide a mask, it focuses the reference on the selected area by cropping around it. This gives you a way to guide Krea2 with both words and visual examples without using a VAE or a reference-latent pathway.

Text Encode (Krea2) Input Parameters:

clip

Required CLIP input. Connect a compatible Krea2 text encoder here. The node uses it to process your text and, when present, reference images into conditioning. A Qwen3-VL encoder loaded in FP8 can work for text-only use but may fail when you add an image reference; use a bf16 or fp16 encoder for image references. No default, minimum, or maximum is specified.

prompt

Required STRING input for the description or instruction you want Krea2 to follow. It supports multiline text and dynamic prompts. The node places this text in the user portion of the assembled chat prompt, alongside any image-reference placeholders, so your wording helps determine how the references are interpreted. No default, minimum, or maximum is specified.

system_prompt

Optional STRING input for a system-level instruction that changes how the vision-language encoder frames your prompt and references. Connect a text node to provide an override, such as an instruction to combine the requested edit with what is visible in a reference; provide only the instruction text, because the node adds the chat formatting. If left unconnected—or supplied as blank text—the node uses Krea2’s built-in system descriptor. No numeric range is specified.

image1

Optional IMAGE input for a visual reference. The node sends connected references through the Qwen3-VL vision path, allowing their visual content to inform the conditioning; it does not encode them as VAE reference latents. If you also connect mask1, the image is cropped around the selected region before vision processing. No default, minimum, or maximum is specified.

mask1

Optional MASK input associated with image1. Areas with mask values above 0.5 determine the bounding box used to crop the reference, helping you direct attention to a particular object or region. If the mask is empty, the full image is kept; if its dimensions differ from the image, it is resized to match before the crop is calculated. This input has no cropping effect without its corresponding image. No default, minimum, or maximum is specified.

vision_megapixels

Optional FLOAT setting that caps the size of each reference sent to the vision encoder. References larger than the cap are downscaled; smaller images and tight mask crops are not enlarged. A lower cap can reduce the image size processed, while a higher cap preserves more of a large reference before encoding. Default: 1.0 megapixel; minimum: 0.1; maximum: 8.0; step: 0.1.

mask_padding

Optional FLOAT setting for how much surrounding context to keep when a masked reference is cropped. Padding is added on each side of the selected region as a fraction of the full image’s width or height, stopping at the image edges. Use 0.0 for a tight crop or, for example, 0.1 to retain approximately 10% of the image size as margin on each side. It applies only when a mask is connected. Default: 0.0; minimum: 0.0; maximum: 1.0; step: 0.02.

vision_position

Optional setting that controls where reference-image content appears relative to your text in the assembled user message. Choose before prompt to place images first, or after prompt to place your text first. It has no effect without a connected image and is marked experimental. Default: before prompt; options: before prompt, after prompt.

Optional BOOLEAN setting for inspecting the assembled prompt. When enabled, the node prints the system instruction, user text, vision placeholders, and reference count to the ComfyUI console; it does not add that printout to the node’s output. This can help you check prompt order and confirm how many references were included. Default: False; options: False and True.

Text Encode (Krea2) Output Parameters:

conditioning

The sole CONDITIONING output. It contains the encoded guidance produced from your prompt and any connected references, ready for a compatible downstream Krea2 workflow. This is processed conditioning, not an image or a readable copy of the prompt; changes to your instructions, references, masks, or vision settings can change the guidance it carries.

Text Encode (Krea2) Usage Tips:

  • Start with clip and a clear prompt for text-only conditioning, then connect image1 when you want the encoder to consider a visual reference.
  • Connect mask1 to focus on a specific part of image1. Keep mask_padding at 0.0 for a tight crop, or increase it when the surrounding scene is important to understanding the selected region.
  • Use vision_megapixels as a size cap: lower it when large references do not need as much detail, and raise it when preserving more detail before vision encoding matters. Small crops will remain at their native size either way.
  • Leave system_prompt unconnected to use Krea2’s built-in descriptor. If you override it, write the instruction itself rather than adding chat-role tags or template markers.
  • Enable print_prompt when troubleshooting prompt assembly, and compare vision_position settings if you want to test whether placing your text before or after the image changes the result.

Text Encode (Krea2) Common Errors and Solutions:

Krea2: the Qwen3-VL text encoder is loaded in FP8, which ComfyUI's vision tower cannot run on the image path ('add_stub not implemented for Float8_e4m3fn').

  • Explanation: A connected image reference requires the vision path, which cannot run with the FP8-loaded encoder in the condition identified by this node. Text-only encoding can still work with that encoder.
  • Solution: For image references, load a bf16 or fp16 Qwen3-VL-4B text encoder through CLIPLoader with type krea2, as the node’s error guidance recommends. Otherwise, disconnect image references for text-only use.

Required input is missing: clip or Required input is missing: prompt

  • Explanation: The node cannot run without both required inputs. The precise validation wording may vary by ComfyUI version.
  • Solution: Connect a compatible encoder to clip and provide text in prompt.

TypeError or an encoder error during clip.tokenize or clip.encode_from_tokens_scheduled

  • Explanation: The connected encoder may not support the image-aware tokenization and conditioning calls this node makes. The exact message depends on the encoder and ComfyUI version.
  • Solution: Check that clip comes from a compatible Krea2/Qwen3-VL text-encoder setup, and verify that its loader and installed components are intended for this workflow.

RuntimeError involving mask or image dimensions

  • Explanation: Masked cropping requires image and mask data that ComfyUI can process; an incompatible shape or invalid image data can cause a dimension-related error. The exact message depends on the supplied data.
  • Solution: Supply valid ComfyUI IMAGE and MASK outputs, connect each mask to its corresponding image slot, and try the image without a mask to isolate the problem.

Reference not cropped as expected, with no error message

  • Explanation: A mask with no values above 0.5 keeps the whole image. A mask also has no effect if its corresponding image is not connected.
  • Solution: Confirm that the mask selects the intended region and is connected alongside image1; enable print_prompt to check that the reference is included.

Text Encode (Krea2) Related Nodes

Go back to the extension to check out more related nodes.
Text Encode (Krea2)
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.