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.
print_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
clipand a clearpromptfor text-only conditioning, then connectimage1when you want the encoder to consider a visual reference. - Connect
mask1to focus on a specific part ofimage1. Keepmask_paddingat 0.0 for a tight crop, or increase it when the surrounding scene is important to understanding the selected region. - Use
vision_megapixelsas 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_promptunconnected 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_promptwhen troubleshooting prompt assembly, and comparevision_positionsettings 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
clipand provide text inprompt.
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
clipcomes 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; enableprint_promptto check that the reference is included.
