Nodes/Eric_Krea2/Eric Krea2 Vision Prompt
ComfyUI Node

Eric Krea2 Vision Prompt

Prompt from a picture — the way Krea 2 was trained to take it

By EricRollei·Created 2 months ago·Updated about a month ago· 11
Eric Krea2 Vision Prompt
  • krea2_pipeline
  • image1
  • image2
  • image3
  • conditioning
prompt
vision_positionbefore prompt
vision_megapixels0.40
vision_processor_sourceH:\Testing\Qwen3-VL-4B-Instruct-heretic-7refusal
max_sequence_length512
print_prompttrue
vision_templatepicture_n

Want Krea 2 to "draw toward" a reference image without training anything? This node is the honest way to do it. Eric Krea2 Vision Prompt pushes 1–3 reference images through Krea 2's own text encoder's vision path - the model's encoder is a Qwen3-VL vision-language model, not a text-only CLIP - and emits a KREA2_CONDITIONING you wire into the Multi-Stage Ultra node's prompt_conditioning input. A "prompt from a picture" effect, done with the mechanism Krea 2 was actually conditioned with.

What it fixes

The pack's README is open about the trap it's avoiding. The common community pattern is to reuse ComfyUI's TextEncodeQwenImageEditPlus node for image grounding, and it quietly fails on Krea 2 in two ways: the base Krea 2 DiT has no reference-latent pathway, so that node's VAE-encoded reference is silently discarded (Krea2.extra_conds never reads it), and once an image is attached it falls back to Qwen3-VL's generic image-description template instead of the descriptor template Krea 2 was trained with. This node has no VAE step at all - nothing to discard - and it always uses Krea 2's own prompt_template_encode_prefix/_suffix, read straight off the loaded pipeline so it can't drift out of sync.

Be clear about what it isn't: this is semantic grounding, not pixel editing. No structure or identity preservation from the image alone. For structure, pair it with img2img (VAE Encode → init_latent): img2img supplies what to start denoising from, Vision Prompt supplies what to draw toward. They're independent channels and compose freely, even with different source images.

It's positive-conditioning only. When prompt_conditioning is connected, the Ultra node's own prompt field goes completely inert - put your text in this node's prompt field. Required inputs: krea2_pipeline and prompt; optional: image1/image2/image3.

The token budget - read this before your first run

Krea 2 was trained with a fixed 512-token text budget (prefix + images + prompt, always padded/truncated to exactly that). One full-resolution (1 MP) reference image alone is ~988 tokens - nearly double the whole budget before your prompt. So the node auto-shares ~0.40 MP across however many images you connect (1 image ≈ 0.40 MP, 2 ≈ 0.20 each, 3 ≈ 0.13 each). vision_megapixels is a ceiling on top of that auto-share - lower it to reserve room for a long prompt; it never raises the share.

Two inputs with real teeth:

  • vision_processor_source - Krea 2's diffusers folder ships text-only, so this must point at any full Qwen3-VL-4B checkpoint folder that has a preprocessor_config.json. The default is a Windows path from the author's machine (H:\Testing\...) - you will need to change it. Only the image-preprocessing config is read from here; the vision tower is identical.
  • vision_template - picture_n matches ai-toolkit REFERENCE training (the ostris lineage, e.g. the Style Reference LoRA); bare_edit matches the identity/instruction EDIT lineage's grounded encode. Match it to your LoRA's training.

max_sequence_length must match what your generation node uses (Krea 2 default 512), and print_prompt (on by default) is your friend for the first test - it prints the assembled prompt and token shapes.

Install

Part of Krea2_ComfyUI_Advanced (Eric Hiss / EricRollei):

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Krea2_ComfyUI_Advanced

Restart, or install via ComfyUI Manager. The pack needs the diffusers build with Krea2Pipeline (install from source with --force-reinstall per the README) and transformers new enough for Qwen3VLModel.

Gotchas

The budget error is a feature: rather than silently truncating into the image-token block - which corrupts position ids and crashes deep inside get_rope_index with a cryptic shape mismatch - it raises a clear error with a suggested vision_megapixels value. If you see that error, lower the ceiling. And don't expect a reference to survive long prompts: at 3 images plus 200 words, you're grinding against the 512-token wall, and the node will tell you so.

CategoryEric/Krea2

Inputs (11)

NameTypeDefaultDescription
krea2_pipelineKREA2_PIPELINE
promptSTRINGYour instruction/description. Combined with the reference image(s) inside Krea2's own trained descriptor template - not a generic image-caption template.
image1optIMAGEReference image 1. Fed through the vision path only - no VAE, nothing for Krea2's DiT to silently discard.
image2optIMAGEReference image 2 (optional).
image3optIMAGEReference image 3 (optional).
vision_positionoptCOMBObefore promptWhere the 'Picture N: <image>' placeholders sit relative to your prompt text inside the user turn. Matches the community node's convention.
vision_megapixelsoptFLOAT0.400.05–4PER-IMAGE ceiling in megapixels, before auto-sharing (see below). Krea2's text budget is fixed at 512 tokens total (prefix + all images + your prompt) - it doesn't grow with more images, so this node automatically divides ~0.40 MP of shared budget across however many images are connected (1 image ~0.40 MP, 2 images ~0.20 MP each, 3 images ~0.13 MP each) and takes the smaller of that share and this ceiling. Lower this to reserve more room for a long prompt; it never raises the auto-share, only caps it further.
vision_processor_sourceoptSTRINGH:\Testing\Qwen3-VL-4B-Instruct-heretic-7refusalFolder with a preprocessor_config.json for the Qwen3-VL image processor. Krea2's own diffusers folder ships text-only (no image config), so this points at any full Qwen3-VL-4B checkpoint folder that has one - the vision tower is identical, only the image-preprocessing CONFIG (resize/normalize rules) is read from here.
max_sequence_lengthoptINT51264–1024Must match the value your generation node uses (Krea2 default 512).
print_promptoptBOOLEANtruePrint the assembled prompt text + token/image-grid shapes to the console. Turn this on for your first test of this node.
vision_templateoptCOMBOpicture_nHow the vision blocks are labeled inside the user turn - match the LoRA's training. picture_n: 'Picture 1: <vision>' markers - matches ai-toolkit REFERENCE training (ostris lineage, e.g. Style Reference LoRA; pair with the Reference Latents node's ostris_t0 recipe at ~0.15 MP here). bare_edit: bare vision blocks, no labels - matches the identity/instruction EDIT lineage's grounded encode (predict_velocity_edit; pair with the edit_frame recipe). Those LoRAs train the VLM view at ~384-768px, so vision_megapixels ~0.30-0.45 is in-distribution here. For CFG > 1 edits (Raw removals), ground the negative the same way: this node with an EMPTY prompt and the same image.

Outputs (1)

NameTypeDescription
conditioningKREA2_CONDITIONING