Nodes/ComfyUI Krea2 Style Transfer/Krea2 Style Reference
ComfyUI Node

Krea2 Style Reference

Krea2 Style Reference

By jieg9341-lab·Created about a month ago·Updated about a month ago· 147
Krea2 Style Reference
  • vae
  • target_latent
  • reference_image
  • reference_latent
  • reference_preview
  • debug
fitcrop
upscale_methodlanczos

What it is

This is the prep node for the whole Krea2 Style Transfer pack - the thing you run before you can do anything else with it. Krea2 Style Reference takes a plain image and turns it into the reference_latent that the main Krea2 Style Transfer node (or its two-reference sibling) actually consumes. You can't skip it and feed a raw image straight into the style-transfer node; the schema doesn't take an IMAGE there, it takes a LATENT, and this is where that latent gets made.

If you've used any style- or identity-conditioning setup before - IP-Adapter being the obvious comparison - you'll recognize the shape of the workflow even though the mechanism underneath is different. There, an image encoder turns your reference into an embedding a trained adapter understands. Here, there's no trained adapter at all: the reference gets VAE-encoded into the same latent space your generation lives in, sized to match, so the style-transfer node can read it directly during sampling.

How it works

The one line in the README that matters most: use the same target latent that will feed your sampler. The node adapts the reference image to that latent's size before encoding, so the style path lines up with the generation you're actually about to run. Skip this and you risk a size mismatch between the reference and target latents further down the chain - the pack's own limitations note calls this out directly as something the current route doesn't handle.

Inputs and outputs that matter

Three required inputs plus two small choices. vae is your Krea2 VAE (the Qwen-Image VAE Krea 2 ships with), target_latent is the empty latent your sampler is about to denoise - wire the same latent you're using for KSampler, ideally coming out of the pack's own Krea2 Size Preset node so both ends agree on dimensions from the start. reference_image is the actual picture you want the style from.

fit decides what happens when your reference image's aspect ratio doesn't match the target: crop (the default) trims to fit, contain fits the whole image in without cropping, stretch distorts it to match exactly. Crop is the sane default for most photos; reach for contain if the composition near the edges of your reference actually matters to the style you're after. upscale_method controls how the image gets resized if it needs to grow or shrink - lanczos is the default and a reasonable one for photographic references; the other options (bicubic, bilinear, nearest-exact, area) are there if you're chasing a specific look or dealing with a low-res source.

Outputs: reference_latent is the one that matters - that's what plugs into Krea2 Style Transfer's reference_latent input (or into Krea2 Two Style References if you're building a two-image setup). reference_preview gives you back an IMAGE of what actually got encoded, post-crop and post-resize - worth wiring to a Preview Image node the first time you use a new reference, so you can catch a bad crop before you burn a full generation on it. debug is a STRING output for troubleshooting; hook it up to Show Text if something's not behaving.

Installing it

Same pack, same install as every other node here: ComfyUI Manager search for "ComfyUI Krea2 Style Transfer," or manually cd ComfyUI/custom_nodes && git clone https://github.com/jieg9341-lab/ComfyUI-Krea2-StyleTransfer and restart. No extra model download for the node itself - but you do need a functioning Krea2 setup already loaded (the krea2 UNet, the Qwen3-VL text encoder, and the Qwen-Image VAE), since this node's vae input expects that VAE specifically.

Where people get burned

The size-matching requirement is the whole story here. If you build your target latent one way and your reference latent another, you're setting yourself up for a mismatch downstream - the fix is boring but reliable: generate your target latent once (say, from Krea2 Size Preset), and feed that exact same latent into both this node's target_latent input and your KSampler. Don't build two separate empty latents that happen to look like the same resolution; use the same node output for both.

Beyond that, this node is only doing size and format prep - it has no opinion on whether your reference image is a good one. A generic or low-contrast source image won't give the downstream style-transfer node much of a signal to latch onto, no matter how carefully you crop it. That part's on your reference image, not this node.

CategoryKrea2 Style Transfer

Inputs (5)

NameTypeDefaultDescription
vaeVAE
target_latentLATENT
reference_imageIMAGE
fitCOMBOcrop3 options: crop, contain, stretch
upscale_methodCOMBOlanczos5 options: lanczos, bicubic, bilinear, nearest-exact, area

Outputs (3)

NameTypeDescription
reference_latentLATENT
reference_previewIMAGE
debugSTRING