Sampler → Dict🗂️
The Sampler Object, On Board
- dict
- value
- dict
The advanced sampling API treats the sampler - the solver you pick, like Euler or DPM++ - as an object you hand to a sampler node, not just a dropdown inside it. DictAddSampler stores that object in your dict under a named key. If you're assembling sampling from explicit parts, this is how the sampler itself rides the bus.
It's grouped under Add/Advanced with the guider, noise, and sigmas nodes. The SAMPLER value is a wired input from a sampler-selecting node (think KSamplerSelect), validated against the sampler type before storage.
How it works
Same Dict Tools engine as the whole pack: validate, store under the key, return a new frozendict without mutating your input, and sort keys alphabetically on update. The sampler is held by reference, so bundling is cheap.
The pattern: advanced sampling needs guider + noise + sampler + sigmas to converge on one node. The four Dict Add nodes let you pack them all into one dict, drag a single connection anywhere, and extract the pieces at the sampler. For multi-stage workflows where two stages use different solvers, distinct keys mean each stage pulls its own sampler from the same dict.
The inputs that matter
- key (STRING) - the name you'll fetch the sampler back by.
- cleanup_key (BOOL, default on) - trims spaces/newlines from the key.
- dict (DICT, optional) - an existing dict to extend, or empty to start one.
- value (SAMPLER, optional) - the wired sampler object.
Output is dict (DICT). Get it back with DictExtractSampler.
Install
ComfyUI Manager: search Dict Tools, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart after. Only dependency is frozendict, auto-installed by Manager.
Gotchas
Pack-wide: requires ComfyUI 0.18.0+ (newer node API). The Advanced nodes are doubly sensitive to version: if the SAMPLER input type doesn't appear at all, your ComfyUI predates the explicit-sampler API - update it.
And the usual snapshot reminder: picking a different solver after you've added the sampler to the dict doesn't change what's stored. Re-add the new sampler object if you switch mid-workflow, or you'll keep sampling with the old solver and spend a while wondering why nothing changed.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | Key (name) of the item inserted into the dict. | |
| cleanup_key | BOOLEAN | true | Automatically remove leading/trailing spaces and extra newlines from the key. |
| dictopt | DICT | An (optional) Dictionary to work with. | |
| valueopt | SAMPLER | The actual Sampler-type item to add into the Dict. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |