Nodes/ComfyUI_LucidFlux/LucidFlux_SM_Encode
ComfyUI Node

LucidFlux_SM_Encode

LucidFlux's conditioning stage — and the OOM trap everyone hits first

By smthemex·Created 11 months ago·Updated 3 months ago· 62
LucidFlux_SM_Encode
  • CLIP_VISION
  • conditioning
  • positive
  • condition
emb
connector
model_type

What it is

LucidFlux_SM_Encode is where people try to be clever and crash. It's the conditioning stage of the LucidFlux pipeline - the thing that turns your degraded input image into the tensors the custom sampler actually denoises against. If the pipeline is Diffbir (prep) → this (encode) → Model → KSampler, this node is the middle leg, and it's the one with the least obvious wiring.

How it works

Here's what happens mechanically. LucidFlux is caption-free - there's no text prompt in the normal sense. Instead of encoding a prompt at inference time, the author ships precomputed text embeddings (prompt_embeddings.pt) and fuses them with image embeddings built from your input. The encode stage:

  1. Takes the conditioning output of LucidFlux_SM_Diffbir (the LQ and LDR image conditions).
  2. Runs your input image through the CLIP_VISION encoder - a SigLIP2 so400m model, which you load with the stock CLIPVisionLoader and drop in.
  3. Passes those SigLIP features through a Redux-style image encoder (lucid_connector.pth) to get image embeddings.
  4. Concatenates those with the precomputed text embeddings and hands the whole bundle to the sampler.

The inputs that matter

So the inputs that matter:

  • CLIP_VISION: the SigLIP2 so400m safetensors (rename model.safetensors to siglip2-so400m-patch16-512.safetensors or every SigLIP model you own collides).
  • conditioning: straight from LucidFlux_SM_Diffbir.
  • emb: prompt_embeddings.pt, the precomputed embeddings. This is the intended caption-free path.
  • connector: lucid_connector.pth, the image-embedding bridge.
  • model_type: bf16 / f32, matching the Model node.
  • positive (optional): a CONDITIONING input if you want to drive restoration with a real text prompt instead of the precomputed embeddings.

Output: condition, which goes to LucidFlux_SM_KSampler. Nothing else.

The OOM trap

Now the trap, and it's the most-reported failure in the whole pack. A community thread from October 2025 (r/StableDiffusion, the top result for "LucidFlux") opens with exactly this: the example workflows shipped with the "positive" input unconnected and errored, and the poster tried to fix it by connecting a CLIP Encode - instant OOM, even on an RTX 5090. The README has the answer buried in Chinese: 已适配,使用时不要连clip - "already adapted, don't connect a CLIP when using [the precomputed embeddings]." The precomputed prompt_embeddings.pt is your prompt. Wire in a text encoder anyway and you're stacking a full T5-XXL on top of a 12B transformer, and that's the OOM. Leave positive empty when emb is set, and only feed it a real conditioning if you're deliberately doing the text-driven path.

Install

Install-wise this node leans on the pack's shared setup: clone the repo, pip install -r requirements.txt, restart. Its specific dependencies are the SigLIP vision model and lucid_connector.pth + prompt_embeddings.pt in models/LucidFlux/. Grab them from W2GenAI/LucidFlux and smthem/LucidFLUX-connector on Hugging Face.

One more thing worth knowing: the condition output is a fat dictionary that carries hidden state - the processed images, your target width/height, and the infer_2k flag from the Diffbir node. It's not a standard ComfyUI conditioning object, and that's fine as long as you keep it paired with its own sampler and decoder from this pack. Try to splice in a stock Flux KSampler after it and you'll get a type error at best and a wrong render at worst. If the node looks overwhelming, remember: the only choices you actually make are the three file pickers and bf16.

CategoryLucidFlux_SM

Inputs (6)

NameTypeDefaultDescription
CLIP_VISIONCLIP_VISION
conditioningCONDITIONING
embCOMBO1 options: none
connectorCOMBO1 options: none
model_typeCOMBO2 options: bf16, f32
positiveoptCONDITIONING

Outputs (1)

NameTypeDescription
conditionCONDITIONING