IF Encode
A ComfyUI node in Zuellni/IF with 3 inputs and 2 outputs.
- model
- POSITIVE
- NEGATIVE
If you've only ever used Stable Diffusion, the first thing that will trip you up about the DeepFloyd IF pipeline is that your prompt doesn't go near a CLIP model. DeepFloyd uses a frozen T5-XXL text encoder, and this node is the part of the pipeline that talks to it. You feed it your positive and negative strings plus the encoder model from IF Load Encoder, and it returns the POSITIVE and NEGATIVE embedding tensors that IF Stage I and IF Stage II consume.
What it is
Think of it as the DeepFloyd equivalent of ComfyUI's CLIP Text Encode, except it sits between a custom loader and custom stage nodes instead of the standard sampler stack. There's no way around it: IF Stage I and Stage II take POSITIVE/NEGATIVE sockets, not raw text, so Encode is mandatory plumbing in any IF workflow.
Why T5 changes how you write prompts
T5-XXL is a full transformer encoder, not CLIP, and that changes the rules you're used to. There's no 77-token truncation - T5 reads long, sentence-like prompts in full, and it's much better at them than SD's CLIP ever was. But it also means the habits from SDXL don't transfer:
(word:1.3)attention weighting does nothing - T5 doesn't parse that syntax.- Comma-separated booru tags work poorly. Write natural sentences instead: "a cinematic photo of a cat sitting on a windowsill, golden hour", not
cat, best quality, masterpiece. - The negative prompt is still meaningful at the CFG values DeepFloyd wants (7–8), but don't pad it with boilerplate - keep it short and specific.
How it works
Under the hood it's a single call to the diffusers pipeline's encode_prompt(prompt=positive, negative_prompt=negative) on the model returned by the encoder loader. That's the whole node - which is why it's fast to run, but note it re-encodes every time the graph executes. If you're iterating on sampler settings, the encode cost is negligible compared to Stage I; if you're running large batches, leave the encode node alone and only rerun the stages.
Inputs and outputs
Inputs are model (the S0_MODEL socket from IF Load Encoder), and positive / negative multiline strings - both default empty, which is a trap. An empty positive genuinely encodes as "nothing," so if you load a workflow and get mush, check you actually typed a prompt. Outputs are POSITIVE and NEGATIVE, wired to Stage I or Stage II.
Install and the token gotcha
This node is part of Zuellni/ComfyUI-Custom-Nodes. Install via ComfyUI Manager (search "Zuellni") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Zuellni/ComfyUI-Custom-Nodes
The big one: DeepFloyd's models are gated on HuggingFace. You must log into HF, accept the model's terms of use, and create an access token, then log in from the machine running ComfyUI:
huggingface-cli login
Without a valid token, the encoder download fails with a 401/403 and every IF node errors out. And remember: the pack is archived - the author's own README says IF "has a lot of issues." It works, but you're running unmaintained code against a moving diffusers target; budget for the possibility of version drift biting you later.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | S0_MODEL | — | |
| positive | STRING | — | |
| negative | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| POSITIVE | POSITIVE | — |
| NEGATIVE | NEGATIVE | — |