Krea 2 Input Embeddings
Export Krea 2's actual text embeddings instead of re-encoding every run
- clip
- State Dict
- Embeddings
Krea 2 conditions on text through a Qwen3-VL text encoder, and most workflows re-encode that text on every single run. UC_Krea2InputEmbeds lets you do the encode once and keep the result: it turns a prompt plus image paths into the raw token embeddings - a [num_tokens, 2560] tensor that is, as far as the model cares, the finished conditioning. No VLM, no re-encode, just the numbers.
The display name is a slight misnomer - it's output embeddings, really. This is a tool for people who cache, batch, or train. Three genuinely different use cases:
- Caching. Encode a library of prompts once, save the tensors as
.safetensors, and skip the text encoder on every subsequent run. If you're rendering the same character description across fifty variations, that's real time saved. - Offline/precomputed workflows. Generate embeddings on a beefy machine, run sampling elsewhere.
- Custom conditioning. You get the raw tensor, so anything that wants to poke at Krea 2's conditioning space - the probe and ablator nodes in this same pack being the obvious example - has clean material to work with.
How it works
You feed it a clip (a Qwen3-VL-4B CLIP loaded for Krea 2, via Load CLIP with type krea2), a prompt, and optionally image paths. The text goes through the encoder; images go through the VLM's semantic path at the resolution you pick in vlm_resolution (Fast (384) by default, up to XX-Large (1536) or Original). The output is the full interleaved sequence of text-plus-visual token embeddings at the encoder's native 2560 dimensions per token.
The two outputs:
- State Dict - a dict in the shape
{'qwen3vl_4b': tensor_2d}. This is what you save to disk (theqwen3vl_4bkey matches how the encoder is registered). - Embeddings - the raw PyTorch 2D tensor itself,
[num_tokens, 2560].
The fiddly part, and the place people get burned: image_paths and file_names are line-separated lists that must map 1-to-1. file_names is what the tensor gets saved as (no .safetensors extension - you add that), and it can include nested subfolders. If you only want text (no images), leave image_paths empty and just supply file_names. And slice_visual_tokens - when true, it drops the first validated visual-token span from the sequence; leave it off unless you know your downstream consumer expects a trimmed sequence.
The pack's own migration notes flag that this node replaced the older UC_Qwen3VLInputEmbeds, so if you see both in a workflow you're looking at an older graph.
Install and setup
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
restart, and you need the pieces Krea 2 itself requires: the Krea 2 checkpoint, the Qwen3-VL text encoder (~8GB - the one people routinely forget), and the Qwen-Image VAE. Dependencies for the pack itself are just opencv-python and typing-extensions.
Two gotchas specific to this node. First, the image paths are read directly from disk by the server process - not from ComfyUI's input folder, not uploaded. The path has to exist on the machine running ComfyUI. Second, an empty prompt with only images is fine, but empty file_names with images present errors on purpose - you always need at least one name to save under. It's a power tool, not a beginner node; if you're just generating Krea 2 images normally, you never need it.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | Input text prompt. Important: skips any template wrapping. | |
| image_paths | STRING | Line-separated list of paths to image files. Must map 1-to-1 with file_names. | |
| vlm_resolution | COMBO | Fast (384) | Resolution of the image passed to the VLM (semantic path). |
| file_names | STRING | Line-separated list of file names to save as (without .safetensors). Can include nested subfolders. Must map 1-to-1 with image_paths. | |
| slice_visual_tokens | BOOLEAN | false | If True, removes the first validated visual-token span. If False, preserves the full interleaved sequence. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| State Dict | * | Dictionary structure: {'qwen3vl_4b': tensor_2d} of shape [num_tokens, 2560] |
| Embeddings | * | Raw PyTorch 2D tensor of shape [num_tokens, 2560] |