Nodes/🗂️ Dict Tools/🟢Upscale → Dict🗂️
ComfyUI Node

🟢Upscale → Dict🗂️

Stash your upscaler on the bus

By Lex-DRL·Created 4 months ago·Updated 4 months ago· 1
🟢Upscale → Dict🗂️
  • dict
  • value
  • dict
key
cleanup_keytrue

Upscaling workflows are where ComfyUI graphs turn into spaghetti. Between the model loader, the tiler, the seam fixer, and the final save, an upscale branch can have the same model reference threaded through four different nodes. DictAddUpscale ("🟢Upscale → Dict🗂️") gives you one clean way to stop that: take the upscale model once, at the top of the graph, and let it ride around inside a dictionary.

It's part of the "models bus" pattern this pack is built around. Instead of deciding once, at workflow-build time, that your upscale branch always uses RealESRGAN 4x, you store whichever model you picked in the dict and treat the dict as the single source of truth. Swap the loader upstream, and every consumer that extracts from the dict follows along. That's the whole appeal - configuration lives in one place, not scattered across ten wires.

What you set

  • key - the name of the slot, e.g. upscaler.
  • cleanup_key (on by default) - strips stray spaces/newlines from the key, so upscaler and upscaler are the same slot.
  • value - the upscale model itself. This is an optional input of type UPSCALE_MODEL, so you'd feed it straight from an Upscale Model Loader (or from whatever custom upscaler loader you use).
  • dict (optional) - an existing dictionary to add into. Leave it empty to start fresh.

The single dict output chains onto other Add nodes or feeds the bus onward.

The mechanics, briefly

The value is type-checked at runtime: if you try to stuff something that isn't a real upscale model in, the node refuses rather than storing garbage. The resulting dict is a frozendict (immutable) with alphabetically sorted keys - which, again, is fine, because you look things up by name.

One honest note: storing an upscale model in a dict is useful mostly when you have a genuinely modular workflow - a base dict for the whole pipeline, an override dict for the upscale stage, that sort of thing. If you have one upscale branch and never change the model, a single straight wire is arguably clearer. The dict earns its keep the moment the graph gets big enough that you can't see the whole thing on one screen.

Install

Same as every node in the pack - it's a small, focused pack by Lex Darlog with one tiny dependency (frozendict) and no model downloads. ComfyUI Manager: search "Dict Tools". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools

Restart ComfyUI. It needs ComfyUI 0.18.0+ (it uses the newer extension API), so if the nodes don't appear after a restart, update ComfyUI first.

Common issues

The usual suspects: a key misspelling (extraction errors out loudly with "No such key in Dict", which is by design), and forgetting that the model has to come from a loader that outputs the UPSCALE_MODEL type. Also worth knowing - there's no built-in dict inspector in the pack, so if you're unsure whether the right model is in there, extract it and check the widget, or pair the pack with StableLlama's Basic Data Handling for full dict tools. This node is the tidy alternative to a wall of duplicate wires, and once you're building multi-stage upscale pipelines, you'll want it.

Category🗂️ Dict Tools/Add/Models

Inputs (4)

NameTypeDefaultDescription
keySTRINGKey (name) of the item inserted into the dict.
cleanup_keyBOOLEANtrueAutomatically remove leading/trailing spaces and extra newlines from the key.
dictoptDICTAn (optional) Dictionary to work with.
valueoptUPSCALE_MODELThe actual Upscale-type item to add into the Dict.

Outputs (1)

NameTypeDescription
dictDICT