DreamO Ref Image Encode
From reference photo to reference latent — the ip / id / style choice decides everything
- pixels
- vae
- dreamo_processor
- LATENT
- IMAGE
This is the node where you tell DreamO what your reference image is and what job it should do. DreamORefEncode takes a photo, preprocesses it according to the task you pick, and encodes it into the LATENT that ApplyDreamO will stitch into Flux. Get the task choice right and DreamO is magic; get it wrong and you're fighting the model. That choice - the ref_task enum - is the whole node.
The three tasks
ip- subject transfer. The reference gets its background removed with BEN2, then encodes. Think "put this product into a new scene" or consistent character in a fresh setting.id- identity, PuLID-style. The face is detected with retinaface, aligned, cropped to 512, and run through face parsing that keeps only the face features (background labels are whitened out). The authors literally say "similar to PuLID" in the tooltip.style- style transfer. The background is kept on purpose, because the whole point is capturing the scene's look. And you still need the trigger meta prompt in your text prompt to activate style transfer - that's the one task where the prompt isn't optional.
The source has a sensible fallback baked in: if id runs on a photo with no detectable face, it silently treats the image as ip and removes the background instead of erroring. If you've ever used PuLID, the whole flow will feel familiar - same face-alignment pipeline, same idea of encoding a cleaned-up reference, just bundled into one node.
How the encoding works
After the task-specific preprocessing, the image is resized to a square-ish area of resolution × resolution, then VAE-encoded with a twist: the latent is normalized by (latent − 0.1159) × 0.3611. That shift-and-scale matters - DreamO's reference latents live in a different scale than vanilla Flux VAE output, and it's one of those details that make or break results. ApplyDreamO's img-concat mechanism then adds a task embedding (which task) and an index embedding (which reference slot) to make the tokens legible.
The outputs:
LATENT- wire into ApplyDreamO'sref1,ref2orref3.IMAGE- a preview of the preprocessed reference. This is the unsung hero. Forid, check that the face crop actually landed on the right face (the detector picks the center face). If the crop is wrong, your identity will be wrong, and the preview tells you before you burn 12 steps finding out.
The inputs that matter
pixels,vae,dreamo_processor- image, the VAE you loaded for Flux, and the processor from DreamOProcessorLoader.resolution(default 512, min 512, max 1024, step 16) - the reference resolution. Higher = more reference detail, more VRAM. 512 is the shipped default and fine for most faces; bump to 768/1024 for style or subject work.ref_task- the enum above. Defaults toip.
The v1.1 gotcha
resolution is new in DreamO v1.1. If you upgraded the pack but kept a workflow saved before June 2025, DreamORefEncode changes shape under you and people report the whole workflow coming back as blank images - the node needs to be re-added and re-wired, not silently patched. That one bit people; it's now the top thing to check after any DreamO upgrade.
Install and usage
Same pack as the other two nodes - ComfyUI Manager (search "DreamO") or clone https://github.com/ToTheBeginning/ComfyUI-DreamO into custom_nodes, pip install -r requirements.txt, restart. The id and ip preprocessing models download automatically to models/dreamo on first use. And remember the pack-wide rule: run the sampler at cfg=1 with few steps (the shipped v1.1 workflow uses 12 steps, euler, simple) - DreamO doesn't implement true CFG, so guidance only hurts.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| pixels | IMAGE | — | |
| vae | VAE | — | |
| dreamo_processor | DREAMO_PROCESSOR | — | |
| resolution | INT | 512512–1024 | The resolution of the reference image. |
| ref_task | COMBO | ip | ip: will remove the backgound of the reference image. id: will align&crop the face from the reference image, similar to PuLID style: will keep the backgound of the reference image. you still need trigger meta prompt to activate the style transfer task |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |
| IMAGE | IMAGE | — |