Krea2 风格语义条件
Krea's cloud style-reference feature, rebuilt locally — no API, no key
- clip
- style_image
- 条件
Krea's hosted style-reference feature - drag a reference image in, and the model borrows its look - is deliberately not part of the open Krea 2 weights. The company said so on the record. This node is a community attempt to rebuild that capability locally. It doesn't call any API, needs no key, and doesn't pretend to be an official adapter. It just feeds your reference image into Krea 2's own text encoder - which is Qwen3-VL, a vision-language model that can actually look at pictures. That's the entire trick, and it's why the node can be this small.
What it actually is
This is the text-to-image style-reference node. You hand it one image and a prompt, and it returns a standard CONDITIONING you plug straight into a KSampler's positive input. Think of it as "borrow the palette, material, brushwork and mood from this picture, but draw what I'm describing." It's the instant alternative to a style LoRA: no training set, no trigger word, per-image style guidance that costs a few extra seconds of encoding.
Two things it explicitly is not. It's not Krea's cloud style adapter, so don't expect a faithful recreation of the reference - read the README as "transfers visual language, not the subject." And it doesn't touch the pipeline beyond conditioning: no diffusion-weight edits, no latent token injection, no sampler changes. The source is small enough to read in one sitting, which is the best sign a node like this can give.
How it works
The mechanism is one line, plus housekeeping. The node builds a text prompt and calls clip.tokenize(prompt, images=[style_image]), then clip.encode_from_tokens_scheduled(tokens). Because Krea 2's encoder is Qwen3-VL - the VLM Krea picked precisely so the stack could later do image editing - passing the image as an argument makes the model see both your words and the reference in one conditioning pass.
What you don't see is the text prepended to your prompt. The node writes an English style instruction ("Use the attached reference image as a style guide. Transfer its visual language, color palette, material texture, brushwork, lighting, composition rhythm, and overall mood. Do not copy the depicted subject."), then appends Target prompt: .... That's where style_strength lives - it picks between three phrasings (轻微 / 平衡 / 强烈, i.e. subtle, balanced, strong). This is the trap: it's a wording dial, not a mathematical strength. Raising it doesn't scale a weight like CFG; it just tells the model in plainer terms to lean on the reference.
The inputs that matter
- CLIP - must be the krea2 text encoder (the loader set to type
krea2), not a checkpoint's bundled CLIP. The node callstokenize(..., images=[...]), which stock encoders can't do. - 风格参考图 (style_image) - the reference. Pick something with clear style and minimal subject clutter; a busy subject tends to leak into the output.
- 正面提示词 (prompt) - describe the target subject and scene. The author's advice: don't re-describe the reference's subject, or the model will happily borrow it.
- 语义风格强度 (style_strength) - 轻微/平衡/强烈. Start at 轻微 or 平衡.
- 视觉编码分辨率 (vision_resolution) - default 384, range 128–1024. It's a total-pixel budget the reference is area-downscaled to before encoding. 384 is stable; 512 keeps more detail at the cost of speed and VRAM.
- 自定义风格指令 (custom_instruction) - optional. Fill it in and it replaces the preset wording (your prompt is still appended), useful when the built-in phrasing isn't pushing the direction you want.
Output is one 条件 (CONDITIONING) → KSampler's positive. The README's Turbo starting point: 8 steps, CFG 1.0, er_sde + simple, denoise 1.0.
Install
Easiest via ComfyUI Manager - search "Krea2 Style Refrence" and install - or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/DocWorkBox/ComfyUI_Krea2_Style_Refrence.git
Then restart ComfyUI. No requirements.txt, no Python deps (dependencies = [] in pyproject) - it uses only Comfy core and torch. The work is in the model files, which the pack doesn't bundle. You need all three, not one:
diffusion_models/krea2_turbo_fp8.safetensors
text_encoders/qwen3vl_4b_fp8_scaled.safetensors
vae/qwen_image_vae.safetensors
People routinely grab the diffusion model and skip the other two, then report the pack as broken. Missing the Qwen3-VL text encoder in particular means no image path at all.
Common issues
- Style too weak - before raising
vision_resolution, try a more explicitcustom_instruction. The author's own ordering: instruction first, resolution second. - Reference subject creeps in - lower
style_strengthand make the prompt's subject unambiguous. The built-in instruction already says "do not copy the subject," but wording only goes so far. - It's still Krea 2 - the open weights went through an alignment pass the hosted model didn't, so flattened expressions and dropped body/violence clauses still bite here. That's a model property, not a node bug.
- Expect a style guide, not a copy - you'll get the visual language, not the reference's subject. If you need the subject kept too, that's the pack's fusion node and an img2img denoise dial.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | 加载类型应为 krea2 的文本编码器。节点会调用 clip.tokenize(..., images=[参考图])。 | |
| style_image | IMAGE | 进入 Qwen3-VL 图像编码路径的参考图。适合提供色彩、材质、笔触、光影和整体视觉语言。 | |
| prompt | STRING | 目标图像的文字描述。参考图只作为风格语义输入,不建议在这里重复描述参考图主体。 | |
| style_strength | COMBO | 轻微 | 通过提示词措辞控制参考图影响:轻微更保守,强烈更主动;不是采样器里的数学强度。 |
| vision_resolution | INT | 384128–1024 | 参考图送入 Qwen3-VL 前按总像素缩放到此边长平方。384 较稳,512 保留更多细节但更慢。 |
| custom_instructionopt | STRING | 可选。留空使用上方强度预设;填写后会替代预设指令,仍会附加目标提示词。 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 条件 | CONDITIONING | — |