Nodes/ComfyUI-EditUtils/EditUtils: Any2Image lrzjason
ComfyUI Node

EditUtils: Any2Image lrzjason

The Converter Node That Just Lets a Wire Be a Wire

By lrzjason·Created 7 months ago·Updated 16 days ago· 207
EditUtils: Any2Image lrzjason
  • item
  • item

Any2Image_EditUtils is the least glamorous node in this pack and also one of the ones that'll actually save your workflow. It takes one input, item, typed as ANY, and passes it straight through as an IMAGE. That's the whole node. One wire in, one wire out, nothing touched.

So why does it exist? Because ComfyUI's type system is picky about sockets, and this pack's design isn't. The EditUtils Output Extractors hand you a custom_output socket typed as ANY - a black box that might contain a mask, a dict of latents, or in this case, an image. If you've checked (or already know) that a particular ANY output is actually holding an image tensor, Any2Image is the type-adapter that tells ComfyUI "yes, trust me, wire this into an IMAGE input." It's the same escape hatch as the wildcard ANY sockets the plumbing layer of ComfyUI is built on, except pointed the other direction: instead of a socket that accepts anything, it's a socket that claims one type.

The concrete spot you'll reach for it: BooguOutputExtractor's main_image output, or pulling an image out of a custom_output dict. The extractor already unwraps the value for you - but sometimes you've got the image sitting inside a generic ANY pipe (say, from ListExtractor_EditUtils grabbing an item out of a list of images), and the node you want to feed has a proper IMAGE socket. Any2Image bridges that gap so your graph doesn't fail type-checking.

Here's the catch, and it's the whole thing to understand: there is no validation. The node doesn't look at what you give it and it certainly doesn't convert anything. Feed it a conditioning dict and it will happily emit that dict wearing an IMAGE label, and the downstream node will explode when it tries to do tensor math on it. The docstring for this node family is blunt about it - wrong types fail downstream, not here. So use it only when you're sure of the contents, and if a graph suddenly errors with "expected IMAGE got...", suspect the ANY node you trusted a little too much.

Install is one step and it's shared with the whole pack: ComfyUI Manager (search "EditUtils"), or git clone https://github.com/lrzjason/ComfyUI-EditUtils into ComfyUI/custom_nodes, then restart. Zero dependencies, zero models - it's plumbing. Its sibling Any2Latent_EditUtils does the identical trick but wraps the value into a latent dict, for when the thing you're carrying is a latent tensor instead.

Categoryadvanced/conditioning

Inputs (1)

NameTypeDefaultDescription
itemANY

Outputs (1)

NameTypeDescription
itemIMAGE