Nodes/comfyui-spawner-nodes/Conditioning 构造器
ComfyUI Node

Conditioning 构造器

Rebuild a CONDITIONING from raw tensors when you've fiddled with the guts

By spawner1145·Created about a year ago·Updated 11 months ago· 2
Conditioning 构造器
  • emb
  • pooled_emb
  • attention_mask
  • details_dict
  • CONDITIONING

The mirror image of this pack's ConditioningInspector. Inspector cracks a CONDITIONING open into raw tensors; Packer takes raw tensors and builds a CONDITIONING back out of them. Between the two you have the whole loop you need to poke at prompt embeddings by hand - the kind of thing you do when a standard CLIP Text Encode isn't giving you enough rope.

Why you'd reach for it, concretely: you inspected a conditioning, ran the embedding tensor through TensorConcatenation or TensorCrossAttention, and now you need to hand the result back to a KSampler. That's Packer's whole job. It's also how you build a conditioning from scratch - say, take a pooled vector you got from somewhere else and make a valid SDXL-style conditioning out of it.

The inputs that matter:

  • emb (required) - the token embedding tensor, [batch, seq_len, hidden_dim]. The only thing you can't skip.
  • pooled_emb (optional) - the pooled vector. If you give one, Packer validates that its batch size and feature dim match emb and raises a clear error otherwise. If you don't, and the input details didn't already carry a pooled_output, it synthesizes zeros as a placeholder so downstream code doesn't crash.
  • attention_mask (optional) - a mask tensor, stored into the details dict.
  • details_dict (optional, any type) - arbitrary extra metadata you want carried along. Handy if you're round-tripping: feed it the details_dict straight out of ConditioningInspector and nothing gets lost.

Under the hood it fills in the bookkeeping a real conditioning needs: it writes seq_len and max_seq_len from the tensor's sequence dimension, and only drops in pooled_output/attention_mask when you actually provided them. Everything rides in the standard ComfyUI tuple format, [(emb, details)], so the output drops straight into a KSampler's positive/negative socket or anything else that reads CONDITIONING.

The honest caveat, same as every node in this pack's tensor family: the TENSOR type here is pack-internal, so whatever you build needs to come from or go to this pack's nodes. And on the pooled-output front, remember the fallback is zeros - if you pack a conditioning without a real pooled vector and feed it to an SDXL pipeline, you're feeding it a zeros vector as if it were meaningful pooled data. SDXL will not throw an error; it will just quietly use garbage. If you're rebuilding SDXL conditioning, wire a real pooled_emb in.

Install

ComfyUI Manager, search comfyui-spawner-nodes, install and restart. Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/spawner1145/comfyui-spawner-nodes

The pack's dependencies are light - piexif, pypng, xmltodict, all pure Python, no model downloads. README is basically empty, the UI labels are in Chinese, and the author (spawner1145) is a Chinese-speaking dev known for a Wan2.1 extension for SD WebUI. Treat it as a capable but sparsely documented personal toolkit.

Troubleshooting

  • pooled_emb batch/feature mismatch error - the error message tells you exactly which dimension disagreed. Most common cause: you pooled or merged a tensor and changed its feature width, then forgot to run it through TensorShapeAdapter first.
  • Output conditioning "does nothing" in the sampler - you almost certainly packed zeros as pooled_output into an SDXL model. Provide a real pooled vector or skip the pooled path entirely.
  • Silent failure - Packer doesn't warn if you pass a details_dict with a pooled_output that mismatches emb. Inspector it first if results look wrong.
Categoryspawner/conditioning

Inputs (4)

NameTypeDefaultDescription
embTENSOR
pooled_emboptTENSOR
attention_maskoptTENSOR
details_dictopt*

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING