Deserialize Any (Yogurt Nodes)
Pickle round-trip for any Python object — and the security warning that comes with it
- bytes_data
- data
Deserialize Any is the receiving end of the pack's Serialize Any node: you feed it raw bytes and it turns them back into a live Python object via pickle. That's a powerful trick in ComfyUI, where most nodes pass typed values (images, strings, tensors) - *-typed "any" data can carry dicts, lists, nested structures, whatever you need, but only some nodes can shuttle it around. Pickle to bytes and back is how you move arbitrary objects through BYTES ports, save them to disk, or hand them across a boundary that only understands bytes.
Where does that actually bite? ComfyUI's own serialization for workflows handles standard types fine, but if you're building something like a custom data store - serialize a complex result, save it to a file with YogurtSaveBytesBridge, reload it in a later run - this is the node that closes the loop. It's also the natural pair for the pack's Deserialize Any ↔ Serialize Any pattern when a JSON path would lose information (say, a tuple with a torch tensor in it).
The warning you have to read
Pickle is not a safe format. pickle.loads() can execute arbitrary code when it deserializes, which means unpickling bytes you didn't produce yourself is a genuinely bad idea - the community has had real malware incidents through exactly this kind of "load and run data" path in custom nodes. The rule is simple: only deserialize data you created. If bytes came from the internet or a stranger's workflow, don't feed them here. The node itself does no validation; the safety is entirely on you.
How it works
One call, pickle.loads(bytes_data), wrapped so a failure raises a clean error message ("Failed to deserialize data: ...") instead of a raw traceback. The output data is *-typed, so it plugs into any wildcard input downstream. If you pickle a dict, you get a dict back; pickle a list of tensors, you get that.
Inputs & output
bytes_data- the BYTES you got from aSerialize Any, aLoad Bytesnode, or a saved file.data- the reconstructed object,*-typed for maximum wiring freedom.
Install
Part of ComfyUI-YogurtNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Or via ComfyUI Manager (search "YogurtNodes"), then restart. It's under "Yogurt Nodes" → IO, right next to Serialize Any.
Common issues
- "Failed to deserialize data" - the bytes aren't a valid pickle payload, or were produced by a different Python version. This is the expected failure when you feed it random or corrupt bytes.
- Wrong object comes back - pickle is version-sensitive and can fail across Python major versions. If you save serialized data and load it after an environment upgrade, re-serialize.
- "Is this safe?" - only for your own data. Re-read the warning above.
For most workflow plumbing, JSON is friendlier and human-readable - the pack has a whole JSON family for that. Pickle earns its keep when you need to preserve exact object types or tensor contents. Just keep it to data you trust.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| bytes_data | BYTES | The bytes data to be deserialized using pickle. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| data | * | — |